module Rubylog::Goal

Public Instance Methods

prove() click to toggle source

Clients should implement this method. Yields for each possible solution of the predicate

# File lib/rubylog/goal.rb, line 4
def prove
  raise "#{self.class} should implement #prove"
end
solve(&block) click to toggle source
# File lib/rubylog/goal.rb, line 13
def solve &block
  goal = rubylog_match_variables 
  catch :rubylog_cut do
    goal.prove { block.call_with_rubylog_variables(goal.rubylog_variables) if block }
  end
end
true?() click to toggle source
# File lib/rubylog/goal.rb, line 8
def true?
  solve { return true }
  false
end