Skip to content

Commit

Permalink
Cleaning up code that records fresh functions and macros
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoeilers committed Sep 16, 2024
1 parent dba59ca commit ee7de80
Showing 1 changed file with 11 additions and 27 deletions.
38 changes: 11 additions & 27 deletions src/main/scala/decider/Decider.scala
Original file line number Diff line number Diff line change
Expand Up @@ -515,41 +515,25 @@ trait DefaultDeciderProvider extends VerifierComponent { this: Verifier =>
def freshMacros: Vector[MacroDecl] = _declaredFreshMacros

def declareAndRecordAsFreshFunctions(functions: Set[FunctionDecl], toSymbolStack: Boolean): Unit = {
if (!toSymbolStack) {
for (f <- functions) {
if (!_declaredFreshFunctions.contains(f))
prover.declare(f)

_declaredFreshFunctions = _declaredFreshFunctions + f
}
} else {
for (f <- functions) {
if (!_declaredFreshFunctions.contains(f))
prover.declare(f)

for (f <- functions) {
if (!_declaredFreshFunctions.contains(f)) {
prover.declare(f)
_declaredFreshFunctions = _declaredFreshFunctions + f
_freshFunctionStack.foreach(s => s.add(f))
}
}
if (toSymbolStack)
_freshFunctionStack.foreach(s => s.addAll(functions))
}

def declareAndRecordAsFreshMacros(macros: Seq[MacroDecl], toStack: Boolean): Unit = {
if (!toStack) {
for (m <- macros) {
if (!_declaredFreshMacros.contains(m)) {
prover.declare(m)
_declaredFreshMacros = _declaredFreshMacros.appended(m)
}
}
} else {
for (m <- macros) {
if (!_declaredFreshMacros.contains(m)) {
prover.declare(m)
_declaredFreshMacros = _declaredFreshMacros.appended(m)
}
_freshMacroStack.foreach(l => l.append(m))
for (m <- macros) {
if (!_declaredFreshMacros.contains(m)) {
prover.declare(m)
_declaredFreshMacros = _declaredFreshMacros.appended(m)
}
}
if (toStack)
_freshMacroStack.foreach(l => l.appendAll(macros))
}

def pushSymbolStack(): Unit = {
Expand Down

0 comments on commit ee7de80

Please sign in to comment.