Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d0d3e11
test: Add reproduction for list.append() hole not mutating receiver
ssomayyajula Apr 22, 2026
ddea3df
fix: Havoc value-typed locals referenced in unmodeled calls
ssomayyajula Apr 22, 2026
70e93e7
Merge github/main into fix-python-laurel-hole-mutate-receiver
ssomayyajula Apr 22, 2026
ee15f2d
fix: Havoc local arguments in unmodeled calls
ssomayyajula Apr 22, 2026
d0b1a17
fix: Use unknown method in argument havoc test
ssomayyajula Apr 22, 2026
b4853a3
fix: Regenerate expected output in default (deductive) mode
ssomayyajula Apr 22, 2026
3a73276
Merge github/main: resolve expected output conflict
ssomayyajula Apr 22, 2026
c329108
Merge branch 'main' into fix-python-laurel-hole-mutate-receiver
thanhnguyen-aws Apr 23, 2026
13b307c
fix: Only havoc Any-typed arguments in unmodeled calls
ssomayyajula Apr 27, 2026
c7f8429
Merge github/main into fix-python-laurel-hole-mutate-receiver
ssomayyajula Apr 28, 2026
c037d3c
docs: Document that composite heap havoc is out of scope
ssomayyajula Apr 28, 2026
9a4658c
Merge remote-tracking branch 'github/main' into fix-python-laurel-hol…
ssomayyajula Apr 28, 2026
9104a80
Merge branch 'fix-python-laurel-hole-mutate-receiver' of github.com:s…
ssomayyajula Apr 28, 2026
538f7ef
fix: Update havoc test to use truthiness checks in bugFinding mode
ssomayyajula Apr 28, 2026
7953cb4
fix: Restore assertion-based havoc test
ssomayyajula Apr 28, 2026
6558ed9
fix: Move havoc from Expr handler to translateCall
ssomayyajula Apr 28, 2026
f54deb7
fix: Correct test assertion messages to match actual behavior
ssomayyajula Apr 28, 2026
09cf4be
fix: Add expected_interpret file for test_havoc_callee_after_hole_call
keyboardDrummer-bot Apr 29, 2026
5ab9f5a
fix: Handle Hole in statement position in LaurelToCoreTranslator
keyboardDrummer-bot Apr 29, 2026
9d7402e
Add Strata internal benchmarks Github Action (#1070)
aqjune-aws Apr 28, 2026
a546083
PySpec pipeline: fix type mismatches, add type assertions, and clean …
joehendrix Apr 28, 2026
94e6ba8
fix: Remove argHavoc from unmodeled calls to fix CI
keyboardDrummer-bot Apr 29, 2026
ef008fe
Merge branch 'main' into fix-python-laurel-hole-mutate-receiver
keyboardDrummer-bot Apr 29, 2026
a6ed10d
fix: Restore argument havoc for unmodeled calls
keyboardDrummer-bot Apr 29, 2026
88f4e65
fix: Handle Hole RHS in Assign as havoc in LaurelToCoreTranslator
keyboardDrummer-bot Apr 29, 2026
69b1df4
Merge branch 'main' into fix-python-laurel-hole-mutate-receiver
thanhnguyen-aws Apr 29, 2026
dd488eb
Merge branch 'main' into fix-python-laurel-hole-mutate-receiver
olivier-aws Apr 29, 2026
17b0e82
Merge branch 'main' into fix-python-laurel-hole-mutate-receiver
robin-aws Apr 29, 2026
07d3556
Fix regression when unmodelled function in a loop iterator
olivier-aws Apr 30, 2026
65a0fdb
restore expected files
olivier-aws Apr 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion Strata/Languages/Python/PythonToLaurel.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1674,7 +1674,32 @@ partial def translateStmt (ctx : TranslationContext) (s : Python.stmt SourceRang
| _ => return (ctx, exceptionCheck ++ [expr])
-- Unmodeled call: skip exception checks (no model to check against),
-- but havoc maybe_except since the call could throw.
| .Hole => return (ctx, [expr] ++ holeExceptHavoc)
-- Also havoc the receiver and Any-typed arguments since the unmodeled
-- call may mutate them and value-typed locals are not reachable via heap havoc.
-- Note: composite-typed arguments are NOT havoc'd here. If the unmodeled
-- call mutates a composite's fields, the heap should be havoc'd, but that
-- requires coordination with HeapParameterization and is out of scope.
| .Hole =>
let receiverHavoc := match value with
| .Call _ (.Attribute _ (.Name _ receiverName _) _ _) _ _ =>
if receiverName.val ∈ ctx.variableTypes.unzip.1 then
let target := mkStmtExprMd (StmtExpr.Identifier receiverName.val)
[mkStmtExprMdWithLoc (StmtExpr.Assign [target] (mkStmtExprMd .Hole)) md]
else []
| _ => []
let argHavoc := match value with
| .Call _ _ args _ =>
args.val.toList.flatMap fun arg =>
if let .Name _ n _ := arg then
match ctx.variableTypes.find? (λ v => Prod.fst v == n.val) with
| some (varName, ty) =>
if ty == PyLauType.Any then
[mkStmtExprMdWithLoc (StmtExpr.Assign [freeVar varName] (mkStmtExprMd (.Hole false none))) md]
Comment thread
tautschnig marked this conversation as resolved.
Outdated
else []
| _ => []
else []
| _ => []
return (ctx, [expr] ++ receiverHavoc ++ argHavoc ++ holeExceptHavoc)
| _ => return (ctx, exceptionCheck ++ [expr])

| .Import _ _ | .ImportFrom _ _ _ _ |.Pass _ => return (ctx, [])
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
test_havoc_callee_after_hole_call.py(9, 4): ❓ unknown - set_x_calls_Any_get_0
test_havoc_callee_after_hole_call.py(9, 4): ❓ unknown - assert(176)
test_havoc_callee_after_hole_call.py(14, 4): ❓ unknown - set_y_calls_Any_get_0
test_havoc_callee_after_hole_call.py(14, 4): ❓ unknown - assert(270)
DETAIL: 0 passed, 0 failed, 4 inconclusive
RESULT: Inconclusive
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# strata-args: --check-mode bugFinding --check-level full
class MyClass:
def __init__(self, n: int):
self.val : int = n

xs: list[int] = []
xs.append(1)
Comment thread
tautschnig marked this conversation as resolved.
Outdated
if xs:
Comment thread
robin-aws marked this conversation as resolved.
Outdated
x: int = xs[0]

ys: list[int] = []
xs.unknown_method_that_may_modify_arguments(ys)
if ys:
y: int = ys[0]
Loading