summaryrefslogtreecommitdiff
path: root/Chalice/src
diff options
context:
space:
mode:
authorGravatar kyessenov <unknown>2010-08-19 21:10:41 +0000
committerGravatar kyessenov <unknown>2010-08-19 21:10:41 +0000
commitef633e71d0b9baae12ea475281fa8a29c4329574 (patch)
tree37736b9ffc86bf451cc658def671e7e25079540c /Chalice/src
parentcab92c658d8ea45da647de99dc8250d3cbc28801 (diff)
Chalice: more regression tests; cosmetic changes to code
Diffstat (limited to 'Chalice/src')
-rw-r--r--Chalice/src/Ast.scala8
-rw-r--r--Chalice/src/PrettyPrinter.scala2
2 files changed, 5 insertions, 5 deletions
diff --git a/Chalice/src/Ast.scala b/Chalice/src/Ast.scala
index cbb2ac85..f5c2d1b4 100644
--- a/Chalice/src/Ast.scala
+++ b/Chalice/src/Ast.scala
@@ -241,9 +241,9 @@ case class SeqPat(pats: List[Transform]) extends Transform {
}
case class RefinementBlock(con: List[Statement], abs: List[Statement]) extends Statement {
if (con.size > 0) pos = con.first.pos;
- // existing local variables before the block
+ // local variables in context at the beginning of the block
var before: List[Variable] = null;
- // shared declared local variables
+ // shared declared local variables (mapping between abstract and concrete)
lazy val during: (List[Variable], List[Variable]) = {
val a = for (v <- abs.flatMap(s => s.Declares)) yield v;
val c = for (v <- a) yield con.flatMap(s => s.Declares).find(_ == v).get
@@ -266,7 +266,7 @@ case class BlockStmt(ss: List[Statement]) extends Statement {
override def Targets = (ss :\ Set[Variable]()) { (s, vars) => vars ++ s.Targets}
}
case class IfStmt(guard: Expression, thn: BlockStmt, els: Option[Statement]) extends Statement {
- override def Targets = thn.Targets ++ (els match {case None => Set(); case Some(els) => els.Targets})
+ override def Targets = thn.Targets ++ (els match {case None => Set(); case Some(els) => els.Targets})
}
case class WhileStmt(guard: Expression,
oldInvs: List[Expression], newInvs: List[Expression], lkch: List[Expression],
@@ -552,7 +552,7 @@ object AST {
case x => List(x)
}}
def noTwoBlocks: List[Transform] => List[Transform] = {
- case BlockPat() :: BlockPat() :: l => noTwoBlocks(BlockPat() :: l)
+ case BlockPat() :: (bp @ BlockPat()) :: l => noTwoBlocks(bp :: l)
case x :: l => x :: noTwoBlocks(l)
case Nil => Nil
}
diff --git a/Chalice/src/PrettyPrinter.scala b/Chalice/src/PrettyPrinter.scala
index 30cfb66f..b2fd4e1b 100644
--- a/Chalice/src/PrettyPrinter.scala
+++ b/Chalice/src/PrettyPrinter.scala
@@ -95,7 +95,7 @@ object PrintProgram {
}
for (inv <- w.newInvs) {
Spaces(indent+2)
- print("invariant "); Expr(inv); print(" // refined"); println(Semi)
+ print("invariant "); Expr(inv); print(Semi); println(" // refined");
}
for (l <- lkch) {
Spaces(indent+2)