Skip to content

Commit 2e860cf

Browse files
Fixes
1 parent 7b4d28f commit 2e860cf

3 files changed

Lines changed: 5 additions & 12 deletions

File tree

Strata/Languages/Laurel/HeapParameterization.lean

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,9 @@ def analyzeProc (proc : Procedure) : AnalysisResult :=
9898
let bodyResult := match proc.body with
9999
| .Transparent b => (collectExprMd b).run {} |>.2
100100
| .Opaque postconds impl modif =>
101-
-- A non-empty modifies clause (excluding wildcard `*`) implies the procedure
102-
-- reads and writes the heap; no need to inspect the body further in that case.
103-
-- Wildcard modifies does not imply heap access — it only suppresses the frame condition.
104-
let isWildcard (e : StmtExprMd) : Bool := match e.1 with | .All => true | _ => false
105-
let concreteModifies := modif.filter (fun e => !isWildcard e)
106-
if !concreteModifies.isEmpty then
101+
-- A non-empty modifies clause implies the procedure reads and writes the heap;
102+
-- no need to inspect the body further in that case.
103+
if !modif.isEmpty then
107104
{ readsHeapDirectly := true, writesHeapDirectly := true, callees := [] }
108105
else
109106
let r1 := postconds.foldl (fun (acc : AnalysisResult) (pc : Condition) =>

Strata/Languages/Python/PythonToLaurel.lean

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2455,11 +2455,7 @@ def PreludeInfo.ofLaurelProgram (prog : Laurel.Program) : PreludeInfo where
24552455
prog.staticProcedures.filterMap fun p =>
24562456
if p.body.isExternal || p.isFunctional then none else some p.name.text
24572457
inlinableProcedures :=
2458-
prog.staticProcedures.foldl (init := {}) fun s p =>
2459-
match p.body with
2460-
| .Transparent _ => s.insert p.name.text
2461-
| .Opaque _ (some _) _ => s.insert p.name.text
2462-
| _ => if !p.preconditions.isEmpty then s.insert p.name.text else s
2458+
prog.staticProcedures.foldl (init := {}) fun s p => s.insert p.name.text
24632459

24642460
/-- Merge two `PreludeInfo` values by concatenating each field. -/
24652461
def PreludeInfo.merge (a b : PreludeInfo) : PreludeInfo where
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
test_class_decl.py(9, 4): ✅ pass - callElimAssert_requires_15
1+
test_class_decl.py(9, 4): ✅ pass - (CircularBuffer@__init__ requires) Type constraint of n
22
DETAIL: 1 passed, 0 failed, 0 inconclusive
33
RESULT: Analysis success

0 commit comments

Comments
 (0)