scientific-method-engine 8.1.0__tar.gz → 8.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/PKG-INFO +1 -1
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/pyproject.toml +1 -1
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/x86/relational.py +47 -7
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/test_relational_controls.py +65 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/.gitignore +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/LICENSE +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/README.md +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/__init__.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/__main__.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/cli.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ClearNoReturnFunctions.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/CreateFunctions.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ExportBoundedFlow.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ExportCallEdges.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ExportFunctionFingerprints.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ExportFunctionInventory.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/MergeFallThroughFragment.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/RecoverCitedFunctions.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/RepairReturningCallers.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ReportCallArguments.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ReportCallPaths.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ReportCallSitesWithScalars.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ReportCallsToRange.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ReportConstantFirstArgumentCalls.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ReportDataBytes.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ReportDecompileMatches.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ReportDecompileWindow.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ReportFilePatternInMemory.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ReportFirstArgumentCallSummary.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ReportFunctionScalarConstants.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ReportFunctionSummary.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ReportInstructionContext.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ReportInstructionWindow.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ReportMemoryBlockForFileOffset.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ReportMemoryBlocks.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ReportRandomnessCandidates.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ReportReferences.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ReportScalarConstants.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ReportStringReferences.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/ReportSymbolReferences.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/ghidra/scientificmethod/FirstArgumentLookBack.java +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/x86/__init__.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/x86/argument_frames.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/x86/dispatch.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/x86/effect_order.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/x86/image.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/x86/loops.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/x86/machine.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/x86/memory_scopes.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/x86/pcode.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/x86/pcode_backend.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/x86/pe.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/x86/reports.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/x86/result_flow.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/x86/trace.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/src/scientific_method_engine/x86/values.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/oracle.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/test_continuation_budget.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/test_dispatch.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/test_effect_order.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/test_entry_frame.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/test_interrupt_models.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/test_loops.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/test_memory_scopes.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/test_nested_frame_request.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/test_oracle.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/test_pe.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/test_successor_rule.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/test_table_continuations.py +0 -0
- {scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/test_x86.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: scientific-method-engine
|
|
3
|
-
Version: 8.1.
|
|
3
|
+
Version: 8.1.1
|
|
4
4
|
Summary: Bounded instruction-derived x86 evidence reports for segmented MZ/FBOV and PE32/i386 code.
|
|
5
5
|
Project-URL: Source, https://github.com/kibertoad/refurbished-dinosaurs-toolkit/tree/main/packages/scientific-method-engine
|
|
6
6
|
Author: kibertoad
|
|
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "scientific-method-engine"
|
|
7
7
|
# The release workflow writes the published version from the package's release tag.
|
|
8
|
-
version = "8.1.
|
|
8
|
+
version = "8.1.1"
|
|
9
9
|
description = "Bounded instruction-derived x86 evidence reports for segmented MZ/FBOV and PE32/i386 code."
|
|
10
10
|
readme = "README.md"
|
|
11
11
|
requires-python = ">=3.12"
|
|
@@ -5,6 +5,7 @@ occurrence is held, violated or undecided. A violation on any path fails the que
|
|
|
5
5
|
whose paths were not all read (a stop, a limit, a dropped path) is undecided, never held.
|
|
6
6
|
"""
|
|
7
7
|
from bisect import bisect_right
|
|
8
|
+
from math import inf
|
|
8
9
|
from .image import integer
|
|
9
10
|
from .machine import ALIASES, NO_WRITE, State
|
|
10
11
|
|
|
@@ -217,11 +218,16 @@ def validate_controls(config, image):
|
|
|
217
218
|
return controls
|
|
218
219
|
|
|
219
220
|
|
|
220
|
-
# Linear forms: (constant, {atom: coefficient}); an atom is (term, bits)
|
|
221
|
+
# Linear forms: (constant, {atom: coefficient}); an atom is (term, bits), ("signed", term, bits) or
|
|
222
|
+
# (HIDDEN, site, event), the events at a site that modeled callees before the anchor may have added.
|
|
223
|
+
HIDDEN = "hidden-occurrences"
|
|
224
|
+
|
|
221
225
|
|
|
222
226
|
def _atom_range(atom, ranges):
|
|
223
227
|
if atom in ranges:
|
|
224
228
|
return ranges[atom]
|
|
229
|
+
if atom[0] == HIDDEN:
|
|
230
|
+
return 0, inf
|
|
225
231
|
if atom[0] == "signed":
|
|
226
232
|
half = 1 << (atom[2] - 1)
|
|
227
233
|
return -half, half - 1
|
|
@@ -367,7 +373,8 @@ class _Path:
|
|
|
367
373
|
return bisect_right(self.by_site.get((site, kind), ()), through)
|
|
368
374
|
|
|
369
375
|
def modeled_before(self, order):
|
|
370
|
-
|
|
376
|
+
# A modeled call's own return at the order counts: its callee ran before that event.
|
|
377
|
+
return [self.events[o]["callSite"] for o in self.modeled[:bisect_right(self.modeled, order)]]
|
|
371
378
|
|
|
372
379
|
def value(self, term, anchor):
|
|
373
380
|
if "entryRegister" in term:
|
|
@@ -404,7 +411,12 @@ class _Path:
|
|
|
404
411
|
return _scaled(self.form(operand["mul"][0], anchor, ranges, modular), operand["mul"][1])
|
|
405
412
|
if "occurrences" in operand:
|
|
406
413
|
o = operand["occurrences"]
|
|
407
|
-
|
|
414
|
+
count = self.count(o["site"], o["event"], anchor["order"])
|
|
415
|
+
# A modeled callee the path did not read may have run the counted site, so past one the
|
|
416
|
+
# read count is a lower bound: the form adds a hidden count of zero or more.
|
|
417
|
+
if self.modeled_before(anchor["order"]):
|
|
418
|
+
return count, {(HIDDEN, o["site"], o["event"]): 1}
|
|
419
|
+
return count, {}
|
|
408
420
|
value = self.value(operand, anchor)
|
|
409
421
|
# A form congruent modulo the value's own width is congruent modulo any narrower modulus.
|
|
410
422
|
# A narrower value needs its integer value, which only a wrap-free range gives.
|
|
@@ -413,6 +425,22 @@ class _Path:
|
|
|
413
425
|
return _integer(value["expression"], value["bits"], operand.get("signed", False), ranges)
|
|
414
426
|
|
|
415
427
|
|
|
428
|
+
def _bound(value):
|
|
429
|
+
"""An interval end as reports carry it: None for an end no read event bounds."""
|
|
430
|
+
return None if value in (inf, -inf) else value
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
def _hidden(path, anchor, *forms):
|
|
434
|
+
"""The reason for an undecided result whose forms hold counts that modeled calls may have raised."""
|
|
435
|
+
counted = sorted({(atom[1], atom[2]) for form in forms for atom in form[1] if atom[0] == HIDDEN})
|
|
436
|
+
if not counted:
|
|
437
|
+
return {}
|
|
438
|
+
calls = path.modeled_before(anchor["order"])
|
|
439
|
+
names = ", ".join(f"{event} events at {site}" for site, event in counted)
|
|
440
|
+
return {"reason": f"the count of {names} passed modeled calls at {', '.join(map(str, calls))}, whose callees may "
|
|
441
|
+
f"hold more of them, so the read count is only a lower bound", "modeledCalls": calls}
|
|
442
|
+
|
|
443
|
+
|
|
416
444
|
def _ranges(control, path, anchor):
|
|
417
445
|
"""The assumed ranges by atom. Raises _Unresolved when this occurrence cannot apply one."""
|
|
418
446
|
ranges = {}
|
|
@@ -489,7 +517,8 @@ def _occurrence(control, path, anchor, image):
|
|
|
489
517
|
detail.update(taken=found.get("taken"), decidedBy=found.get("decidedBy"), branchReason=found.get("reason"))
|
|
490
518
|
if found.get("taken") != control["branch"]["taken"]:
|
|
491
519
|
# A modeled callee after the read execution may have run the branch again.
|
|
492
|
-
modeled = [e["callSite"] for e in
|
|
520
|
+
modeled = [e["callSite"] for e in events[found["order"] + 1:order + 1]
|
|
521
|
+
if e["kind"] == "call-return" and e.get("modeled")]
|
|
493
522
|
if modeled:
|
|
494
523
|
detail.update(reason="the last read execution of the branch went the other way; a later modeled call is unread",
|
|
495
524
|
modeledCalls=modeled)
|
|
@@ -554,12 +583,17 @@ def _occurrence(control, path, anchor, image):
|
|
|
554
583
|
constant = difference[0] % size
|
|
555
584
|
atoms = {a: k % size for a, k in difference[1].items() if k % size}
|
|
556
585
|
if atoms:
|
|
557
|
-
return "undecided",
|
|
586
|
+
return "undecided", _hidden(path, anchor, difference) or {
|
|
587
|
+
"reason": f"left and right are not shown congruent modulo 2**{modulo}"}
|
|
558
588
|
same = constant == 0
|
|
559
589
|
held = same if control["op"] == "eq" else not same
|
|
560
590
|
return "held" if held else "violated", {"leftMinusRightModulo": constant}
|
|
561
591
|
lo, hi = _interval(difference, ranges)
|
|
562
|
-
|
|
592
|
+
verdict = _decide(difference, control["op"], ranges)
|
|
593
|
+
detail = {"leftMinusRight": {"min": _bound(lo), "max": _bound(hi)}}
|
|
594
|
+
if verdict == "undecided":
|
|
595
|
+
detail.update(_hidden(path, anchor, difference))
|
|
596
|
+
return verdict, detail
|
|
563
597
|
if kind == "containment":
|
|
564
598
|
interval = control["interval"]
|
|
565
599
|
try:
|
|
@@ -571,6 +605,8 @@ def _occurrence(control, path, anchor, image):
|
|
|
571
605
|
if segment["expression"] != anchor["segment"]["expression"] or segment["bits"] != anchor["segment"]["bits"]:
|
|
572
606
|
return "undecided", {"reason": "the write's segment is not shown equal to the interval's segment",
|
|
573
607
|
"writeSegment": anchor["segment"], "intervalSegment": segment}
|
|
608
|
+
if any(atom[0] == HIDDEN for atom in start[1]):
|
|
609
|
+
return "undecided", _hidden(path, anchor, start)
|
|
574
610
|
bits = anchor["offset"]["bits"]
|
|
575
611
|
size = 1 << bits
|
|
576
612
|
relative = _combine(_modular(anchor["offset"]["expression"], bits, ranges), start, -1)
|
|
@@ -583,7 +619,11 @@ def _occurrence(control, path, anchor, image):
|
|
|
583
619
|
room = _combine(_combine(length, relative, -1), (anchor["width"], {}), -1)
|
|
584
620
|
rlo, rhi = _interval(relative, ranges)
|
|
585
621
|
llo, lhi = _interval(length, ranges)
|
|
586
|
-
|
|
622
|
+
verdict = _decide(room, "ge", ranges)
|
|
623
|
+
detail = {"relativeStart": {"min": rlo, "max": rhi}, "width": anchor["width"], "length": {"min": _bound(llo), "max": _bound(lhi)}}
|
|
624
|
+
if verdict == "undecided":
|
|
625
|
+
detail.update(_hidden(path, anchor, length))
|
|
626
|
+
return verdict, detail
|
|
587
627
|
# origin
|
|
588
628
|
try:
|
|
589
629
|
value = path.value(control["value"], anchor)
|
{scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/test_relational_controls.py
RENAMED
|
@@ -113,6 +113,25 @@ class OrderTests(unittest.TestCase):
|
|
|
113
113
|
with self.assertRaisesRegex(ValueError, "went the other way"):
|
|
114
114
|
run(self.c, [rule], registers=FRAME)
|
|
115
115
|
|
|
116
|
+
def test_an_anchor_on_a_modeled_calls_return_follows_its_callee(self):
|
|
117
|
+
# At the modeled call's own return the callee has run, so it may have produced the before event.
|
|
118
|
+
self.c = (Code().branch("e8", "helper").label("service").branch("e8", "helper").label("use").emit("8a 07 c3")
|
|
119
|
+
.label("helper").emit("85 db").label("test").branch("74", "zero").emit("c3").label("zero").emit("c3"))
|
|
120
|
+
model = [{"site": self.c.labels["service"], "evidence": "synthetic unread helper call", "cases": [{}]}]
|
|
121
|
+
direction = control("direction", "order", before={"site": self.c.labels["test"], "event": "branch"},
|
|
122
|
+
branch={"taken": False}, at={"site": self.c.labels["service"], "event": "call-return"})
|
|
123
|
+
result = verdict(run(self.c, [direction], registers=FRAME, callModels=model), "direction")
|
|
124
|
+
self.assertEqual(result["verdict"], "undecided")
|
|
125
|
+
taken = next(o for p in result["paths"] for o in p["occurrences"] if o["taken"])
|
|
126
|
+
self.assertEqual(taken["modeledCalls"], [self.c.labels["service"]])
|
|
127
|
+
# With the first call modeled, no read event precedes that call's return.
|
|
128
|
+
first = [{**model[0], "site": 0}]
|
|
129
|
+
before = control("first", "order", before={"site": self.c.labels["test"], "event": "branch"},
|
|
130
|
+
at={"site": 0, "event": "call-return"})
|
|
131
|
+
result = verdict(run(self.c, [before], registers=FRAME, callModels=first), "first")
|
|
132
|
+
self.assertEqual(result["verdict"], "undecided")
|
|
133
|
+
self.assertEqual(result["paths"][0]["occurrences"][0]["modeledCalls"], [0])
|
|
134
|
+
|
|
116
135
|
|
|
117
136
|
class LastWriterTests(unittest.TestCase):
|
|
118
137
|
def cleanup(self):
|
|
@@ -407,6 +426,52 @@ class RelationTests(unittest.TestCase):
|
|
|
407
426
|
rule = self.appends(16)
|
|
408
427
|
self.assertEqual(verdict(run(self.c, [rule], visitLimit=8), "capacity")["verdict"], "undecided")
|
|
409
428
|
|
|
429
|
+
def test_an_output_count_past_a_modeled_call_is_a_lower_bound(self):
|
|
430
|
+
# The caller runs the append helper twice; the second call may be modeled.
|
|
431
|
+
c = (Code().branch("e8", "append").label("service").branch("e8", "append").label("return").emit("c3")
|
|
432
|
+
.label("append").label("write").emit("88 07 43 c3"))
|
|
433
|
+
|
|
434
|
+
def capacity(n):
|
|
435
|
+
return control("capacity", "relation", at={"site": c.labels["return"], "event": "return"}, op="le",
|
|
436
|
+
left={"occurrences": {"site": c.labels["write"], "event": "write"}}, right=n)
|
|
437
|
+
self.assertEqual(verdict(run(c, [capacity(2)], registers=FRAME), "capacity")["verdict"], "held")
|
|
438
|
+
with self.assertRaisesRegex(ValueError, "capacity violated"):
|
|
439
|
+
run(c, [capacity(1)], registers=FRAME)
|
|
440
|
+
# The modeled call hides the second append, so the path's count of one is only a lower bound.
|
|
441
|
+
model = [{"site": c.labels["service"], "evidence": "synthetic unread helper call", "cases": [{}]}]
|
|
442
|
+
result = verdict(run(c, [capacity(1)], registers=FRAME, callModels=model), "capacity")
|
|
443
|
+
self.assertEqual(result["verdict"], "undecided")
|
|
444
|
+
occurrence = result["paths"][0]["occurrences"][0]
|
|
445
|
+
self.assertIn(f"passed modeled calls at {c.labels['service']}", occurrence["reason"])
|
|
446
|
+
self.assertEqual(occurrence["modeledCalls"], [c.labels["service"]])
|
|
447
|
+
self.assertEqual(occurrence["leftMinusRight"], {"min": 0, "max": None})
|
|
448
|
+
self.assertEqual(result["paths"][0]["modeledCalls"], [c.labels["service"]])
|
|
449
|
+
# The read count already exceeds a capacity of zero, and already meets a minimum of one.
|
|
450
|
+
with self.assertRaisesRegex(ValueError, "capacity violated"):
|
|
451
|
+
run(c, [capacity(0)], registers=FRAME, callModels=model)
|
|
452
|
+
least = control("least", "relation", at={"site": c.labels["return"], "event": "return"}, op="ge",
|
|
453
|
+
left={"occurrences": {"site": c.labels["write"], "event": "write"}}, right=1)
|
|
454
|
+
self.assertEqual(verdict(run(c, [least], registers=FRAME, callModels=model), "least")["verdict"], "held")
|
|
455
|
+
# A congruence needs the exact count.
|
|
456
|
+
parity = control("parity", "relation", at={"site": c.labels["return"], "event": "return"}, op="eq", modulo=1,
|
|
457
|
+
left={"occurrences": {"site": c.labels["write"], "event": "write"}}, right=1)
|
|
458
|
+
result = verdict(run(c, [parity], registers=FRAME, callModels=model), "parity")
|
|
459
|
+
self.assertEqual(result["verdict"], "undecided")
|
|
460
|
+
self.assertIn("lower bound", result["paths"][0]["occurrences"][0]["reason"])
|
|
461
|
+
# The same count on both sides cancels: the hidden events are the same events.
|
|
462
|
+
same = control("same", "relation", at={"site": c.labels["return"], "event": "return"}, op="eq",
|
|
463
|
+
left={"occurrences": {"site": c.labels["write"], "event": "write"}},
|
|
464
|
+
right={"occurrences": {"site": c.labels["write"], "event": "write"}})
|
|
465
|
+
self.assertEqual(verdict(run(c, [same], registers=FRAME, callModels=model), "same")["verdict"], "held")
|
|
466
|
+
# An anchor before the modeled call counts every event up to it, so the count decides there.
|
|
467
|
+
first = control("first", "relation", at={"site": c.labels["write"], "event": "write"}, op="le",
|
|
468
|
+
left={"occurrences": {"site": c.labels["write"], "event": "write"}}, right=1)
|
|
469
|
+
self.assertEqual(verdict(run(c, [first], registers=FRAME, callModels=model), "first")["verdict"], "held")
|
|
470
|
+
# At the modeled call's own return the callee has already run, so its writes may precede the anchor.
|
|
471
|
+
returned = control("returned", "relation", at={"site": c.labels["service"], "event": "call-return"}, op="le",
|
|
472
|
+
left={"occurrences": {"site": c.labels["write"], "event": "write"}}, right=1)
|
|
473
|
+
self.assertEqual(verdict(run(c, [returned], registers=FRAME, callModels=model), "returned")["verdict"], "undecided")
|
|
474
|
+
|
|
410
475
|
def test_modulo_accepts_only_equality(self):
|
|
411
476
|
rule = self.terminator("c6 00 00")
|
|
412
477
|
with self.assertRaisesRegex(ValueError, "modulo"):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/test_continuation_budget.py
RENAMED
|
File without changes
|
|
File without changes
|
{scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/test_effect_order.py
RENAMED
|
File without changes
|
|
File without changes
|
{scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/test_interrupt_models.py
RENAMED
|
File without changes
|
|
File without changes
|
{scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/test_memory_scopes.py
RENAMED
|
File without changes
|
{scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/test_nested_frame_request.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/test_successor_rule.py
RENAMED
|
File without changes
|
{scientific_method_engine-8.1.0 → scientific_method_engine-8.1.1}/tests/test_table_continuations.py
RENAMED
|
File without changes
|
|
File without changes
|