lib/rulog.rb
# XXX XXX should take a max number of answers -- there are cases where we want
# XXX XXX N of infinite answers
XXX XXX should take a max number of answers -- there are cases where we want
XXX XXX N of infinite answers
XXX XXX should take a max number of answers -- there are cases where we want XXX XXX N of infinite answers
def solve_multi goal
      answers = []
      amb = Ambit::Generator.new
      amb.trace if @trace > 2
      puts "\ngoal:\n  #{goal}\nanswer(s):\n" if @trace > 0
      answer = _solve amb, goal, [goal]
      if answer
        puts "  #{answer}\n" if @trace > 0
        answers << answer
        amb.fail!
      end
      puts "  no." if @trace > 0 and answers.size == 0
      answers
    rescue Ambit::ChoicesExhausted
      return answers
    end
def solve_multi goal answers = [ ] amb = Ambit :: Generator . new amb . trace if @trace > 2 puts "\ngoal:\n  #{goal}\nanswer(s):\n" if @trace > 0 answer = _solve amb , goal , [ goal ] if answer puts "  #{answer}\n" if @trace > 0 answers << answer amb . fail! end puts "  no." if @trace > 0 and answers . size == 0 answers rescue Ambit :: ChoicesExhausted return answers end
XXX XXX should take a max number of answers -- there are cases where we want
XXX XXX N of infinite answers
XXX XXX should take a max number of answers -- there are cases where we want XXX XXX N of infinite answers
goal