|
7 | 7 | package viper.silicon.tests |
8 | 8 |
|
9 | 9 | import viper.silicon.Silicon |
10 | | -import viper.silver.testing.{AbstractOutput, CustomAnnotation, DefaultAnnotatedTestInput, DefaultTestInput, OutputAnnotationId, SilOutput, TestAnnotation, TestAnnotationParser, TestCustomError, TestError, TestInput} |
| 10 | +import viper.silver.testing.{AbstractOutput, CounterexampleParser, CustomAnnotation, DefaultAnnotatedTestInput, DefaultTestInput, ExpectedCounterexample, OutputAnnotationId, SilOutput, TestAnnotation, TestAnnotationParser, TestCustomError, TestError, TestInput} |
11 | 11 | import fastparse._ |
12 | 12 | import viper.silicon.interfaces.SiliconMappedCounterexample |
13 | 13 | import viper.silicon.reporting.{ExtractedModel, ExtractedModelEntry, LitIntEntry, LitPermEntry, NullRefEntry, RecursiveRefEntry, RefEntry, SeqEntry} |
14 | | -import viper.silver.parser.FastParserCompanion.whitespace |
15 | 14 | import viper.silver.parser.{FastParser, PAccPred, PBinExp, PExp, PFieldAccess, PIdnUseExp, PIntLit, PLookup, PSymOp, PUnExp} |
16 | 15 | import viper.silver.utility.Common.Rational |
17 | 16 | import viper.silver.verifier.{FailureContext, VerificationError} |
@@ -167,24 +166,3 @@ case class ExpectedCounterexampleAnnotation(id: OutputAnnotationId, file: Path, |
167 | 166 |
|
168 | 167 | override def withForLineNr(line: Int = forLineNr): ExpectedCounterexampleAnnotation = ExpectedCounterexampleAnnotation(id, file, line, expectedCounterexample) |
169 | 168 | } |
170 | | - |
171 | | -/** |
172 | | - * Simple input language to describe an expected counterexample with corresponding parser. |
173 | | - * Currently, a counterexample is expressed by a comma separated list of access predicates and equalities (using the |
174 | | - * same syntax as in Viper) |
175 | | - */ |
176 | | -class CounterexampleParser(fp: FastParser) { |
177 | | - import fp.{accessPred, eqExp} |
178 | | - |
179 | | - def expectedCounterexample[_: P]: P[ExpectedCounterexample] = |
180 | | - (Start ~ "(" ~ (accessPred | eqExp).rep(0, ",") ~ ")" ~ End) |
181 | | - .map(ExpectedCounterexample) |
182 | | -} |
183 | | - |
184 | | -case class ExpectedCounterexample(exprs: Seq[PExp]) { |
185 | | - assert(exprs.forall { |
186 | | - case _: PAccPred => true |
187 | | - case PBinExp(_, r, _) if r.rs == PSymOp.EqEq => true |
188 | | - case _ => false |
189 | | - }) |
190 | | -} |
0 commit comments