|
@@ -130,6 +130,8 @@ class Phase3FormalContractTests(unittest.TestCase):
|
|
|
def test_frame_tx_wrapper_checks_accepted_byte_progression_without_duplicates(self):
|
|
def test_frame_tx_wrapper_checks_accepted_byte_progression_without_duplicates(self):
|
|
|
sby = _read("tests/formal/frame_tx_contract.sby")
|
|
sby = _read("tests/formal/frame_tx_contract.sby")
|
|
|
self.assertIn("mode bmc", sby)
|
|
self.assertIn("mode bmc", sby)
|
|
|
|
|
+ self.assertRegex(sby, r"(?m)^bmc\s*$")
|
|
|
|
|
+ self.assertNotRegex(sby, r"(?m)^prove\s*$")
|
|
|
# BMC depth kept at 64 for host-feasible closed-loop runs (Mem≈2GiB);
|
|
# BMC depth kept at 64 for host-feasible closed-loop runs (Mem≈2GiB);
|
|
|
# assertions themselves are unchanged. Prefer bitwuzla when available.
|
|
# assertions themselves are unchanged. Prefer bitwuzla when available.
|
|
|
depth_match = re.search(r"(?m)^depth\s+(\d+)\s*$", sby)
|
|
depth_match = re.search(r"(?m)^depth\s+(\d+)\s*$", sby)
|
|
@@ -148,6 +150,39 @@ class Phase3FormalContractTests(unittest.TestCase):
|
|
|
self.assertRegex(source, r"assert\s*\([^\n]*byte_data")
|
|
self.assertRegex(source, r"assert\s*\([^\n]*byte_data")
|
|
|
self.assertRegex(source, r"assert\s*\([^\n]*accepted_byte_count")
|
|
self.assertRegex(source, r"assert\s*\([^\n]*accepted_byte_count")
|
|
|
|
|
|
|
|
|
|
+ def test_bmc_targets_name_tasks_bmc_not_prove(self):
|
|
|
|
|
+ """Receipt honesty: BMC .sby tasks must not be labeled prove."""
|
|
|
|
|
+ for relative in (
|
|
|
|
|
+ "tests/formal/frame_command_contract.sby",
|
|
|
|
|
+ "tests/formal/frame_tx_contract.sby",
|
|
|
|
|
+ "tests/formal/simple_frame_contract.sby",
|
|
|
|
|
+ "tests/formal/startup_close_seek.sby",
|
|
|
|
|
+ "tests/formal/runtime_limit_inertness.sby",
|
|
|
|
|
+ "tests/formal/door_action_dispatcher_axis3.sby",
|
|
|
|
|
+ ):
|
|
|
|
|
+ sby = _read(relative)
|
|
|
|
|
+ with self.subTest(relative=relative):
|
|
|
|
|
+ self.assertIn("mode bmc", sby)
|
|
|
|
|
+ self.assertRegex(sby, r"(?m)^bmc\s*$")
|
|
|
|
|
+ self.assertNotRegex(sby, r"(?m)^prove\s*$")
|
|
|
|
|
+
|
|
|
|
|
+ def test_priority_formal_targets_require_cover_nonvacuity(self):
|
|
|
|
|
+ for relative in (
|
|
|
|
|
+ "tests/formal/startup_close_seek.sby",
|
|
|
|
|
+ "tests/formal/runtime_limit_inertness.sby",
|
|
|
|
|
+ "tests/formal/simple_frame_contract.sby",
|
|
|
|
|
+ "tests/formal/door_action_dispatcher_axis3.sby",
|
|
|
|
|
+ ):
|
|
|
|
|
+ sby = _read(relative)
|
|
|
|
|
+ with self.subTest(relative=relative):
|
|
|
|
|
+ self.assertRegex(sby, r"(?m)^cover\s*$")
|
|
|
|
|
+ self.assertIn("mode cover", sby)
|
|
|
|
|
+ # frame_command keeps cover() in the wrapper for non-vacuity review, but the
|
|
|
|
|
+ # registered sby task stays BMC-only on low-memory hosts (depth-96 cover OOMs).
|
|
|
|
|
+ self.assertIn("cover (", _read("tests/formal/frame_command_contract_formal.v"))
|
|
|
|
|
+ frame_cmd = _read("tests/formal/frame_command_contract.sby")
|
|
|
|
|
+ self.assertRegex(frame_cmd, r"(?m)^bmc\s*$")
|
|
|
|
|
+ self.assertNotRegex(frame_cmd, r"(?m)^cover\s*$")
|
|
|
def test_formal_wrappers_have_real_stimulus_and_no_vacuous_constant_inputs(self):
|
|
def test_formal_wrappers_have_real_stimulus_and_no_vacuous_constant_inputs(self):
|
|
|
source = _read("tests/formal/simple_frame_contract_formal.v")
|
|
source = _read("tests/formal/simple_frame_contract_formal.v")
|
|
|
self.assertIn("SCENARIO_VALID", source)
|
|
self.assertIn("SCENARIO_VALID", source)
|