예제 #1
0
def backward(rules, query, *pmode):
    global known, kbase                                # avoid extra args
    backwrd1.kbase = rules                             # set for browsing
    known, kbase = [['true']], rules                   # local to module
    try:
        for (stack, proof) in AND(query, [{}], [], []):
            try:
                report(stack[0], query, pmode, proof)
            except backtrack: 
                pass
        print 'no (more) solutions  [backwrd2.py]'
    except stop_proof: pass
예제 #2
0
def backward(rules, query, *pmode):
    global known, kbase  # avoid extra args
    backwrd1.kbase = rules  # set for browsing
    known, kbase = [['true']], rules  # local to module
    try:
        for (stack, proof) in AND(query, [{}], [], []):
            try:
                report(stack[0], query, pmode, proof)
            except backtrack:
                pass
        print 'no (more) solutions  [backwrd2.py]'
    except stop_proof:
        pass
예제 #3
0
def report(kbase, topenv, query, pmode, how):
    import backward
    try:
        backward.report(kbase, topenv, query, pmode, how)
    except backward.backtrack:
        return
예제 #4
0
def report(kbase, topenv, query, pmode, how):
    import backward
    try:
        backward.report(kbase, topenv, query, pmode, how)
    except backward.backtrack:
        return