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)
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)
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)
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()
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))
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))
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()
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)
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))
} 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()
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)