예제 #1
0
파일: ivy_check.py 프로젝트: hannesm/ivy
def gui_art(other_art):
    import tk_ui as ui
    #    iu.set_parameters({'mode':'induction'})
    iu.set_parameters({'ui': 'cti'})
    gui = ui.new_ui()
    agui = gui.add(other_art)
    gui.tk.update_idletasks()  # so that dialog is on top of main window
    gui.tk.mainloop()
    exit(1)
예제 #2
0
파일: ivy_check.py 프로젝트: jamella/ivy
def check_conjectures(kind,msg,ag,state):
    failed = itp.undecided_conjectures(state)
    if failed:
        print "{} failed.".format(kind)
        if diagnose.get():
            gui = ui.new_ui()
            agui = gui.add(ag)
            gui.tk.update_idletasks() # so that dialog is on top of main window
            agui.try_conjecture(state,msg="{}\nChoose one to see counterexample.".format(msg))
            gui.tk.mainloop()
        exit(1)
예제 #3
0
def check_properties():
    if itp.false_properties():
        if diagnose.get():
            print "Some properties failed."
            gui = ui.new_ui()
            gui.tk.update_idletasks(
            )  # so that dialog is on top of main window
            gui.try_property()
            gui.mainloop()
            exit(1)
        raise iu.IvyError(None, "Some properties failed.")
    im.module.labeled_axioms.extend(im.module.labeled_props)
예제 #4
0
파일: ivy_check.py 프로젝트: odedp/ivy
def check_properties():
    if itp.false_properties():
        if diagnose.get():
            print "Some properties failed."
            gui = ui.new_ui()
            gui.tk.update_idletasks() # so that dialog is on top of main window
            gui.try_property()
            gui.mainloop()
            exit(1)
        raise iu.IvyError(None,"Some properties failed.")
    im.module.labeled_axioms.extend(im.module.labeled_props)
    im.module.update_theory()
예제 #5
0
파일: ivy_check.py 프로젝트: odedp/ivy
def check_conjectures(kind,msg,ag,state):
    failed = itp.undecided_conjectures(state)
    if failed:
        if diagnose.get():
            print "{} failed.".format(kind)
            iu.dbg('ag.states[0].clauses')
            gui = ui.new_ui()
            agui = gui.add(ag)
            gui.tk.update_idletasks() # so that dialog is on top of main window
            agui.try_conjecture(state,msg="{}\nChoose one to see counterexample.".format(msg),bound=1)
            gui.tk.mainloop()
            exit(1)
        raise iu.IvyError(None,"{} failed.".format(kind))
예제 #6
0
def check_conjectures(kind,msg,ag,state):
    failed = itp.undecided_conjectures(state)
    if failed:
        if diagnose.get():
            print "{} failed.".format(kind)
            import tk_ui as ui
            iu.set_parameters({'mode':'induction'})
            gui = ui.new_ui()
            agui = gui.add(ag)
            gui.tk.update_idletasks() # so that dialog is on top of main window
            agui.try_conjecture(state,msg="{}\nChoose one to see counterexample.".format(msg),bound=1)
            gui.tk.mainloop()
            exit(1)
        raise iu.IvyError(None,"{} failed.".format(kind))
예제 #7
0
def check_properties():
    if itp.false_properties():
        if diagnose.get():
            print "Some properties failed."
            import tk_ui as ui
            iu.set_parameters({'mode':'induction'})
            gui = ui.new_ui()
            gui.tk.update_idletasks() # so that dialog is on top of main window
            gui.try_property()
            gui.mainloop()
            exit(1)
        raise iu.IvyError(None,"Some properties failed.")
    im.module.labeled_axioms.extend(im.module.labeled_props)
    im.module.update_theory()
예제 #8
0
def show_counterexample(ag,state,bmc_res):
    universe,path = bmc_res
    other_art = ivy_art.AnalysisGraph()
    ag.copy_path(state,other_art,None)
    for state,value in zip(other_art.states[-len(path):],path):
        state.value = value
        state.universe = universe

    import tk_ui as ui
    iu.set_parameters({'mode':'induction'})
    gui = ui.new_ui()
    agui = gui.add(other_art)
    gui.tk.update_idletasks() # so that dialog is on top of main window
    gui.tk.mainloop()
    exit(1)
예제 #9
0
def check_conjectures(kind, msg, ag, state):
    failed = itp.undecided_conjectures(state)
    if failed:
        if diagnose.get():
            print "{} failed.".format(kind)
            iu.dbg('ag.states[0].clauses')
            gui = ui.new_ui()
            agui = gui.add(ag)
            gui.tk.update_idletasks(
            )  # so that dialog is on top of main window
            agui.try_conjecture(
                state,
                msg="{}\nChoose one to see counterexample.".format(msg),
                bound=1)
            gui.tk.mainloop()
            exit(1)
        raise iu.IvyError(None, "{} failed.".format(kind))
예제 #10
0
}

action error = {
  x := *;
  y := *;
  z := *;
  assume x ~= z & c(x,y) & c(z,y)
}

# concept c1(X,Y,Z) = (c(X,Z) * ~X = Y * c(Y,Z))

conjecture (X = Z | ~c(X,Y) | ~c(Z,Y))
"""

with ivy_module.Module():
    main_ui = new_ui()
    ui = main_ui.add(ivy_from_string(prog))
    ui.execute_action(ui.node(0),"connect")
    cg = ui.view_state(ui.g.states[1])
    cg.materialize_edge((cg.relation('c(X,Y)'),cg.node('client'),cg.node('server')))
    cg.split(cg.relation('s'),cg.node('=b'))
    cg.materialize(cg.node('=b','s'))
    main_ui.answer('Refine')
    cg.reverse()
    cg.backtrack()
    cg.recalculate()
    ui.execute_action(ui.node(1),"connect")
    ui.mark_node(ui.node(1))
    ui.cover_node(ui.node(2))
#    ui.mainloop()
예제 #11
0
  link(x,y) := false;
  semaphore(y) := true
}

action test = {
  assert ~(X ~= Z & link(X,Y) & link(Z,Y))
}

export connect
export disconnect
export test
"""

with ivy_module.Module():
    iu.set_parameters({'ui':'cti','ext':'ext'})
    main_ui = new_ui()
    ui = main_ui.add(ivy_from_string(prog))
    main_ui.answer("OK")
    ui.check_inductiveness()
#    ui = ui.cti
    cg = ui.current_concept_graph
    cg.show_relation(cg.relation('link(X,Y)'),'+')
    cg.gather()
    main_ui.answer("OK")
    cg.strengthen()
    main_ui.answer("OK")
    ui.check_inductiveness()
    cg.show_relation(cg.relation('semaphore'),'+')
    cg.gather()
    main_ui.answer("OK")
    cg.minimize_conjecture(bound=2)