def do_check(self, arg): """ Check an ARCTL specification on the current FSM. usage: check SPEC """ if self.fsm is None: print("[ERROR] No FSM read. Use read command before.") elif arg == "": print("[ERROR] Need a specification.") else: try: spec = parseArctl(arg)[0] (res, wit) = checkArctl(self.fsm, spec, explain_witness, explain_countex) if res: print("The specification", arg, "is true,", "witnessed by") print(xml_representation(self.fsm, wit, spec)) else: print("The specification", arg, "is false,", "as shown by") print(xml_representation(self.fsm, wit, spec)) except PyNuSMVError as e: print("[ERROR]", e) except ParseException as e: print("[ERROR]", e)
def test_full_finite(self): fsm = self.init_finite_model() spec = parseArctl("A<'TRUE'>F (~ E<'TRUE'>X 'TRUE')")[0] (result, expl) = checkArctl(fsm, spec, explain_witness, explain_countex) self.assertTrue(result) self.assertIsNotNone(xml_representation(fsm, expl, spec)) print(xml_representation(fsm, expl, spec))
def test_full(self): fsm = self.init_model() spec = parseArctl("A<'run = rc1'>[" "E<'TRUE'>G 'c1.c < 3' W " "A<'TRUE'>X 'c1.c = 0' ]")[0] (result, expl) = checkArctl(fsm, spec, explain_witness, explain_countex) self.assertTrue(result) self.assertIsNotNone(xml_representation(fsm, expl, spec)) print(xml_representation(fsm, expl, spec))