def report(kbase, binding, query, pmode, proof): if not pmode: pmode = print_mode # use current global mode else: pmode = pmode[0] if pmode == None: return binding # return solns to caller # else use pmode passed if binding == {}: print 'yes: (no variables)' else: if pmode[0] == 'vars': print 'yes: ', for var in binding.keys(): print var, '=', binding[var], ' ', print else: print 'yes: ' + external(substitute(query, binding)) if pmode[1] == 'all': return else: print if input_yes(kbase, 'show proof ? '): ignore = trace_tree(proof, binding, 0) if input_yes(kbase, 'more solutions? '): print return else: raise stop_proof
def report(kbase, binding, query, pmode): if not pmode: pmode = print_mode # use current global mode else: pmode = pmode[0] if binding == {}: print 'yes: (no variables)' else: if pmode[0] == 'vars': print 'yes: ', for var in binding.keys(): print var, '=', binding[var], ' ', print else: print 'yes: ' + external(substitute(query, binding)) if pmode[1] == 'all': return 1 else: return input_yes(kbase, 'more solutions? ')
def report(binding, query, pmode): if not pmode: pmode = print_mode # use current global mode else: pmode = pmode[0] if binding == {}: print "yes: (no variables)" else: if pmode[0] == "vars": print "yes: ", for var in binding.keys(): print var, "=", binding[var], " ", print else: print "yes: " + external(substitute(query, binding)) if pmode[1] == "all": return 1 else: return input_yes("more solutions? ")