@@ -26,6 +26,7 @@ trait FunctionRecorder extends Mergeable[FunctionRecorder] {
2626 def freshFvfsAndDomains : InsertionOrderedSet [SnapshotMapDefinition ]
2727 def freshFieldInvs : InsertionOrderedSet [InverseFunctions ]
2828 def freshArps : InsertionOrderedSet [(Var , Term )]
29+ def freshConstraints : InsertionOrderedSet [Term ]
2930 def freshSnapshots : InsertionOrderedSet [Function ]
3031 def freshPathSymbols : InsertionOrderedSet [Function ]
3132 def freshMacros : InsertionOrderedSet [MacroDecl ]
@@ -34,6 +35,7 @@ trait FunctionRecorder extends Mergeable[FunctionRecorder] {
3435 def recordFvfAndDomain (fvfDef : SnapshotMapDefinition ): FunctionRecorder
3536 def recordFieldInv (inv : InverseFunctions ): FunctionRecorder
3637 def recordArp (arp : Var , constraint : Term ): FunctionRecorder
38+ def recordConstraint (constraint : Term ): FunctionRecorder
3739 def recordFreshSnapshot (snap : Function ): FunctionRecorder
3840 def recordPathSymbol (symbol : Function ): FunctionRecorder
3941 def recordFreshMacro (decl : MacroDecl ): FunctionRecorder
@@ -47,6 +49,7 @@ case class ActualFunctionRecorder(private val _data: FunctionData,
4749 freshFvfsAndDomains : InsertionOrderedSet [SnapshotMapDefinition ] = InsertionOrderedSet (),
4850 freshFieldInvs : InsertionOrderedSet [InverseFunctions ] = InsertionOrderedSet (),
4951 freshArps : InsertionOrderedSet [(Var , Term )] = InsertionOrderedSet (),
52+ freshConstraints : InsertionOrderedSet [Term ] = InsertionOrderedSet (),
5053 freshSnapshots : InsertionOrderedSet [Function ] = InsertionOrderedSet (),
5154 freshPathSymbols : InsertionOrderedSet [Function ] = InsertionOrderedSet (),
5255 freshMacros : InsertionOrderedSet [MacroDecl ] = InsertionOrderedSet (),
@@ -190,6 +193,10 @@ case class ActualFunctionRecorder(private val _data: FunctionData,
190193 if (depth <= 2 ) copy(freshArps = freshArps + ((arp, constraint)))
191194 else this
192195
196+ def recordConstraint (constraint : Term ): ActualFunctionRecorder =
197+ if (depth <= 2 ) copy(freshConstraints = freshConstraints + constraint)
198+ else this
199+
193200 def recordFreshSnapshot (snap : Function ): ActualFunctionRecorder =
194201 if (depth <= 1 ) copy(freshSnapshots = freshSnapshots + snap)
195202 else this
@@ -231,6 +238,7 @@ case class ActualFunctionRecorder(private val _data: FunctionData,
231238 val fvfs = freshFvfsAndDomains ++ other.freshFvfsAndDomains
232239 val fieldInvs = freshFieldInvs ++ other.freshFieldInvs
233240 val arps = freshArps ++ other.freshArps
241+ val constraints = freshConstraints ++ other.freshConstraints
234242 val snaps = freshSnapshots ++ other.freshSnapshots
235243 val symbols = freshPathSymbols ++ other.freshPathSymbols
236244 val macros = freshMacros ++ other.freshMacros
@@ -240,6 +248,7 @@ case class ActualFunctionRecorder(private val _data: FunctionData,
240248 freshFvfsAndDomains = fvfs,
241249 freshFieldInvs = fieldInvs,
242250 freshArps = arps,
251+ freshConstraints = constraints,
243252 freshSnapshots = snaps,
244253 freshPathSymbols = symbols,
245254 freshMacros = macros)
@@ -269,6 +278,7 @@ case object NoopFunctionRecorder extends FunctionRecorder {
269278 val freshFvfsAndDomains : InsertionOrderedSet [SnapshotMapDefinition ] = InsertionOrderedSet .empty
270279 val freshFieldInvs : InsertionOrderedSet [InverseFunctions ] = InsertionOrderedSet .empty
271280 val freshArps : InsertionOrderedSet [(Var , Term )] = InsertionOrderedSet .empty
281+ val freshConstraints : InsertionOrderedSet [Term ] = InsertionOrderedSet .empty
272282 val freshSnapshots : InsertionOrderedSet [Function ] = InsertionOrderedSet .empty
273283 val freshPathSymbols : InsertionOrderedSet [Function ] = InsertionOrderedSet .empty
274284 val freshMacros : InsertionOrderedSet [MacroDecl ] = InsertionOrderedSet .empty
@@ -285,6 +295,7 @@ case object NoopFunctionRecorder extends FunctionRecorder {
285295 def recordFieldInv (inv : InverseFunctions ): NoopFunctionRecorder .type = this
286296 def recordSnapshot (fapp : ast.FuncApp , guards : Stack [Term ], snap : Term ): NoopFunctionRecorder .type = this
287297 def recordArp (arp : Var , constraint : Term ): NoopFunctionRecorder .type = this
298+ def recordConstraint (constraint : Term ): NoopFunctionRecorder .type = this
288299 def recordFreshSnapshot (snap : Function ): NoopFunctionRecorder .type = this
289300 def recordPathSymbol (symbol : Function ): NoopFunctionRecorder .type = this
290301 def recordFreshMacro (decl : MacroDecl ): NoopFunctionRecorder .type = this
0 commit comments