File tree Expand file tree Collapse file tree
main/scala/viper/silver/ast
test/resources/all/issues/silicon Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -568,6 +568,7 @@ sealed trait DomainAxiom extends DomainMember {
568568 (if (! Consistency .noResult(exp)) Seq (ConsistencyError (" Axioms can never contain result variables." , exp.pos)) else Seq ()) ++
569569 (if (! Consistency .noOld(exp)) Seq (ConsistencyError (" Axioms can never contain old expressions." , exp.pos)) else Seq ()) ++
570570 (if (! Consistency .noLocationAccesses(exp)) Seq (ConsistencyError (" Axioms can never contain location accesses." , exp.pos)) else Seq ()) ++
571+ (if (! Consistency .noAsserting(exp)) Seq (ConsistencyError (" Axioms can never contain asserting expressions." , exp.pos)) else Seq ()) ++
571572 (if (! (exp isSubtype Bool )) Seq (ConsistencyError (" Axioms must be of Bool type" , exp.pos)) else Seq ()) ++
572573 Consistency .checkPure(exp)
573574
Original file line number Diff line number Diff line change @@ -90,6 +90,9 @@ object Consistency {
9090 /** Returns true if the given node contains no location accesses. */
9191 def noLocationAccesses (n : Node ) = ! n.existsDefined { case _ : LocationAccess => }
9292
93+ /** Returns true if the given node contains no asserting expressions. */
94+ def noAsserting (n : Node ) = ! n.existsDefined { case _ : Asserting => }
95+
9396 /** Returns true if the given node contains no accessibility predicates (unfolding predicates is
9497 * allowed) and no magic wands (applying wands is allowed).
9598 */
Original file line number Diff line number Diff line change 1+ // Any copyright is dedicated to the Public Domain.
2+ // http://creativecommons.org/publicdomain/zero/1.0/
3+
4+
5+ domain foo {
6+ function bar(): Bool
7+
8+ axiom {
9+ //:: ExpectedOutput(consistency.error)
10+ asserting (true) in true
11+ }
12+ }
13+
14+ function baz(): Int
15+ requires bar()
You can’t perform that action at this time.
0 commit comments