Example #1
0
File: ivy.py Project: asyaf/ivy
            for x in ag.domain.relations:
                ag.domain.all_relations.append((x, ag.domain.relations[x]))
            for (x, y) in ag.domain.concepts:
                ag.domain.all_relations.append(
                    (x.atom.relname, len(x.atom.args)))
        ivy_logic.sig = ag.domain.sig  # TODO: make this an environment
        f.close()
    else:
        #        print "creating new"
        ag = ivy_new()

    if files:
        fn, f = files.pop(0)
        if not fn.endswith('.ivy') and not fn.endswith('.dfy'):
            usage()
        try:
            #            print "loading file %s" % fn
            with iu.SourceFile(fn):
                ivy_load_file(f, ag)
        except IvyError as e:
            if not hasattr(e, 'filename'):
                e.filename = fn
            print repr(e)
            sys.exit(1)
    return ag


if __name__ == "__main__":
    with ivy_module.Module():
        ui_main_loop(ivy_init())
Example #2
0
def analyze_state(ag,state,clauses):
#    print "cex: {}".format(clauses)
    ag.states = []
    analyze_state_rec(ag,state)
    state.clauses.extend(clauses)
    ui.ui_main_loop(ag)
Example #3
0
def analyze_state(ag, state, clauses):
    #    print "cex: {}".format(clauses)
    ag.states = []
    analyze_state_rec(ag, state)
    state.clauses.extend(clauses)
    ui.ui_main_loop(ag)
Example #4
0
File: ivy.py Project: ZZHGit/ivy
            for x in ag.domain.relations:
                ag.domain.all_relations.append((x,ag.domain.relations[x]))
            for (x,y) in ag.domain.concepts:
                ag.domain.all_relations.append((x.atom.relname,len(x.atom.args)))
        ivy_logic.sig = ag.domain.sig # TODO: make this an environment
        f.close()
    else:
#        print "creating new"
        ag = ivy_new()

    if files:
        fn,f = files.pop(0)
        if not fn.endswith('.ivy') and not fn.endswith('.dfy'):
            usage()
        try:
#            print "loading file %s" % fn
            with iu.SourceFile(fn):
                ivy_load_file(f,ag)
        except IvyError as e:
            if not hasattr(e,'filename'):
                e.filename = fn
            print repr(e)
            sys.exit(1)
    return ag

if __name__ == "__main__":
    with ivy_module.Module():
        ui_main_loop(ivy_init())