Skip to content

Commit 722c161

Browse files
committed
MR: keep quantified const assumptions
1 parent 0276376 commit 722c161

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

keymaerax-core/src/main/scala/edu/cmu/cs/ls/keymaerax/btactics/DLBySubst.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ private object DLBySubst {
338338
else sequent.ante.map(fml =>
339339
ghosts.foldLeft(fml)({ case (f, ((what, repl), _)) => SubstitutionHelper.replaceFree(f)(what, repl) })).
340340
flatMap(FormulaTools.conjuncts).
341-
filter(StaticSemantics.symbols(_).intersect(aBVs.toSet).isEmpty).toList
341+
filter(StaticSemantics.freeVars(_).intersect(aBVs.toSet).isEmpty).toList
342342
(constConjuncts, isGame) match {
343343
case (Nil, _) | (_, true) => (oldifiedC, skip, implyR(1))
344344
case (consts, false) => (And(consts.reduceRight(And), oldifiedC),

keymaerax-webui/src/test/scala/btactics/DLTests.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,11 @@ class DLTests extends TacticTestBase {
350350
result.subgoals shouldBe "A>1&x>5 ==> [x:=A;]x>1".asSequent :: "A>1, x>1 ==> [y:=A*x;]y>1".asSequent :: Nil
351351
}
352352

353+
it should "preserve a quantified const fact" in withMathematica { _ =>
354+
val result = proveBy("\\forall x (x^2+2>=A)&A>1&x>5 -> [x:=A;][y:=A*x;]y>1".asFormula, implyR(1) & generalize("x>1".asFormula)(1))
355+
result.subgoals shouldBe "\\forall x (x^2+2>=A)&A>1&x>5 ==> [x:=A;]x>1".asSequent :: "\\forall x (x^2+2>=A)&A>1, x>1 ==> [y:=A*x;]y>1".asSequent :: Nil
356+
}
357+
353358
it should "preserve function facts" in withMathematica { _ =>
354359
val result = proveBy("A()>1&x>5 -> [x:=A();][y:=A()*x;]y>1".asFormula, implyR(1) & generalize("x>1".asFormula)(1))
355360
result.subgoals shouldBe "A()>1&x>5 ==> [x:=A();]x>1".asSequent :: "A()>1, x>1 ==> [y:=A()*x;]y>1".asSequent :: Nil

0 commit comments

Comments
 (0)