Skip to content

Commit

Permalink
make sure globals in pre/postconditions are defined
Browse files Browse the repository at this point in the history
  • Loading branch information
l-kent committed Oct 9, 2023
1 parent 2e3db86 commit 0fd4735
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/scala/translating/IRToBoogie.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class IRToBoogie(var program: Program, var spec: Specification) {
def translate: BProgram = {
val procedures = program.procedures.map(f => translateProcedure(f))
val defaultGlobals = List(BVarDecl(mem), BVarDecl(Gamma_mem))
val globalDecls = (procedures.flatMap(p => p.globals).map(b => BVarDecl(b)) ++ defaultGlobals).distinct.sorted.toList
val globalVars = procedures.flatMap(p => p.globals ++ p.freeRequires.flatMap(_.globals) ++ p.freeEnsures.flatMap(_.globals) ++ p.ensures.flatMap(_.globals) ++ p.requires.flatMap(_.globals))
val globalDecls = (globalVars.map(b => BVarDecl(b)) ++ defaultGlobals).distinct.sorted.toList

val globalConsts: List[BConstAxiomPair] = globals.map(g => BConstAxiomPair(BVarDecl(g.toAddrVar), g.toAxiom)).toList.sorted

Expand Down

0 comments on commit 0fd4735

Please sign in to comment.