class Dry::Logic::Rule::Interface

def define_application

def define_application
  splat = variable_arity? ? SPLAT : EMPTY_ARRAY
  parameters = (unapplied_args + splat).join(", ")
  application = "@predicate[#{(curried_args + unapplied_args + splat).join(", ")}]"
  module_eval(<<~RUBY, __FILE__, __LINE__ + 1)
    def call(#{parameters})                          # def call(input0, input1, *rest)
      if #{application}                              #   if @predicate[@arg0, @arg1, input0, input1, *rest]
        Result::SUCCESS                              #     ::Dry::Logic::Result::Success
      else                                           #   else
        Result.new(false, id) { ast(#{parameters}) } #     ::Dry::Logic::Result.new(false, id) { ast(input0, input1, *rest) }
      end                                            #   end
    end                                              # end
                                                     #
    def [](#{parameters})                            # def [](@arg0, @arg1, input0, input1, *rest)
      #{application}                                 #   @predicate[@arg0, @arg1, input0, input1, *rest]
    end                                              # end
  RUBY
end