Skip to content

Commit 2d04b8f

Browse files
committed
Laurel: rename buildPointwiseFrame to buildQuantifiedFrame
1 parent debf7fe commit 2d04b8f

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

Strata/Languages/Laurel/ModifiesClauses.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ def conjoinAll (exprs : List StmtExprMd) : StmtExprMd :=
7474
| first :: rest => rest.foldl (fun acc e => mkMd <| .PrimitiveOp .And [acc, e]) first
7575

7676
/--
77-
Pointwise frame: every allocated object the `modifies` clause does not name keeps
77+
Quantified (pointwise) frame: every allocated object the `modifies` clause does not name keeps
7878
all of its field values across the call.
7979
8080
forall $obj: Composite, $fld: Field =>
8181
notModified($obj) && $obj < old($heap).nextReference ==> readField(old($heap), $obj, $fld) == readField($heap, $obj, $fld)
8282
-/
83-
def buildPointwiseFrame (proc : Procedure) (entries : List ModifiesEntry)
83+
def buildQuantifiedFrame (proc : Procedure) (entries : List ModifiesEntry)
8484
(heapIn heapOut : StmtExprMd) : StmtExprMd :=
8585
let objName : Identifier := "$modifies_obj"
8686
let fldName : Identifier := "$modifies_fld"
@@ -155,15 +155,15 @@ def transformModifiesClauses (model: SemanticModel)
155155
if useEnumeratedFrame && onlyIndividualRefs entries then
156156
-- Callers assume the quantifier-free frame; the body re-checks the
157157
-- pointwise frame at every exit.
158-
let pointwise := buildPointwiseFrame proc entries heapIn heapOut
158+
let pointwise := buildQuantifiedFrame proc entries heapIn heapOut
159159
let framePost : Condition :=
160160
{ condition := buildEnumeratedFrame proc entries heapIn heapOut,
161161
summary := "modifies clause", free := true }
162162
let impl' := impl.map (insertFrameChecks proc pointwise)
163163
.ok { proc with body := .Opaque (postconds ++ [framePost]) impl' [] }
164164
else
165165
let framePost : Condition :=
166-
{ condition := buildPointwiseFrame proc entries heapIn heapOut,
166+
{ condition := buildQuantifiedFrame proc entries heapIn heapOut,
167167
summary := "modifies clause" }
168168
.ok { proc with body := .Opaque (postconds ++ [framePost]) impl [] }
169169
else

StrataTest/Languages/Laurel/ModifiesFrameQuantifierFreeTest.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/-
88
Structural check, independent of the solver: the enumerated modifies frame
99
(`buildEnumeratedFrame`) must contain no quantifier, so there is nothing for the
10-
solver to instantiate. The `∀`-based frame it replaces (`buildPointwiseFrame`)
10+
solver to instantiate. The `∀`-based frame it replaces (`buildQuantifiedFrame`)
1111
does contain one; asserting both pins the property and shows the check
1212
discriminates between the two encodings.
1313
-/
@@ -29,6 +29,6 @@ private def hasQuantifier (e : StmtExprMd) : Bool :=
2929
(s.splitOn "forall").length > 1 || (s.splitOn "exists").length > 1
3030

3131
#guard !hasQuantifier (buildEnumeratedFrame default singleRefModifies heapIn heapOut)
32-
#guard hasQuantifier (buildPointwiseFrame default singleRefModifies heapIn heapOut)
32+
#guard hasQuantifier (buildQuantifiedFrame default singleRefModifies heapIn heapOut)
3333

3434
end StrataTest.Laurel.ModifiesFrameQuantifierFree

0 commit comments

Comments
 (0)