├── .gitignore ├── COPYING ├── README ├── build.sbt ├── core ├── examples │ ├── Java │ │ ├── A.class │ │ ├── B.class │ │ ├── JimpleTest.class │ │ ├── JimpleTest.java │ │ ├── ListA.class │ │ ├── NumericalTest.class │ │ ├── NumericalTest.java │ │ ├── ObjectTest.class │ │ ├── ObjectTest.java │ │ └── Pair.class │ ├── LPinv │ │ ├── berkeley.in │ │ ├── cars.in │ │ ├── cars2p.in │ │ ├── consistencyprot.in │ │ ├── dragon.in │ │ ├── heap.in │ │ ├── mcc.in │ │ ├── swim-pool.in │ │ └── train-beacon.in │ ├── Random │ │ ├── array.limit.R │ │ ├── bsearch.R │ │ ├── bsort.R │ │ ├── bsort.param.R │ │ ├── cousot78a.R │ │ ├── doublerate.R │ │ ├── floyd.R │ │ ├── heapsort.R │ │ ├── incr.R │ │ ├── increment.constraints.R │ │ ├── octagon-1.R │ │ ├── octagon-3.R │ │ ├── octagon-4.R │ │ ├── octagon-5.R │ │ ├── octagon-6.R │ │ ├── octagon-6bis.R │ │ ├── parallel.lines.R │ │ ├── policy-1.R │ │ ├── policy-2.R │ │ ├── precise.ineq.R │ │ ├── provatest.R │ │ ├── ratelim-monniaux.R │ │ ├── reviewer3.R │ │ ├── seidl.R │ │ ├── sum.R │ │ ├── sum2.R │ │ ├── sum3.R │ │ ├── trydoublematrix.R │ │ ├── trygeneralptopes.R │ │ ├── widening.R │ │ ├── xyline.R │ │ ├── xyline.param.R │ │ └── xyline.param2.R │ └── WideningPaper │ │ ├── backedge-widening.R │ │ ├── backedge-widening2.R │ │ ├── halbwachs.R │ │ ├── halbwachs.c │ │ ├── nested.R │ │ ├── nested.c │ │ ├── nested.cs │ │ ├── nested.interproc │ │ ├── nested2.R │ │ ├── nested2.c │ │ ├── nested2.cs │ │ ├── nested2.interproc │ │ ├── nested3.R │ │ ├── nested3.c │ │ ├── nested3.cs │ │ └── nested3.interproc └── src │ ├── main │ ├── apron │ │ └── it │ │ │ └── unich │ │ │ └── jandom │ │ │ ├── domains │ │ │ └── numerical │ │ │ │ └── apron │ │ │ │ ├── ApronDomain.scala │ │ │ │ ├── ApronProperty.scala │ │ │ │ └── SpireGmpUtils.scala │ │ │ └── ui │ │ │ └── ApronUIInitializer.scala │ ├── java │ │ └── soot │ │ │ └── jandom │ │ │ ├── BigBlockGraph.java │ │ │ ├── BriefBigBlockGraph.java │ │ │ ├── MyFastHierarchy.java │ │ │ └── UnitBlockGraph.java │ ├── ppl │ │ └── it │ │ │ └── unich │ │ │ └── jandom │ │ │ ├── domains │ │ │ └── numerical │ │ │ │ └── ppl │ │ │ │ ├── PPLBoxDouble.scala │ │ │ │ ├── PPLBoxDoubleDomain.scala │ │ │ │ ├── PPLDomain.scala │ │ │ │ ├── PPLDomainMacro.scala │ │ │ │ ├── PPLInitializer.scala │ │ │ │ ├── PPLProperty.scala │ │ │ │ └── PPLUtils.scala │ │ │ └── ui │ │ │ └── PPLUIInitializer.scala │ ├── resources │ │ └── htmlout │ │ │ └── index.html │ └── scala │ │ └── it │ │ └── unich │ │ └── jandom │ │ ├── benchmark │ │ ├── FASTLoader.scala │ │ └── SLILLoader.scala │ │ ├── domains │ │ ├── AbstractDomain.scala │ │ ├── AbstractProperty.scala │ │ ├── CachedTopBottom.scala │ │ ├── CartesianFiberedDomain.scala │ │ ├── CartesianFiberedProperty.scala │ │ ├── DimensionFiberedDomain.scala │ │ ├── DimensionFiberedProperty.scala │ │ ├── DomainTransformation.scala │ │ ├── NarrowingDescription.scala │ │ ├── WideningDescription.scala │ │ ├── numerical │ │ │ ├── BoxDoubleDomain.scala │ │ │ ├── BoxGenericDomain.scala │ │ │ ├── BoxRationalDomain.scala │ │ │ ├── DenseLinearForm.scala │ │ │ ├── LinearForm.scala │ │ │ ├── NumericalDomain.scala │ │ │ ├── NumericalProperty.scala │ │ │ ├── NumericalTopDomain.scala │ │ │ ├── OctagonDomain.scala │ │ │ ├── ParallelotopeRationalDomain.scala │ │ │ ├── ProductDomain.scala │ │ │ ├── SumDomain.scala │ │ │ ├── SumGenericDomain.scala │ │ │ ├── SumIntParallelotopeDomain.scala │ │ │ └── octagon │ │ │ │ ├── Octagon.scala │ │ │ │ ├── OctagonProperty.scala │ │ │ │ └── optimized │ │ │ │ └── OptimizedOctagon.scala │ │ ├── objects │ │ │ ├── AliasingDomain.scala │ │ │ ├── ObjectDomain.scala │ │ │ ├── ObjectDomainFactory.scala │ │ │ ├── PairSharingDomain.scala │ │ │ └── UP.scala │ │ └── package.scala │ │ ├── objectmodels │ │ ├── NoArrays.scala │ │ ├── ObjectModel.scala │ │ ├── ObjectModelHelper.scala │ │ └── TreeObjectModel.scala │ │ ├── package.scala │ │ ├── parsers │ │ ├── FastParser.scala │ │ ├── LPInvParser.scala │ │ ├── LinearFormParser.scala │ │ ├── NumericConditionParser.scala │ │ ├── NumericExpressionParser.scala │ │ ├── NumericalPropertyParser.scala │ │ ├── PairSharingParser.scala │ │ ├── RandomParser.scala │ │ └── VariableParser.scala │ │ ├── targets │ │ ├── Environment.scala │ │ ├── Interpretation.scala │ │ ├── MockTarget.scala │ │ ├── NumericAssignment.scala │ │ ├── NumericAssignmentMultiple.scala │ │ ├── NumericCondition.scala │ │ ├── NumericExpression.scala │ │ ├── Parameters.scala │ │ ├── Target.scala │ │ ├── cfg │ │ │ └── ControlFlowGraph.scala │ │ ├── eqs │ │ │ └── EQS.scala │ │ ├── jvmasm │ │ │ ├── AsmMethod.scala │ │ │ ├── JVMEnv.scala │ │ │ ├── JVMEnvDynFrame.scala │ │ │ ├── JVMEnvFixedFrame.scala │ │ │ └── UnsupportedASMInsnException.scala │ │ ├── jvmsoot │ │ │ ├── BafMethod.scala │ │ │ ├── JimpleMethod.scala │ │ │ ├── SootCFG.scala │ │ │ ├── SootFrameDomain.scala │ │ │ ├── SootFrameNumericalDomain.scala │ │ │ ├── SootFrameObjectDomain.scala │ │ │ ├── SootInterpretation.scala │ │ │ ├── SootObjectModel.scala │ │ │ ├── UnsupportedSootUnitException.scala │ │ │ └── package.scala │ │ ├── lts │ │ │ ├── LTS.scala │ │ │ ├── Location.scala │ │ │ ├── Region.scala │ │ │ └── Transition.scala │ │ ├── package.scala │ │ ├── parameters │ │ │ ├── IterationStrategy.scala │ │ │ ├── NarrowingSpecs.scala │ │ │ ├── NarrowingStrategy.scala │ │ │ ├── WideningNarrowingLocation.scala │ │ │ ├── WideningScope.scala │ │ │ └── WideningSpecs.scala │ │ └── slil │ │ │ ├── AnalysisPhase.scala │ │ │ ├── AssignStmt.scala │ │ │ ├── AssumeStmt.scala │ │ │ ├── CompoundStmt.scala │ │ │ ├── IfStmt.scala │ │ │ ├── NopStmt.scala │ │ │ ├── SLILProgram.scala │ │ │ ├── SLILStmt.scala │ │ │ ├── SLILTarget.scala │ │ │ ├── TagStmt.scala │ │ │ └── WhileStmt.scala │ │ ├── ui │ │ ├── NarrowingStrategies.scala │ │ ├── NumericalDomains.scala │ │ ├── ObjectDomains.scala │ │ ├── OutputInterface.scala │ │ ├── Parameter.scala │ │ ├── ParameterEnumeration.scala │ │ ├── ParameterValue.scala │ │ ├── WideningScopes.scala │ │ ├── cli │ │ │ ├── Conf.scala │ │ │ ├── JandomCLI.scala │ │ │ └── package.scala │ │ ├── gui │ │ │ ├── ASMEditorPane.scala │ │ │ ├── AboutDialog.scala │ │ │ ├── FastEditorPane.scala │ │ │ ├── JandomEditorPane.scala │ │ │ ├── JandomGUI.scala │ │ │ ├── MainFrame.scala │ │ │ ├── OutputPane.scala │ │ │ ├── ParametersPane.scala │ │ │ ├── SootEditorPane.scala │ │ │ ├── TargetPane.scala │ │ │ └── package.scala │ │ ├── output │ │ │ ├── HTMLOutputBuilder.scala │ │ │ ├── OutputBuilder.scala │ │ │ └── TextOutputBuilder.scala │ │ └── package.scala │ │ └── utils │ │ ├── DisjointSets.scala │ │ ├── DisjointSetsImpl.scala │ │ ├── IterableFunction.scala │ │ ├── PMaps.scala │ │ ├── Relation.scala │ │ ├── ResourceWalker.scala │ │ ├── TLists.scala │ │ ├── dbm │ │ ├── DBM.scala │ │ └── DBMClosure.scala │ │ └── numberext │ │ ├── Bounds.scala │ │ ├── DenseMatrix.scala │ │ ├── DenseVector.scala │ │ ├── GenericNumberExt.scala │ │ ├── IField.scala │ │ ├── RationalExt.scala │ │ └── package.scala │ └── test │ ├── apron │ └── it │ │ └── unich │ │ └── jandom │ │ └── domains │ │ └── numerical │ │ └── apron │ │ ├── ApronSpecification.scala │ │ ├── ApronSuite.scala │ │ └── MetaSpecification.scala │ ├── ppl │ └── it │ │ └── unich │ │ └── jandom │ │ ├── domains │ │ └── numerical │ │ │ └── ppl │ │ │ └── PPLDomainSuite.scala │ │ └── targets │ │ ├── JVMSootSuite.scala │ │ └── SootFrameNumericalDomainSuite.scala │ ├── resources │ ├── fast │ │ ├── aaron2.fst │ │ ├── ackerman.fst │ │ ├── as-hh.fst │ │ ├── as-hybrid.fst │ │ ├── as-nested.fst │ │ ├── as-nested2.fst2 │ │ ├── ax.fst │ │ ├── bakery.fst │ │ ├── bardin.fst │ │ ├── berkeley.fst │ │ ├── car.fst │ │ ├── car_simple.fst │ │ ├── counterex1.fst │ │ ├── counters1.fst │ │ ├── counters2.fst │ │ ├── counters3.fst │ │ ├── counters4.fst │ │ ├── cousot9.fst │ │ ├── descending.fst │ │ ├── descending2.fst │ │ ├── determinant.fst │ │ ├── disj.fst │ │ ├── disjbnd1.fst │ │ ├── disjbnd2.fst │ │ ├── easy1.fst │ │ ├── easy2.fst │ │ ├── exmini.fst │ │ ├── forward.fst │ │ ├── gasburner.fst │ │ ├── gasburner_alt.fst │ │ ├── gcd.fst │ │ ├── gonnord1.fst │ │ ├── gonnord2.fst │ │ ├── gonnord3.fst │ │ ├── gonnord4.fst │ │ ├── gonnord5.fst │ │ ├── gonnord6.fst │ │ ├── gopan_reps.fst │ │ ├── gopan_reps_alt1.fst │ │ ├── gopan_reps_alt2.fst │ │ ├── gulwani1.fst │ │ ├── gulwani1_alt.fst │ │ ├── gulwani2.fst │ │ ├── gulwani2_alt.fst │ │ ├── gulwani3.fst │ │ ├── gulwani4.fst │ │ ├── halbwachs1.fst │ │ ├── halbwachs2.fst │ │ ├── halbwachs3.fst │ │ ├── halbwachs4.fst │ │ ├── halbwachs5.fst │ │ ├── halbwachs6.fst │ │ ├── halbwachs7.fst │ │ ├── halbwachs8.fst │ │ ├── halbwachs9.fst │ │ ├── henry.fst │ │ ├── insertsort.fst │ │ ├── interleaving1.fst │ │ ├── interleaving2.fst │ │ ├── interleaving3.fst │ │ ├── interleaving4.fst │ │ ├── jeannet1.fst │ │ ├── jeannet2.fst │ │ ├── jeannet3.fst │ │ ├── jeannet4.fst │ │ ├── jeannet5.fst │ │ ├── jeannet6.fst │ │ ├── leeyannakis_bad.fst │ │ ├── loops.fst │ │ ├── maccarthy91.fst │ │ ├── metro.fst │ │ ├── microsoftex2.fst │ │ ├── microsoftex4.fst │ │ ├── microsoftex5.fst │ │ ├── microsoftex6.fst │ │ ├── microsoftex7.fst │ │ ├── multcounters1.fst │ │ ├── multcounters2.fst │ │ ├── multcounters3.fst │ │ ├── multcounters4.fst │ │ ├── nd_loop.fst │ │ ├── ndecr.fst │ │ ├── nested.fst │ │ ├── perfect.fst │ │ ├── popeea.fst │ │ ├── random1d.fst │ │ ├── random2d.fst │ │ ├── realbubble.fst │ │ ├── realheapsort.fst │ │ ├── realheapsort_step1.fst │ │ ├── realheapsort_step2.fst │ │ ├── realselect.fst │ │ ├── realshellsort.fst │ │ ├── relation1.fst │ │ ├── rsd.fst │ │ ├── sipmabubble.fst │ │ ├── slam.fst │ │ ├── slam_bad.fst │ │ ├── speedometer.fst │ │ ├── subway.fst │ │ ├── sum.fst │ │ ├── synergy_bad.fst │ │ ├── terminate.fst │ │ ├── terminator.fst │ │ ├── ticket.fst │ │ ├── wcet1.fst │ │ ├── wcet2.fst │ │ ├── while2.fst │ │ └── wise.fst │ ├── javatest │ │ ├── A.class │ │ ├── Abs.class │ │ ├── Abs1.class │ │ ├── Abs2.class │ │ ├── B.class │ │ ├── InstantiableInterface.class │ │ ├── K.class │ │ ├── ListA.class │ │ ├── ListA2.class │ │ ├── ListA3.class │ │ ├── ListInterface.class │ │ ├── ListInterface2.class │ │ ├── ListInterface3.class │ │ ├── ListInterface4.class │ │ ├── NoAbs1.class │ │ ├── OtherInterface.class │ │ ├── Pair.class │ │ ├── ParameterTest.java │ │ ├── R3.class │ │ ├── S1.class │ │ ├── S2.class │ │ ├── S3.class │ │ ├── S4.class │ │ ├── S5.class │ │ ├── SimpleTest.class │ │ ├── SimpleTest.java │ │ └── SimpleTestBaf.java │ ├── jimpletest │ │ ├── jimpletest.A.jimple │ │ ├── jimpletest.B.jimple │ │ ├── jimpletest.ListA.jimple │ │ ├── jimpletest.Pair.jimple │ │ ├── jimpletest.ParameterTest.jimple │ │ └── jimpletest.SimpleTest.jimple │ └── random │ │ ├── array.limit.R │ │ ├── bsearch.R │ │ ├── bsort.R │ │ ├── bsort.param.R │ │ ├── cousot78a.R │ │ ├── doublerate.R │ │ ├── floyd.R │ │ ├── heapsort.R │ │ ├── incr.R │ │ ├── increment.constraints.R │ │ ├── octagon-1.R │ │ ├── octagon-3.R │ │ ├── octagon-4.R │ │ ├── octagon-5.R │ │ ├── octagon-6.R │ │ ├── octagon-6bis.R │ │ ├── parallel.lines.R │ │ ├── policy-1.R │ │ ├── policy-2.R │ │ ├── precise.ineq.R │ │ ├── provatest.R │ │ ├── ratelim-monniaux.R │ │ ├── reviewer3.R │ │ ├── trydoublematrix.R │ │ ├── trygeneralptopes.R │ │ ├── widening.R │ │ ├── xyline.R │ │ ├── xyline.param.R │ │ └── xyline.param2.R │ └── scala │ ├── it │ └── unich │ │ └── jandom │ │ ├── JandomExample.scala │ │ ├── JandomFasterBench.scala │ │ ├── JandomParallelotopeBench.scala │ │ ├── JandomSumBench.scala │ │ ├── domains │ │ ├── AbstractDomainSuite.scala │ │ ├── CachedTopBottomSuite.scala │ │ ├── CartesianFiberedDomainSuite.scala │ │ ├── DomainTransformationSuite.scala │ │ ├── EmptyExistsSuite.scala │ │ ├── PreciseIntersectionSuite.scala │ │ ├── SeparatedTopAndBottomSuite.scala │ │ ├── numerical │ │ │ ├── BisimulationOctagonSpecification.scala │ │ │ ├── BoxDoubleDomainSuite.scala │ │ │ ├── BoxRationalDomainSuite.scala │ │ │ ├── DBMSpecification.scala │ │ │ ├── LinearFormSuite.scala │ │ │ ├── NumericalDomainSuite.scala │ │ │ ├── NumericalTopDomainSuite.scala │ │ │ ├── OctagonSpecification.scala │ │ │ ├── ParallelotopeRationalDomainFastSuite.scala │ │ │ ├── ProductDomainSuite.scala │ │ │ ├── SumIntParallelotopeDomainSuite.scala │ │ │ ├── Utils.scala │ │ │ └── octagon │ │ │ │ └── SimpleOctagon.scala │ │ └── objects │ │ │ ├── AliasingDomainSuite.scala │ │ │ ├── ObjectDomainSuite.scala │ │ │ ├── PairSharingSuite.scala │ │ │ ├── PreciseDefiniteNullness.scala │ │ │ ├── PreciseDefiniteWeakAliasing.scala │ │ │ ├── PreciseFiberChange.scala │ │ │ ├── PreciseObjectDomain.scala │ │ │ ├── PrecisePossiblePairSharing.scala │ │ │ └── UPSuite.scala │ │ ├── objectmodels │ │ ├── ObjectModelSuite.scala │ │ ├── TestObjectModel.scala │ │ ├── TestObjectModelSuite.scala │ │ ├── TrivialObjectModel.scala │ │ └── TrivialObjectModelSuite.scala │ │ ├── parsers │ │ ├── FastParserSuite.scala │ │ ├── LPInvParserSuite.scala │ │ ├── LinearFormParserSuite.scala │ │ ├── NumericConditionParserSuite.scala │ │ ├── NumericExpressionParserSuite.scala │ │ ├── NumericalPropertyParserSuite.scala │ │ └── RandomParserSuite.scala │ │ ├── targets │ │ ├── EnvironmentSuite.scala │ │ ├── JVMASMSuite.scala │ │ ├── JimpleParametersSuite.scala │ │ ├── JimpleSuite.scala │ │ ├── LTSSuite.scala │ │ ├── NumericAssignmentSuite.scala │ │ ├── NumericConditionSuite.scala │ │ ├── NumericExpressionSuite.scala │ │ ├── SLILProgramSuite.scala │ │ ├── SootObjectModelSuite.scala │ │ ├── SootTests.scala │ │ └── parameters │ │ │ ├── NarrowingsTest.scala │ │ │ └── WideningsTest.scala │ │ └── utils │ │ ├── DisjointSetsImplSuite.scala │ │ ├── IterableFunctionSuite.scala │ │ ├── PMapSuite.scala │ │ ├── RelationSuite.scala │ │ └── numberext │ │ ├── GenericNumberExtSuite.scala │ │ └── RationalExtSuite.scala │ └── soot │ └── jandom │ ├── BriefBigBlockGraphSuite.scala │ └── UnitBlockGraphSuite.scala ├── extended └── src │ ├── jmh │ └── scala │ │ └── it │ │ └── unich │ │ └── jandom │ │ └── benchmarks │ │ ├── BoxDoubleBenchmark.scala │ │ └── FASTBenchmark.scala │ ├── main │ └── ppl │ │ └── it │ │ └── unich │ │ └── jandom │ │ └── ui │ │ └── PPLMacroUIInitializer.scala │ └── test │ ├── ppl │ └── it │ │ └── unich │ │ └── jandom │ │ └── domains │ │ └── numerical │ │ └── ppl │ │ └── PPLMacroPropertySuite.scala │ └── scala │ └── it │ └── unich │ └── jandom │ └── benchmarks │ ├── EQSLegacyFASTComparison.scala │ ├── EQSLegacySLILComparison.scala │ ├── FASTComparison.scala │ └── FASTTracer.scala └── project ├── CustomKeys.scala ├── build.properties └── plugins.sbt /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | 3 | # sbt-specific 4 | target/ 5 | 6 | # eclipse 7 | .classpath 8 | .worksheet/ 9 | .settings/ 10 | .project 11 | target.eclipse/ 12 | .cache-main 13 | .cache-tests 14 | *.sc 15 | 16 | # intellij idea 17 | .idea/ 18 | 19 | # ensime 20 | .ensime 21 | .ensime_cache/ 22 | 23 | # VSCode 24 | .metals/ 25 | .bloop/ 26 | .vscode/ 27 | .bsp/ 28 | metals.sbt 29 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | This is Jandom, an abstract interpretation based static analyzer written 2 | in Scala. To compile it, you need ''sbt'' (Scala Build Tools) 0.13.5 or 3 | later [http://www.scala-sbt.org/]. 4 | 5 | In the main directoy of Jandom, execute "sbt run" to compile and execute 6 | Jandom. If asked about the program to run, choose "JandomGUI". It is 7 | possible to generate an Eclipse project from the shell with the command 8 | "sbt buildinfo eclipse". 9 | 10 | If the PPL (Parma Polyhedra Library) is installed, it will be used to 11 | extend the available numerical domains. Jandom requies PPL 1.1 or 12 | later [http://bugseng.com/products/ppl/download/ftp/]. 13 | 14 | -------------------------------------------------------------------------------- /core/examples/Java/A.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/examples/Java/A.class -------------------------------------------------------------------------------- /core/examples/Java/B.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/examples/Java/B.class -------------------------------------------------------------------------------- /core/examples/Java/JimpleTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/examples/Java/JimpleTest.class -------------------------------------------------------------------------------- /core/examples/Java/ListA.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/examples/Java/ListA.class -------------------------------------------------------------------------------- /core/examples/Java/NumericalTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/examples/Java/NumericalTest.class -------------------------------------------------------------------------------- /core/examples/Java/ObjectTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/examples/Java/ObjectTest.class -------------------------------------------------------------------------------- /core/examples/Java/Pair.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/examples/Java/Pair.class -------------------------------------------------------------------------------- /core/examples/LPinv/berkeley.in: -------------------------------------------------------------------------------- 1 | # 2 | # BERKELEY model taken from Fast 3 | # 4 | 5 | var invalid, unowned,nonexclusive,exclusive; 6 | 7 | Template( 8 | $i-$j-$k, 9 | $i+$j-$k, 10 | $i+$j+$k, 11 | -$i-$j-$k, 12 | -invalid-unowned-nonexclusive-exclusive); 13 | 14 | location l0 with ( 15 | exclusive=0 16 | nonexclusive=0 17 | unowned=0 18 | invalid>= 1); 19 | 20 | 21 | transition t1 l0 -> l0 with Guard( invalid >= 1 ) 22 | nonexclusive:=nonexclusive+exclusive 23 | exclusive:=0 24 | invalid:=invalid-1 25 | unowned:=unowned+1; 26 | 27 | transition t2 l0->l0 with Guard( 28 | nonexclusive + unowned >=1 ) 29 | invalid:=invalid + unowned + nonexclusive-1 30 | exclusive:=exclusive+1 31 | unowned:=0 32 | nonexclusive:=0; 33 | 34 | transition t3 l0 -> l0 with Guard( 35 | invalid >= 1 ) 36 | unowned:=0 37 | nonexclusive:=0 38 | exclusive:=1 39 | invalid:=invalid+unowned+exclusive+nonexclusive-1; 40 | 41 | end 42 | -------------------------------------------------------------------------------- /core/examples/LPinv/cars.in: -------------------------------------------------------------------------------- 1 | var x1, 2 | v1, 3 | x2, 4 | v2, 5 | x3, 6 | v3, 7 | t; 8 | 9 | 10 | 11 | location l0 with ( 12 | 13 | x1=90 14 | x2=80 15 | x3+70=0 16 | v3 >= 0 17 | v1 <= 2 18 | v1 -v3 >= 0 19 | 2* v2 - v1 - v3=0 20 | t=0 21 | ); 22 | 23 | 24 | Transition t0 l0 -> l0 with 25 | Guard ( 26 | 2* x2 - x1 - x3 >=0 27 | v2 + 5 >= 0 28 | v2 <= 5) 29 | 30 | x1:= x1 + v1 31 | x3:= x3+v3 32 | x2 := x2+v2 33 | v2 := v2 -1 34 | t:= t+1; 35 | 36 | Transition t1 l0 -> l0 with 37 | Guard ( 38 | 2*x2 -x1-x3 <=0 39 | v2 + 5 >= 0 40 | v2 <= 5) 41 | 42 | x1:= x1 + v1 43 | x3:= x3+v3 44 | x2 := x2+v2 45 | v2 := v2 +1 46 | t:= t+1; 47 | 48 | 49 | end 50 | -------------------------------------------------------------------------------- /core/examples/LPinv/heap.in: -------------------------------------------------------------------------------- 1 | var n, l, r, i, j; 2 | 3 | 4 | 5 | # 6 | #Adaptation of the heap sort example 7 | #from the CAV 2003 paper 8 | # 9 | 10 | location l0 with ( 11 | n >= 2 12 | r -n =0 13 | i -l=0 14 | j -2 *l =0 15 | 2 * l -n >= 0 16 | n + 1 >= 2* l 17 | l>=0 18 | r>=0 19 | i>=0 20 | j>=0 21 | ); 22 | 23 | 24 | transition t1 l0 -> l0 with 25 | Guard ( 26 | r -j -1 >= 0) 27 | i := j+ 1 28 | j := 2 * j + 2; 29 | 30 | 31 | transition t2 l0 -> l0 with 32 | Guard ( 33 | j -r <=0 34 | ) 35 | j := 2*j 36 | i := j; 37 | 38 | 39 | transition t3 l0 -> l0 with 40 | Guard ( 41 | l >=2 42 | r >=2 43 | ) 44 | i := l -1 45 | j := 2 *l - 2 46 | l:= l -1 ; 47 | 48 | transition t4 l0 -> l0 with 49 | Guard( 50 | l <= 1 51 | r >=3) 52 | r:= r-1 53 | i:= l 54 | j := 2*l; 55 | 56 | end 57 | 58 | 59 | -------------------------------------------------------------------------------- /core/examples/LPinv/mcc.in: -------------------------------------------------------------------------------- 1 | Var x,y1,y2; 2 | 3 | Location l0 with 4 | ( x <= 100 5 | y1 = 1 6 | y2 = x 7 | ); 8 | 9 | Transition t0 10 | l0 -> l0 with 11 | guard ( 12 | 13 | y1 <= 111 14 | y1 >= 101 15 | y2 >= 2 16 | x -y1 + 11 * y2 -11 <= 0 17 | ) 18 | 19 | y1 := y1 -10 20 | y2 := y2 - 1 ; 21 | 22 | Transition t1 23 | l0-> l0 with 24 | guard( 25 | y1 -100 <= 0 26 | x -y1 + 11 * y2 -11 <= 0 27 | ) 28 | 29 | y1 := y1 + 11 30 | y2 := y2 +1 ; 31 | 32 | end 33 | 34 | -------------------------------------------------------------------------------- /core/examples/LPinv/swim-pool.in: -------------------------------------------------------------------------------- 1 | var x1, x2, x3, x4, x5, x6, x7, p, q; 2 | 3 | #Taken from a Petri net paper 4 | # see [Fribourg+Olsen] or the 5 | # Sankaranarayanan+Sipma+Manna 2003 Petri net 6 | # paper 7 | 8 | Location l0 with ( 9 | x1=0 10 | x2=0 11 | x3=0 12 | x4=0 13 | x5=0 14 | x6-p=0 15 | x7-q=0 16 | p >=1 17 | q >=1); 18 | 19 | 20 | 21 | Transition t1 l0->l0 with 22 | Guard (x6 >=1 ) 23 | 24 | x1:=x1+1 25 | x6:= x6 -1 ; 26 | 27 | 28 | Transition t2 l0 -> l0 with 29 | Guard (x1 >=1 30 | x7 >=1) 31 | 32 | x1:= x1-1 33 | x2:=x2+1 34 | x7:=x7-1; 35 | 36 | Transition t3 l0->l0 with 37 | Guard( 38 | x2 >=1 39 | ) 40 | x2:=x2-1 41 | x3:=x3+1 42 | x6:=x6+1; 43 | 44 | Transition t4 l0->l0 with 45 | Guard(x3>=1 46 | x6>=1) 47 | x3:=x3-1 48 | x4:=x4+1 49 | x6:=x6-1; 50 | 51 | Transition t5 l0 -> l0 with 52 | Guard (x4>=1) 53 | x4:=x4-1 54 | x5:=x5+1 55 | x7:=x7+1; 56 | 57 | Transition t6 l0-> l0 with 58 | Guard(x5>=1) 59 | x5:= x5-1 60 | x6:= x6+1; 61 | end 62 | -------------------------------------------------------------------------------- /core/examples/Random/array.limit.R: -------------------------------------------------------------------------------- 1 | ## Scansione array di n elementi 2 | ## 3 | ## BOX: 4 | ## invariante: 1<=n, 1<=x 5 | ## 6 | ## ROTATED BOX, COMBINED BOX: come BOX il problema è che la PCA tiene separati gli assi x e k 7 | ## 8 | ## both ROTATED BOX with GENERATORS and SIMPLIFY : nulla, si potrebbe migliorare il trattamento di assume 9 | ## ----- both COMBINED BOX with GENERATORS and SIMPLIFY 10 | ## invariante: 1<=n, 1<=x, x-n<=1 11 | ## 12 | ## ROTATED BOX AD HOC: 13 | ## analyze.function(array.limit,rotatedbox.domain(solve(matrix(c(-1,1,1,0),nrow=2, byrow=TRUE))), vars=c("n","x")) 14 | ## invariante: 1<=n, x-n<=1 15 | ## COMBINED BOX AD HOC: combinazione di BOX e ROTATED BOX AD-HOC 16 | ## 17 | ## notare che se prendo assi molto simili (n, x-1.1*n) non riesco più ad avere 18 | ## nessuna informazione su x-n 19 | 20 | array.limit=function(n) { 21 | assume(n>=1) 22 | x=1 23 | while (x=0) { 22 | x = x-1 23 | if (brandom()) 24 | y = y+1 25 | } 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /core/examples/Random/octagon-3.R: -------------------------------------------------------------------------------- 1 | ## Octagon-3: the third program example in Octagon paper [Mine06] 2 | 3 | ## TARGET: at the end, n <= x <= n+1, 0 <= n 4 | ## BOX: 0 <= n 5 | ## PTOPE: n <= x 6 | ## --- COMBINED: n <= x <= n+1, 0 <= n 7 | ## --- OCTAGON: come COMBINED 8 | 9 | ## ICA like PCA 10 | 11 | if (FALSE) " 12 | /* Versione INTERPROC */ 13 | var x: real, n: real; 14 | begin 15 | x=0; 16 | assume n>=0; 17 | while x=0) 26 | while (x0 do 19 | x = x+1; 20 | i = i-1; 21 | done; 22 | end 23 | " 24 | 25 | octagon4 = function() { 26 | i = 16 27 | x = 1 28 | while (i>0) { 29 | x = x+1 30 | i = i-1 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /core/examples/Random/octagon-5.R: -------------------------------------------------------------------------------- 1 | ## Octagon-5: the fifth program example in Octagon paper [Mine06] 2 | ## Absolute Value 3 | 4 | ## TARGET: inside the last if: -69 <= x <= 69, 0 <= y <=69 5 | ## BOX: -100 <= x <= 100, 0 <= y <=69 6 | ## PTOPE: -69<=x<=69 , 0<=y<=138 7 | ## COMBO: OK 8 | ## ---- OCTAGON: OK 9 | 10 | ## ICA like PCA, but it also works with theta=0.98 while PCA does not work in this case 11 | if (FALSE) " 12 | /* Versione INTERPROC */ 13 | var x:real, y:real; 14 | begin 15 | assume x>=-100 and x<=100; 16 | y=x; 17 | if y<=0 then 18 | y=-y; 19 | endif; 20 | if y<=69 then 21 | skip; 22 | endif; 23 | end 24 | " 25 | 26 | absval = function (x) { 27 | assume(x>=-100 && x <=100) 28 | y=x 29 | if (y<=0) y = -y 30 | if (y<=69) y = y 31 | } 32 | 33 | absval.cases = list( 34 | list(x=-100), list(x=-10), list(x=0), list(x=10), list(x=100) 35 | ) 36 | 37 | list(absval, absval.cases) 38 | 39 | -------------------------------------------------------------------------------- /core/examples/Random/octagon-6.R: -------------------------------------------------------------------------------- 1 | ## Octagon-6: the sixth program example in Octagon paper [Mine06] 2 | ## RATE LIMITER 3 | 4 | ## TARGET: at the beginning of while: -128 <= y <= 128 5 | ## BOX: no 6 | ## PTOPE: no 7 | ## COMBO: no 8 | ## --- OCTAGON: -144 <= y <= 144 using widening with threshold 9 | 10 | ## PTOPE ad-hoc 1: y <= 160 using delayed widenings and matrix 11 | ## y x d s r 12 | ## PC1 1 0 0 0 0 13 | ## PC2 0 1 0 0 0 14 | ## PC3 0 0 1 0 0 15 | ## PC4 0 -1 0 1 1 16 | ## PC5 0 0 -1 1 0 17 | 18 | ## PTOPE ad-hoc 2: -160 <= y using delayed widenings and matrix 19 | ## y x d s r 20 | ## PC5 0 0 1 1 0 (other rows as above) 21 | 22 | ## COMBO ad-hoc: -128 <= y <= 128 using delayed widenings and matrix 23 | ## y x d s r 24 | ## PC3 0 0 1 1 0 (other rows as PTOPE ad-hoc 1) 25 | 26 | ## ICA: singular matrix! 27 | 28 | ratelim = function() { 29 | y=0 30 | while (brandom()) { 31 | x = trunc(runif(1,-128,129)) 32 | assume(x>=-128 && x<=128) 33 | d = trunc(runif(1,0,17)) 34 | assume(d>=0 && d<=16) 35 | s = y 36 | r = x-s 37 | y = x 38 | if (r<=-d) y = s-d 39 | if (d<=r) y = s+d 40 | } 41 | } 42 | 43 | ratelim.cases = function(n) { 44 | lapply(1:n,function(n) list()) 45 | } 46 | 47 | list(ratelim, ratelim.cases(10)) 48 | 49 | -------------------------------------------------------------------------------- /core/examples/Random/octagon-6bis.R: -------------------------------------------------------------------------------- 1 | ## Octagon-6bis: the sixth program example in Octagon paper [Mine06] 2 | ## RATE LIMITER 3 | 4 | ## The while condition has been changed to TRUE. The use of brandom makes 5 | ## the executions traces too small. 6 | ## In a previous bugged version of RANDOM this was relevant, but now it isn't: 7 | ## PCA/OSCA does not find good axes in any case. 8 | 9 | ## ICA: singular matrix 10 | 11 | ratelim = function() { 12 | y=0 13 | while (TRUE) { 14 | x = trunc(runif(1,-128,129)) 15 | assume(x>=-128 && x<=128) 16 | d = trunc(runif(1,0,17)) 17 | assume(d>=0 && d<=16) 18 | s = y 19 | r = x-s 20 | y=x 21 | if (r<=-d) y=s-d 22 | if (d<=r) y=s+d 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /core/examples/Random/parallel.lines.R: -------------------------------------------------------------------------------- 1 | ### 2 | ### Parallels: two exponentials computed in parallel 3 | ### 4 | 5 | ## 6 | ## Both PCA and OSCA cannot find any result 7 | ## Using the matrix: 8 | ## 1 -1 9 | ## 1 -2 10 | ## we can prove the invariant x=y. 11 | ## The matrix can be found as follows (maybe): 12 | ## - find the first principal component of the PCA 13 | ## - remove all points which have variance zero, and find again 14 | ## the first principal component of the PCA 15 | 16 | ## ICA with theta=0.80 singular 17 | ## ICA with theta=0.98 OK! 18 | 19 | parallel.lines = function() { 20 | x=1 21 | y=1 22 | while (TRUE) { 23 | x = x+y 24 | y = 2*y 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /core/examples/Random/policy-1.R: -------------------------------------------------------------------------------- 1 | # This example appear in the paper 2 | # "A Policy Iteration Algorithm for Computing Fixed Points in 3 | # Static Analysis of Programs" 4 | # 5 | # Other examples in http://www.di.ens.fr/~goubault/Politiques 6 | # 7 | # Not very interesting. It is only used to check performance of interval 8 | # analysis. 9 | 10 | policy1 <- function() 11 | { 12 | i=1 13 | j=10 14 | while (j>=i) { 15 | i = i+2; 16 | j = -1+j; 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /core/examples/Random/policy-2.R: -------------------------------------------------------------------------------- 1 | # This example appear in the paper 2 | # "A Policy Iteration Algorithm for Computing Fixed Points in 3 | # Static Analysis of Programs" 4 | # 5 | # Other examples in http://www.di.ens.fr/~goubault/Politiques 6 | # 7 | # Policy iteration may prove that, at the end of the example, 8 | # it is the case that j <= 120. Box, ptopes, octagon, polyhedra 9 | # cannot prove it. 10 | 11 | # ICA: singular 12 | 13 | 14 | if (FALSE) " 15 | /* Interproc versione */ 16 | var i:real, j:real, k:real; 17 | begin 18 | i = 0; 19 | k = 9; 20 | j = -100; 21 | while (i<=100) do 22 | i = i+1; 23 | while (j<20) do 24 | j = i+j; 25 | done; 26 | k = 4; 27 | while (k<=3) do 28 | k = k+1; 29 | done; 30 | done; 31 | end 32 | " 33 | 34 | policy2 <- function() 35 | { 36 | i = 0 37 | k = 9 38 | j = -100 39 | while (i<=100) { 40 | i = i+1 41 | while (j<20) 42 | j = i+j 43 | k = 4 44 | while (k<=3) 45 | k = k+1 46 | } 47 | } 48 | 49 | 50 | -------------------------------------------------------------------------------- /core/examples/Random/precise.ineq.R: -------------------------------------------------------------------------------- 1 | # 2 | # Strict Inequalitities 3 | # 4 | # This example wants to show that inequalities and disequalities 5 | # are handled very precisely in RANDOM. 6 | # 7 | 8 | # 9 | # Target: at the end, x=4, y=0, z=0 10 | # Intervals et al in RANDOM: OK! 11 | # Intervals et octagon in INTERPROC: 0<=y<=1, 0<=z<=1 12 | 13 | if (FALSE) " 14 | /* INTEPROC version */ 15 | var x:real, y:real, z:real; 16 | begin 17 | x=4; 18 | y=0; 19 | z=0; 20 | if (x<4) 21 | y=1; 22 | endif; 23 | if (x!=4) 24 | z=1; 25 | endif 26 | end 27 | " 28 | 29 | precise.ineq = function() { 30 | x = 4 31 | y = 0 32 | z = 0 33 | if (x<4) y=1 34 | if (x!=4) z=1 35 | } 36 | -------------------------------------------------------------------------------- /core/examples/Random/provatest.R: -------------------------------------------------------------------------------- 1 | ### Prova della implementazione operazione select, e confronto con APRON 2 | 3 | if (FALSE) " 4 | Versione INTERPROC 5 | 6 | proc testtry () returns (res: int) var x: int, y:int, z:int; 7 | begin 8 | assume x >= 0 and y >= 0 and x <= 1 and y<=1; 9 | assume z >= 0 and z <= 5; 10 | if -x-y+z+1<=0 then 11 | res=1; 12 | else 13 | res=0; 14 | endif; 15 | end 16 | 17 | var r:int; 18 | begin 19 | r = testtry(); 20 | end 21 | " 22 | 23 | 24 | test.try = function() { 25 | assume(0 <=x && x <= 1) 26 | assume(0 <=y && y <= 1) 27 | assume(0 <= z && z <= 5) 28 | if ( -x - y + z + 1<=0) 29 | res=1 30 | else 31 | res=0 32 | } 33 | -------------------------------------------------------------------------------- /core/examples/Random/ratelim-monniaux.R: -------------------------------------------------------------------------------- 1 | ratelim_monniaux = function() { 2 | x_old = 0 3 | while (TRUE) { 4 | assume(x>= -100000 && x <=100000) 5 | if (x > x_old+10) x= x_old +10 6 | if (x < x_old-10) x= x_old -10 7 | x_old = x 8 | } 9 | } -------------------------------------------------------------------------------- /core/examples/Random/reviewer3.R: -------------------------------------------------------------------------------- 1 | # 2 | # Program suggested by reviewer 3 of JSC 3 | # 4 | 5 | # Target: at the beggining of while: y <= 2x, y >= -2x 6 | # PCA and ICA find the standard axes 7 | # Ad-Hoc matrices work 8 | 9 | reviewer3 <- function () { 10 | x = 0 11 | y = 0 12 | while ( TRUE ) { 13 | y = y + 1; 14 | if ( brandom() ) 15 | x = 2 * y 16 | else 17 | x = - 2 * y 18 | } 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /core/examples/Random/seidl.R: -------------------------------------------------------------------------------- 1 | # This example has been discussed with Apinis, Seidl and Vojdani 2 | # during the works on the integrating localized narrowing with 3 | # the mixed widening/narrowing operator. 4 | 5 | function() { 6 | i = 0 7 | while (i < 42) { 8 | j = 0 9 | while (j < 10) 10 | j = j+1 11 | i = i+j 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /core/examples/Random/sum.R: -------------------------------------------------------------------------------- 1 | # This example is tailored for the domain Interval + Parallelotopes 2 | # The wanted invariant at the last line of the while loop is: 3 | # [ -1 <= x <= 0, -1 <= y <= 0, i = 0 ] + [ 1 <= i <= 10, x = i, y =i ] 4 | 5 | function () { 6 | i = 0 7 | x = 0 8 | y = 0 9 | while (i < 10) { 10 | i = i+1 11 | if (brandom()) x = i-1 else x = i 12 | if (brandom()) y = i-1 else y = i 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /core/examples/Random/sum2.R: -------------------------------------------------------------------------------- 1 | # This example is tailored for the domain Interval + Parallelotopes 2 | # The wanted invariant inside the while loop is: 3 | # [ -1 <= x <= 0, -1 <= y <= 0, i = 0 ] + [ 0 <= i <= 10, x = i, y =i ] 4 | 5 | function () { 6 | i = 0 7 | x = 0 8 | y = 0 9 | while (i < 10) { 10 | i = i+1 11 | if (brandom()) { 12 | x = i-1 13 | y = i 14 | } else if (brandom()){ 15 | x = i 16 | y = i -1 17 | } else { 18 | x = i 19 | y = i 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /core/examples/Random/sum3.R: -------------------------------------------------------------------------------- 1 | # This example is tailored for the domain Interval + Parallelotopes 2 | # The wanted invariant inside the while loop is: 3 | # [ 0 <= x <= 1, 0 <= y <= 1] + [ 0 <= x<= 10, x = y ] 4 | 5 | function () { 6 | x = 0 7 | y = 0 8 | while (x < 10) { 9 | if (x <= y) x = y else y = x 10 | x = x+1 11 | y = y+1 12 | if (brandom()) x = x-1 else y = y-1 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /core/examples/Random/trydoublematrix.R: -------------------------------------------------------------------------------- 1 | f = function() { 2 | x = 0 3 | while (x < 100) { 4 | x = x + 1 5 | y = 0 6 | while (y < x) 7 | y = y + 1 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /core/examples/Random/trygeneralptopes.R: -------------------------------------------------------------------------------- 1 | f <- function() { 2 | x = 1 3 | y = 1 4 | while (y < 100) { 5 | y = y + y 6 | y = y + y 7 | x = x + x 8 | x = x + x 9 | } 10 | } 11 | 12 | 13 | -------------------------------------------------------------------------------- /core/examples/Random/widening.R: -------------------------------------------------------------------------------- 1 | # Prova widening 2 | 3 | if (FALSE) " 4 | /* Versione INTERPROC di Wide */ 5 | var x:real,y:real; 6 | begin 7 | x=0; 8 | y=0; 9 | while (x<100) do 10 | x=x+1; 11 | if (brandom) then 12 | y=x; 13 | endif; 14 | done; 15 | end 16 | " 17 | 18 | wide = function(k) { 19 | x = 0 20 | y = 0 21 | while (x<100) { 22 | x=x+1 23 | if (k[x]<=0) y=x 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /core/examples/Random/xyline.R: -------------------------------------------------------------------------------- 1 | ## Esempio di scansione della retta x + y = 0 2 | ## 3 | ## BOX: 4 | ## invariante while: -11<=x<=10 , -10<=y<=11 (-21<=x+y<=21, -22<=x-y<=20) 5 | ## 6 | ## ROTATED BOX no SIMPLIFY: 7 | ## invariante while: -1<=x<=127381033450515456 , -10<=y<=127381033450515456 , 8 | ## -2.04112019628891e-15<=x+y<=254762066901030880, -22<=x-y<=20 9 | ## COMBINED BOX no SIMPLIFY: 10 | ## invariante del while: -1<=x<=10 , -10<=y<=11, -2.04112019628891e-15<=x+y<=20, -2<=x-y<=20 11 | ## 12 | ## ----- both ROTATED BOX: 13 | ## invariante while: -1<=x<=10, -10<=y<=1, 0<=x+y<=0, -2<=x-y<=20 14 | ## both COMBINED BOX: 15 | ## invariante while: come ROTATED BOX 16 | ## 17 | ## INTERPROC: box come i nostri, octagon da gli stessi risultati del combined ad-hoc 18 | 19 | if (FALSE) " 20 | /* Versione INTERPROC */ 21 | 22 | var x:real, y:real; 23 | begin 24 | x=10; 25 | y=-10; 26 | while x>y do 27 | x= x-1; 28 | y= y+1; 29 | done; 30 | end 31 | " 32 | 33 | xyline=function() { 34 | x=10 35 | y=-10 36 | while(x>y) { 37 | x= x-1 38 | y= y+1 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /core/examples/Random/xyline.param.R: -------------------------------------------------------------------------------- 1 | ## Versione parametrica di xyline 2 | ## 3 | ## BOX: 4 | ## invariante: 0<=k 5 | ## 6 | ## ROTATED BOX, COMBINED BOX: come BOX 7 | ## le tre componenti principali sono "k, x+y, x-y" e quindi non si ha relazione tra k ed x, y 8 | ## 9 | ## ROTATED BOX with GENERATOR (10): 10 | ## invariante: x-k<=0, 0<=k+x+2*y 11 | ## COMBINED BOX with GENERATOR (10): 12 | ## invariante: come ROTATED BOX + BOX, in più -k-x+y<=2 13 | ## 14 | ## inverted ROTATED BOX with GENERATOR (10): nulla 15 | ## inverted COMBINED BOX with GENERATOR (10): come BOX 16 | ## 17 | ## ROTATED BOX AD HOC: 18 | ## analyze.function(xyline.param,rotatedbox.domain(solve(matrix(c(1,0,-1,1,-1,0,1,1,0),nrow=3, byrow=TRUE))), vars=c("x","y","k"),displayed.forms=c("x","y","k","x-y","x+y","x-k","k+x+2*y","-k-x+y")) 19 | ## invariante: -1<=x, y<=1, -1<=k, -2<=x-y, 0<=x+y<=0, x-k<=0 (0<=k+x+2*y, -k-x+y<=3) 20 | ## ----- COMBINED BOX AD HOC: 21 | ## stessa matrice di cui sopra 22 | ## invariante come sopra, in più: 0<=k (-k-x+y<=2) 23 | ## 24 | ## INTERPROC 25 | ## box: stessi risultati dei nostri box 26 | ## octagon: ottengo gli stessi risultati di Ad-Hoc Combined Box. Ma il nostro tool consente anche di ottenere 27 | ## proprietà derivate come 0<=k+x+2*y 28 | ## 29 | 30 | xyline.param=function(k) { 31 | assume(k>0) 32 | x=k 33 | y=-k 34 | while(x>y) { 35 | x= x-1 36 | y= y+1 37 | } 38 | } 39 | 40 | xyline.param.cases = function(n) { 41 | params=list() 42 | for (i in 1:n) 43 | params=c(params,list(list(k=i))) 44 | return(params) 45 | } 46 | 47 | list(xyline.param, xyline.param.cases(10)) 48 | -------------------------------------------------------------------------------- /core/examples/Random/xyline.param2.R: -------------------------------------------------------------------------------- 1 | ## Versione parametrica di xyline più "buona" 2 | ## 3 | ## BOX invariante: nulla 4 | ## ROTATED BOX with GENERATORS new SIMPLIFY: -Inf<=-x+y<=Inf , 0<=x+y<=0 5 | ## COMBO BOX with GENERATORS new SIMPLIFY: -1<=x<=Inf , -Inf<=y<=1 : -Inf<=-x+y<=2 , 0<=x+y<=0 6 | 7 | xyline.param2=function(x) { 8 | assume(x>0) 9 | y=-x 10 | .tracetag(3) 11 | while(x>y) { 12 | x= x-1 13 | y= y+1 14 | } 15 | } 16 | 17 | xyline.param2.cases = function(n) { 18 | params=list() 19 | for (i in 1:n) 20 | params=c(params,list(list(x=i))) 21 | return(params) 22 | } 23 | 24 | list(xyline.param2, xyline.param2.cases(10)) 25 | -------------------------------------------------------------------------------- /core/examples/WideningPaper/backedge-widening.R: -------------------------------------------------------------------------------- 1 | # 2 | # This shows the benefits of widening at back edges. When scope is BackEdge 3 | # the result is 0 <= i <= 10. Otherwise, the result is 0 <= i <= +\infty. 4 | # The same result may be obtained with a delayed widening. 5 | # 6 | # Note that if we use i=1 it may not work, due to some optimizations of the 7 | # PPL widening. 8 | 9 | backedge = function() { 10 | i=0 11 | while (TRUE) { 12 | if (brandom()) 13 | i = 10 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /core/examples/WideningPaper/backedge-widening2.R: -------------------------------------------------------------------------------- 1 | # This is another example which shows benefits of back-edge widening. 2 | # Even in this case, back-edge widening may be replaced by delayed widening. 3 | 4 | bakedge2 = function() { 5 | i = 0 6 | x = 0 7 | while ( TRUE ) { 8 | # we need i=10 and not i=1 because PPL widening has 9 | # intermediary thresholds for small numbers. 10 | if (x >= 100) 11 | i = 10 12 | else 13 | i = -10 14 | x = x + 1 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /core/examples/WideningPaper/halbwachs.R: -------------------------------------------------------------------------------- 1 | # Example 3 from Halbawachs: when the decreasing sequence fails. 2 | 3 | # We are able to prove, like Pagai, "i <= j+3" is an invariant in the 4 | # inner while, both with Random widening, or with Restart narrowing. 5 | # It does not work with Continue narrowing. 6 | 7 | halbawach2 = function() { 8 | i = 0 9 | while (i < 4) { 10 | j = 0 11 | while (j < 4) { 12 | i = i+1 13 | j = j + 1 14 | } 15 | i = i - j +1 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /core/examples/WideningPaper/halbwachs.c: -------------------------------------------------------------------------------- 1 | int main() 2 | { 3 | i = 0; 4 | while (i < 4) { 5 | j = 0; 6 | while (j < 4) { 7 | i = i+1 ; 8 | j = j + 1; 9 | } 10 | i = i - j +1; 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /core/examples/WideningPaper/nested.R: -------------------------------------------------------------------------------- 1 | # This example is a simple nested loop. It has been devised to show 2 | # benefits of the strategy of narrowing with restart. 3 | 4 | nested = function() { 5 | i = 0 6 | while (i < 10) { 7 | j = 0 8 | while (j < 10) 9 | j = j+1 10 | i = i+1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /core/examples/WideningPaper/nested.c: -------------------------------------------------------------------------------- 1 | # Nested in C for use with PAGAI. PAGAI is able to prove that i <= 10 2 | # using standard AI technique with new narrowing. 3 | 4 | int main() { 5 | int i = 0; 6 | while (i < 10) { 7 | int j = 0; 8 | while (j < 10) 9 | j = j+1; 10 | i = i+1; 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /core/examples/WideningPaper/nested.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics.Contracts; 3 | 4 | [ContractVerification(true)] 5 | public class Program 6 | { 7 | public static int Puzzle() { 8 | Contract.Ensures(Contract.Result() == 10); 9 | int i,j; 10 | 11 | nested2 = function() { 12 | i = 0 13 | while (TRUE) { 14 | j = 0 15 | while (j < 10) 16 | j = j + 1 17 | i = i + 11 - j 18 | } 19 | } 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /core/examples/WideningPaper/nested.interproc: -------------------------------------------------------------------------------- 1 | var i:real, j:real; 2 | begin 3 | i = 0; 4 | while (i<=10) do 5 | j = 0; 6 | while (j<=10) do 7 | j=j+1; 8 | done; 9 | i = i+1; 10 | done; 11 | end 12 | -------------------------------------------------------------------------------- /core/examples/WideningPaper/nested2.R: -------------------------------------------------------------------------------- 1 | # This example is a simple nested loop. It has been devised to show 2 | # benefits of the strategy of narrowing with restart or continue. Both 3 | # strategies are able to prove that i >= 0, while Separate strategy cannot 4 | # even with Random or Back-Edge widening. 5 | 6 | nested2 = function() { 7 | i = 0 8 | while (TRUE) { 9 | j = 0 10 | while (j < 10) 11 | j = j + 1 12 | i = i + 11 - j 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /core/examples/WideningPaper/nested2.c: -------------------------------------------------------------------------------- 1 | # Nested 2 in C for use with PAGAI. PAGAI is able to prove that i >= 0 2 | # in the inner loop, but not with standard AI technique, even with 3 | # new widening. 4 | 5 | int main() { 6 | int i = 0; 7 | while (1) { 8 | int j = 0; 9 | while (j < 10) 10 | j = j+1; 11 | i = i+11-j; 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /core/examples/WideningPaper/nested2.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics.Contracts; 3 | 4 | [ContractVerification(true)] 5 | public class Program 6 | { 7 | public static int Puzzle() { 8 | Contract.Ensures(Contract.Result() == 10); 9 | int i,j; 10 | i=0; 11 | j=0; 12 | while (true){ 13 | Contract.Assert(i >= 0); 14 | j=0; 15 | while (j<10) 16 | j = j + 1; 17 | i = i + 11 - j; 18 | } 19 | return i; 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /core/examples/WideningPaper/nested2.interproc: -------------------------------------------------------------------------------- 1 | var i:int, j:int; 2 | begin 3 | i = 0; 4 | while (true) do 5 | j = 0 ; 6 | while (j < 10) do 7 | j = j + 1; 8 | done; 9 | i = i + 11 - j; 10 | done; 11 | end 12 | -------------------------------------------------------------------------------- /core/examples/WideningPaper/nested3.R: -------------------------------------------------------------------------------- 1 | # This example is a simple nested loop. It has been devised to show 2 | # benefits of the strategy of narrowing with restart. It is the only one that 3 | # can prove that 1 <= i <= 10 inside the inner loop. 4 | 5 | nested3 = function() { 6 | i = 0 7 | while (TRUE) { 8 | i = i + 1 9 | j = 0 10 | while (j < 10) 11 | j = j + 1 12 | if (i > 9) i = 0 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /core/examples/WideningPaper/nested3.c: -------------------------------------------------------------------------------- 1 | # Nested 3 in C for use with PAGAI. PAGAI is able to prove that 1 <= i <= 10 in 2 | # the inner loop when using techinque standard with new narrowing. 3 | 4 | int main() { 5 | int i = 0; 6 | while (1) { 7 | i = i+1; 8 | int j = 0; 9 | while (j < 10) 10 | j = j+1; 11 | if (i > 9) i=0; 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /core/examples/WideningPaper/nested3.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics.Contracts; 3 | 4 | [ContractVerification(true)] 5 | public class Program 6 | { 7 | public static int Puzzle() { 8 | int i,j; 9 | i=0; 10 | j=0; 11 | while (true){ 12 | i=i+1; 13 | j=0; 14 | while (j<10) { 15 | Contract.Assert(i <= 10); 16 | j = j + 1; 17 | } 18 | if (i>9) i=0; 19 | } 20 | return i; 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /core/examples/WideningPaper/nested3.interproc: -------------------------------------------------------------------------------- 1 | var i:int, j:int; 2 | begin 3 | i = 0; 4 | while (true) do 5 | i = i + 1; 6 | j = 0; 7 | while (j < 10) do 8 | j = j + 1; 9 | done; 10 | if (i > 9) then 11 | i = 0; 12 | endif; 13 | done; 14 | end 15 | -------------------------------------------------------------------------------- /core/src/main/apron/it/unich/jandom/domains/numerical/apron/ApronDomain.scala: -------------------------------------------------------------------------------- 1 | package it.unich.jandom.domains.numerical.apron 2 | import it.unich.jandom.domains.WideningDescription 3 | import it.unich.jandom.domains.numerical.NumericalDomain 4 | import it.unich.jandom.domains.numerical.BoxGenericDomain 5 | import it.unich.jandom.domains.numerical.BoxRationalDomain 6 | import it.unich.jandom.utils.numberext.RationalExt 7 | import apron._ 8 | 9 | class ApronDomain[A <: Manager, N <: ApronNumericalDomainAdapter[A]](val manager : A, val boxDomain : BoxGenericDomain[RationalExt], val apronnum : N) extends NumericalDomain { 10 | 11 | type Property = ApronProperty[A, N] 12 | 13 | def top(n: Int): Property = new ApronProperty(this, apronnum.top(n))(apronnum) 14 | def bottom(n: Int): Property = new ApronProperty(this, apronnum.bottom(n))(apronnum) 15 | 16 | val widenings = Seq(WideningDescription.default[Property]) 17 | } 18 | 19 | object ApronIntOctagonDomain { 20 | val octman : Octagon = new Octagon() 21 | val boxDomain = BoxRationalDomain() 22 | val apronint : ApronIntAdapter[Octagon] = new ApronIntAdapter(octman) 23 | def apply() = new ApronDomain[Octagon, ApronIntAdapter[Octagon]](octman, boxDomain, apronint) 24 | } 25 | 26 | 27 | object ApronRealOctagonDomain { 28 | val octman : Octagon = new Octagon() 29 | val boxDomain = BoxRationalDomain() 30 | val apronreal : ApronRealAdapter[Octagon] = new ApronRealAdapter(octman) 31 | def apply() = new ApronDomain[Octagon, ApronRealAdapter[Octagon]](octman, boxDomain, apronreal) 32 | } 33 | -------------------------------------------------------------------------------- /core/src/main/apron/it/unich/jandom/ui/ApronUIInitializer.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013, 2016 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty ofa 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.ui 20 | 21 | import it.unich.jandom.domains.numerical.apron.ApronIntOctagonDomain 22 | 23 | private[ui] object ApronUIInitializer { 24 | NumericalDomains.values ++= Seq( 25 | ParameterValue(ApronIntOctagonDomain(), "Apron Octagon Domain", "foo") 26 | ) 27 | } 28 | -------------------------------------------------------------------------------- /core/src/main/java/soot/jandom/MyFastHierarchy.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of a 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package soot.jandom; 20 | 21 | import java.util.Set; 22 | 23 | import soot.*; 24 | 25 | /** 26 | * Class FastHierarchy in Soot do not expose interfaceToSubinterfaces. This is just 27 | * an extension which exposes this internal map. 28 | */ 29 | public class MyFastHierarchy extends FastHierarchy { 30 | 31 | /** 32 | * For an interface parent (MUST be an interface), returns set of direct subinterfaces. 33 | */ 34 | public Set getSubinterfaces(SootClass parent) { 35 | return interfaceToSubinterfaces.get(parent); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/benchmark/FASTLoader.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015, 2016, 2017 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of a 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.benchmark 20 | 21 | import java.nio.file._ 22 | 23 | import it.unich.jandom.parsers.FastParser 24 | import it.unich.jandom.targets.lts.LTS 25 | 26 | import it.unich.jandom.utils.ResourceWalker 27 | 28 | /** 29 | * This trait loads and parser all models in /fast/ resource directory. 30 | * 31 | * @author Gianluca Amato 32 | */ 33 | trait FASTLoader { 34 | 35 | private val resources = ResourceWalker.list("/fast") 36 | 37 | /** 38 | * A sequence of Alice models. 39 | */ 40 | val ltss: Seq[LTS] = for (r <- resources) yield { 41 | val stream = Files.newBufferedReader(r) 42 | FastParser(postfix = r.getFileName.toString).parse(stream).get 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/benchmark/SLILLoader.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015, 2016, 2017 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of a 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.benchmark 20 | 21 | import java.nio.file._ 22 | 23 | import it.unich.jandom.parsers.RandomParser 24 | import it.unich.jandom.targets.slil.SLILProgram 25 | import it.unich.jandom.utils.ResourceWalker 26 | 27 | /** 28 | * This trait loads and parser all programs in the /random resource directory. 29 | * 30 | * @author Gianluca Amato 31 | */ 32 | trait SLILLoader { 33 | 34 | private val resources = ResourceWalker.list("/random") 35 | 36 | /** 37 | * A sequence of SLIL program with corresponding file name. 38 | */ 39 | val slils: Seq[(String, SLILProgram)] = for (r <- resources) yield { 40 | val stream = Files.newBufferedReader(r) 41 | (r.getFileName.toString, RandomParser().parse(stream).get) 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/domains/CartesianFiberedDomain.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of a 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.domains 20 | 21 | /** 22 | * This is the trait for a cartesian fibered domain. The fibers of this domain are 23 | * identified by finite sequence of elements. 24 | * @author Gianluca Amato 25 | */ 26 | trait CartesianFiberedDomain extends AbstractDomain { 27 | /** 28 | * The type of components of a fiber identifier. 29 | */ 30 | type FiberComponent 31 | 32 | type Fiber = Seq[FiberComponent] 33 | 34 | type Property <: CartesianFiberedProperty[FiberComponent, Property] 35 | 36 | /** 37 | * Returns the top element of the given fiber. 38 | */ 39 | def top(f: Fiber): Property 40 | 41 | /** 42 | * Returns the bottom element of the given fiber. 43 | */ 44 | def bottom(f: Fiber): Property 45 | } 46 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/domains/numerical/BoxGenericDomain.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013, 2016 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of a 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.domains.numerical 20 | 21 | trait BoxGenericDomain[A]/*[DOM <: BoxGenericDomain[DOM]]*/ extends NumericalDomain { 22 | type Property <: NumericalProperty[Property] { 23 | def high: Array[A] 24 | def low: Array[A] 25 | def linearInequality(lf: LinearForm): Property 26 | def linearAssignment(n: Int, lf: LinearForm): Property 27 | def linearEvaluation(lf: LinearForm): (A, A) 28 | } 29 | 30 | def makeBox(low: Array[A], high: Array[A], isEmpty: Boolean): Property 31 | } 32 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/domains/numerical/NumericalDomain.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty ofa 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.domains.numerical 20 | 21 | import it.unich.jandom.domains.DimensionFiberedDomain 22 | 23 | /** 24 | * Base class for numerical domains. The fiber of dimension `n` of a numerical domain 25 | * is an abstraction of the powerset of R^n. Numerical properties are instances of 26 | * [[it.unich.jandom.domains.NumericalProperty]]. 27 | * @author Gianluca Amato 28 | */ 29 | abstract class NumericalDomain extends DimensionFiberedDomain { 30 | /** 31 | * @inheritdoc 32 | * For numerical domains, properties needs to be instances of [[it.unich.jandom.domains.NumericalProperty]]. 33 | */ 34 | type Property <: NumericalProperty[Property] 35 | } 36 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/domains/numerical/OctagonDomain.scala: -------------------------------------------------------------------------------- 1 | package it.unich.jandom.domains.numerical 2 | import it.unich.jandom.domains.WideningDescription 3 | import it.unich.jandom.utils.dbm._ 4 | import it.unich.jandom.domains.numerical.octagon._ 5 | import it.unich.jandom.domains.numerical.octagon.optimized._ 6 | import it.unich.jandom.utils.numberext.RationalExt 7 | import scala.reflect.ClassTag 8 | 9 | trait OctagonDomainTrait[O <: Octagon[RationalExt, O]] extends NumericalDomain { 10 | def makeTop(dim : Int): O 11 | def makeBottom(dim: Int): O 12 | } 13 | 14 | abstract class OctagonDomain[O <: Octagon[RationalExt, O]] extends OctagonDomainTrait[O] { 15 | implicit val ifield = RationalExt 16 | 17 | val mod = new OctagonPropertyModule[O, OctagonDomain[O]](this) 18 | 19 | type Property = mod.OctagonProperty 20 | implicit val tag = implicitly[ClassTag[RationalExt]] 21 | implicit val factory = new ArrayDBMFactory()(tag, ifield) 22 | implicit val closure = new IncrementalMineFloydWarshall[RationalExt]()(ifield, factory) 23 | val box = BoxRationalDomain() 24 | def top(dim : Int) : Property = mod.OctagonProperty(this.makeTop(dim)) 25 | def bottom(dim : Int): Property = mod.OctagonProperty(this.makeBottom(dim)) 26 | val widenings = Seq(WideningDescription.default[Property]) 27 | 28 | def fromBox(b : BoxRationalDomain#Property) : mod.OctagonProperty = mod.fromBox(b) 29 | 30 | } 31 | 32 | object OctagonDomain { 33 | def apply() = new OctagonDomain[OptimizedOctagon[RationalExt]] { 34 | def makeTop(dim : Int) = new CachingOctagon(Right(factory.top((OctagonDim(dim).toDBMDim)))) 35 | def makeBottom(dim: Int) = new BottomOptOcta(OctagonDim(dim)) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/domains/numerical/SumGenericDomain.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014 Gianluca Amato, Francesca Scozzari, Simone Di Nardo Di Maio 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty ofa 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.domains.numerical 20 | 21 | /** 22 | * This is the class which implements the sum of two generic numerical domains, 23 | * without any particular herustics. 24 | * @author Gianluca Amato 25 | * @author Francesca Scozzari 26 | * @author Simone Di Nardo Di Maio 27 | */ 28 | 29 | class SumGenericDomain[D1 <: NumericalDomain, D2 <: NumericalDomain](val dom1: D1, val dom2: D2) extends SumDomain[D1,D2] { 30 | type Property = SumGeneric 31 | 32 | class SumGeneric(val p1: dom1.Property, val p2: dom2.Property) extends Sum 33 | 34 | def apply(p1: dom1.Property, p2: dom2.Property) = new SumGeneric(p1, p2) 35 | } 36 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/domains/objects/ObjectDomainFactory.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of a 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.domains.objects 20 | 21 | import it.unich.jandom.objectmodels.ObjectModel 22 | 23 | /** 24 | * A factory for object domains, i.e. domains which takes an object model as an input. 25 | * @author Gianluca Amato 26 | */ 27 | trait ObjectDomainFactory { 28 | /** 29 | * Returns an abstract domain given an object model. 30 | * @tparam OM is the particular subclass of ObjectModel we want to provide. It is 31 | * generally `om.type`. 32 | */ 33 | def apply[OM <: ObjectModel](om: OM): ObjectDomain[OM] 34 | } 35 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/domains/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty ofa 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom 20 | 21 | /** 22 | * This package contains all the abstract domains available in ''Jandom''. There are 23 | * two parallel hierarchies: properties and domains. A property is a single abstract 24 | * object, such as a polyhedron or a box. A domain is essentially a factory for abstract 25 | * objects. 26 | * @author Gianluca Amato 27 | */ 28 | 29 | package object domains { 30 | } 31 | 32 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/objectmodels/NoArrays.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of a 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.objectmodels 20 | 21 | /** 22 | * This is an helper trait for object models without arrays. 23 | * @author Gianluca Amato 24 | */ 25 | trait NoArrays { 26 | this: ObjectModel => 27 | def isArray(t: Type) = false 28 | def elementType(t: Type) = None 29 | } 30 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/objectmodels/TreeObjectModel.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of a 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.objectmodels 20 | 21 | /** 22 | * A TreeObjectModel is an object model where the subtype relationships 23 | * forms a forest instead of a graph. 24 | * @author Gianluca Amato 25 | */ 26 | 27 | trait TreeObjectModel extends ObjectModel { 28 | 29 | /** 30 | * It determines the glb's of two types. It is only present at this point of the hierarchy because 31 | * it is easy to compute it from the ordering relation for tree hierarchies, not as much for 32 | * general hierarchies. 33 | */ 34 | def glb(t1: Type, t2: Type) = { 35 | if (lteq(t1, t2)) 36 | Option(t1) 37 | else if (lteq(t2, t1)) 38 | Option(t2) 39 | else None 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/targets/MockTarget.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty ofa 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.targets 20 | 21 | /** 22 | * A mock target only used for test suites. It is private for the jandom package. 23 | * @author Gianluca Amato 24 | * 25 | */ 26 | private[jandom] class MockTarget extends Target[MockTarget] { 27 | type ProgramPoint = Int 28 | 29 | def analyze(params: Parameters): Annotation[ProgramPoint,params.Property] = getAnnotation[params.Property] 30 | val lastPP = None 31 | } 32 | 33 | /** 34 | * The companion object for the MockTarget. 35 | * @author Gianluca Amato 36 | */ 37 | private[jandom] object MockTarget { 38 | /** 39 | * Creates a mock target. 40 | */ 41 | def apply() = new MockTarget() 42 | } 43 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/targets/jvmasm/UnsupportedASMInsnException.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty ofa 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.targets.jvmasm 20 | 21 | import org.objectweb.asm.tree._ 22 | 23 | /** 24 | * This exception is generated by the ASM analyzer when an unknown opcode is 25 | * encountered. 26 | * @param node the ASM instruction which has generated the fault 27 | * @author Gianluca Amato 28 | * 29 | */ 30 | case class UnsupportedASMInsnException(val node: AbstractInsnNode) extends Exception("Unsupported ASM instruction exception "+node) 31 | 32 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/targets/jvmsoot/UnsupportedSootUnitException.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty ofa 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.targets.jvmsoot 20 | 21 | /** 22 | * This exception is generated by the Soot analyzers when an unknown unit is 23 | * encountered. 24 | * @param node the instruction which has generated the fault 25 | * @author Gianluca Amato 26 | * 27 | */ 28 | case class UnsupportedSootUnitException(val unit: soot.Unit) extends Exception("Unsupported Soot unit exception "+unit) 29 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/targets/jvmsoot/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty ofa 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.targets 20 | 21 | /** 22 | * This package contains all classes related to analysis of Java through the 23 | * Soot framework. 24 | * @author Gianluca Amato 25 | * 26 | */ 27 | package object jvmsoot { 28 | 29 | } -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/targets/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2022 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of a 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom 20 | 21 | import scala.collection.mutable 22 | 23 | package object targets { 24 | 25 | /** 26 | * This is the base trait for all annotations, which are mutable maps 27 | * from program points to values. 28 | * @author Gianluca Amato 29 | * 30 | */ 31 | type Annotation[ProgramPoint,T] = mutable.Map[ProgramPoint, T] 32 | 33 | } 34 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/targets/parameters/IterationStrategy.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014, 2016 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of a 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.targets.parameters 20 | 21 | /** 22 | * This parameter specifies which kind of iterations strategy to use for the analysis: 23 | * - Kleene: compute all state transformers at the same time (Kleene non-chaotic iteration) 24 | * - WorkList: simple worklist-based iteration strategy 25 | * At the moment, this is only supported by the LTS target. 26 | */ 27 | object IterationStrategy extends Enumeration { 28 | type IterationStrategy = Value 29 | 30 | val Kleene = Value 31 | val Worklist = Value 32 | } 33 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/targets/parameters/WideningNarrowingLocation.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014, 2016 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of a 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.targets.parameters 20 | 21 | /** 22 | * This objects determines the possible locations of widening and narrowing: 23 | * - None: put widening/narrowing points nowhere. 24 | * - All: put widening/narrowing points everywhere. 25 | * - Loop: put widening/narrowing points at each program point. 26 | * At the moment, this is only supported by the SLIL target. 27 | */ 28 | object WideningNarrowingLocation extends Enumeration { 29 | type WideningLocation = Value 30 | 31 | val None = Value 32 | val All = Value 33 | val Loop = Value 34 | } 35 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/targets/parameters/WideningScope.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013, 2016 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of a 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.targets.parameters 20 | 21 | /** 22 | * This objects determines the scope for widenings. The available alternatives are: 23 | * - Output: standard application of widening at the exit of join nodes 24 | * - BackEdges: widening is applied at the entrance of join nodes, but only on back edges 25 | * - Random: localized widening as described in the paper submitted to SAS 2013. 26 | * At the moment, this is only supported by the SLIL target. 27 | */ 28 | 29 | object WideningScope extends Enumeration { 30 | type WideningScope = Value 31 | val Output = Value 32 | val BackEdges = Value 33 | val Random = Value 34 | } 35 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/targets/slil/AnalysisPhase.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013, 2018 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of a 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.targets.slil 20 | 21 | /** 22 | * Enumeration for analysis phases. These are: 23 | * - Ascending: we are computing an ascending chain 24 | * - Descending: we are computing a descending chain 25 | * - AscendingRestart: we are computing an ascending chain, resetting all 26 | * widening points when we encounter them 27 | */ 28 | object AnalysisPhase extends Enumeration { 29 | type AnalysisPhase = Value 30 | val Ascending, Descending, AscendingRestart = Value 31 | } 32 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/targets/slil/SLILTarget.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013, 2018 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of a 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.targets.slil 20 | 21 | import it.unich.jandom.domains.numerical.NumericalDomain 22 | import it.unich.jandom.targets.Target 23 | 24 | /** 25 | * The abstract target class for SLIL. Each class in the slil package 26 | * which is a target should extend `SLILTarget`. 27 | * 28 | * @author Gianluca Amato 29 | */ 30 | 31 | abstract class SLILTarget extends Target[SLILTarget] { 32 | /** 33 | * @inheritdoc 34 | * A program point for SLIL is a pair composed of a statement and a label. For 35 | * example, if `stmt` is a while statement, then `(stmt,head)` is the invariant of 36 | * the while. 37 | */ 38 | type ProgramPoint = (SLILTarget, Any) 39 | type Tgt = SLILTarget 40 | type DomainBase = NumericalDomain 41 | } 42 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/ui/Parameter.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty ofa 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.ui 20 | 21 | /** 22 | * Every parameter which may be used in the analyzer should mix the 23 | * trait Parameter. 24 | * @tparam V the type of the parameter 25 | */ 26 | 27 | trait Parameter[V] { 28 | /** 29 | * The name of the parameter, to appear in the UI 30 | */ 31 | val name: String 32 | 33 | /** 34 | * A description of the parameter to be used, for example, in tooltips 35 | */ 36 | val description: String 37 | 38 | /** 39 | * The default value for this parameter 40 | */ 41 | val default: V 42 | } 43 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/ui/ParameterEnumeration.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013, 2016 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of a 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.ui 20 | 21 | /** 22 | * This is the trait for enumerative parameters, which only admits a 23 | * value in a given finite list. 24 | */ 25 | trait ParameterEnumeration[V] extends Parameter[ParameterValue[V]] { 26 | /** 27 | * The list of commented values 28 | */ 29 | val values: collection.Seq[ParameterValue[V]] 30 | } 31 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/ui/WideningScopes.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013, 2016 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of a 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.ui 20 | 21 | import it.unich.jandom.targets.parameters.WideningScope._ 22 | 23 | /** 24 | * The ParameterEnumeration for WideningScope. 25 | */ 26 | object WideningScopes extends ParameterEnumeration[Value] { 27 | val name = "Widening Scope" 28 | val description = "The Widening scope" 29 | val values = Seq( 30 | ParameterValue(Output, "Output", "The standard widening, which is applied to the output edge"), 31 | ParameterValue(BackEdges, "Back Edges", "The widening is applied at the input back edges"), 32 | ParameterValue(Random, "Localized", "The widening is applied like in Random (a variant of Back Edge)") 33 | ) 34 | val default = values(2) 35 | } 36 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/ui/cli/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty ofa 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.ui 20 | 21 | /** 22 | * A package for GUI related stuff 23 | */ 24 | package object cli { 25 | 26 | } -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/ui/gui/JandomGUI.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty ofa 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.ui.gui 20 | 21 | import scala.swing.SimpleSwingApplication 22 | import javax.swing.UIManager 23 | 24 | /** 25 | * The main GUI of Jandom. 26 | */ 27 | object JandomGUI extends SimpleSwingApplication { 28 | UIManager.put("FileChooser.readOnly", true); 29 | 30 | def top = new MainFrame() 31 | } 32 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/ui/gui/OutputPane.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty ofa 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.ui.gui 20 | 21 | import scala.swing._ 22 | 23 | class OutputPane extends EditorPane { 24 | val clear = new Action("Clear Output") { 25 | def apply() = { OutputPane.this.text = "" } 26 | } 27 | } -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/ui/gui/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty ofa 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.ui 20 | 21 | /** 22 | * A package for GUI related stuff 23 | */ 24 | package object gui { 25 | 26 | } -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/ui/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty ofa 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom 20 | 21 | /** 22 | * The base package for the Jandom user interfaces. In particular, 23 | * this packages contains the definition of all the parameters which may be 24 | * specified during the analysis. 25 | */ 26 | package object ui { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/utils/numberext/IField.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2018 Filippo Sestini, Tobia Tesan 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty ofa 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.utils.numberext 20 | 21 | trait IField[N] { 22 | def +(that : N) : N 23 | def -(that : N) : N 24 | def min(that : N) : N 25 | def max(that : N) : N 26 | def isPosInfinity : Boolean 27 | def isNegInfinity : Boolean 28 | def compare(that: N) : Int 29 | def >(that: N) : Boolean 30 | def >=(that: N) : Boolean 31 | def <(that: N): Boolean 32 | def <=(that: N): Boolean 33 | // def !=(that: N): Boolean 34 | def /(that: N): N 35 | def unary_- : N 36 | def _x_2 : N 37 | def _div_2 : N 38 | } 39 | 40 | trait StaticIField[F <: IField[F]] { 41 | def zero : F 42 | def PositiveInfinity : F 43 | def NegativeInfinity : F 44 | } 45 | -------------------------------------------------------------------------------- /core/src/main/scala/it/unich/jandom/utils/numberext/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty ofa 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.utils 20 | 21 | /** 22 | * This is the package for numeric extensions. It is an implementation of 23 | * numbers with infinities entirely in Scala and transparent to the user. 24 | * @author Gianluca Amato 25 | */ 26 | package object numberext { 27 | 28 | } -------------------------------------------------------------------------------- /core/src/test/resources/fast/ackerman.fst: -------------------------------------------------------------------------------- 1 | //! @citations BenAmramL07 2 | //! @tags complexity 3 | 4 | model ack { 5 | var m, n; 6 | states start, a,b, cont1,stop3,stop1,stop2; 7 | 8 | transition t0 := { 9 | from := start; 10 | to := stop1; 11 | guard := m <= 0; 12 | action := ; 13 | }; 14 | 15 | transition t0bis := { 16 | from := start; 17 | to := cont1; 18 | guard := m >0; 19 | action := ; 20 | }; 21 | 22 | transition t1 := { 23 | from := cont1; 24 | to := stop2; 25 | guard := n <= 0; 26 | action := m' = m-1, n' = 1; 27 | }; 28 | 29 | transition t2 := { 30 | from := cont1; 31 | to := a; 32 | guard := n>0; 33 | action := n' = n-1; 34 | }; 35 | 36 | transition t3 := { 37 | from := a; 38 | to := b; 39 | guard := true; 40 | action := m' = m-1, n' = ?; 41 | }; 42 | 43 | transition t4 := { 44 | from := b; 45 | to := start; 46 | guard := n >= 0; 47 | action := ; 48 | }; 49 | 50 | transition t4bis := { 51 | from := b; 52 | to := stop3; 53 | guard := n < 0; 54 | action := ; 55 | }; 56 | 57 | } 58 | 59 | strategy dumb { 60 | Region init := {state = start && n>=0 && m >= 0}; 61 | 62 | } 63 | 64 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/as-hh.fst: -------------------------------------------------------------------------------- 1 | // Example 'h' in the paper "G. Amato, F. Scozzari. Localizing widening and narrowing. SAS 2013", 2 | // first appeared in "N. Halbwachs and J. Henry. When the decreasing sequence fail. SAS 2012". 3 | // This example show the improvement it is possible to obtain through the use of localized 4 | // widening (it requires a relational domain). 5 | 6 | model amato_scozzari_sas13_hh { 7 | 8 | var i, j; 9 | states s1, s2, s3; 10 | 11 | transition t1 := { 12 | from := s1; 13 | to := s2; 14 | guard := i < 4; 15 | action := j' = 0; 16 | }; 17 | 18 | transition t2 := { 19 | from := s2; 20 | to := s2; 21 | guard := j < 4; 22 | action := i' = i + 1, j' = j + 1; 23 | }; 24 | 25 | transition t3 := { 26 | from := s2; 27 | to := s1; 28 | guard := j >= 4; 29 | action := i' = i - j + 1; 30 | }; 31 | } 32 | 33 | strategy s { 34 | Region init := { state = s1 && i = 0 }; 35 | } 36 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/as-hybrid.fst: -------------------------------------------------------------------------------- 1 | // Example 'hybrid' in the paper "G. Amato, F. Scozzari. Localizing widening and narrowing. SAS 2013" 2 | // This example show the improvement it is possible to obtain through the use of localized narrowing 3 | // with restart policy. 4 | 5 | model amato_scozzari_sas13_hybrid { 6 | 7 | var i, j; 8 | states s1, s2, s3; 9 | 10 | transition t1 := { 11 | from := s1; 12 | to := s2; 13 | guard := true; 14 | action := j' = 0, i' = i + 1; 15 | }; 16 | 17 | transition t2 := { 18 | from := s2; 19 | to := s2; 20 | guard := j < 10; 21 | action := j' = j + 1; 22 | }; 23 | 24 | transition t3 := { 25 | from := s2; 26 | to := s1; 27 | guard := j >= 10 && i > 9; 28 | action := i'=0; 29 | }; 30 | 31 | transition t4 := { 32 | from := s2; 33 | to := s1; 34 | guard := j >= 10 && i <= 9; 35 | action := ; 36 | }; 37 | } 38 | 39 | strategy s { 40 | Region init := { state = s1 && i = 0 }; 41 | } 42 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/as-nested.fst: -------------------------------------------------------------------------------- 1 | // Example 'nested' in the paper "G. Amato, F. Scozzari. Localizing widening and narrowing. SAS 2013" 2 | // This example show the improvement it is possible to obtain through the use of 3 | // localized widening. 4 | 5 | model amato_scozzari_sas13_nested { 6 | 7 | var i, j; 8 | states s1, s2; 9 | 10 | transition t1 := { 11 | from := s1; 12 | to := s2; 13 | guard := i < 10; 14 | action := j' = 0; 15 | }; 16 | 17 | transition t2 := { 18 | from := s2; 19 | to := s2; 20 | guard := j < 10; 21 | action := j' = j + 1; 22 | }; 23 | 24 | transition t3 := { 25 | from := s2; 26 | to := s1; 27 | guard := j >= 10; 28 | action := i' = i + 1; 29 | }; 30 | } 31 | 32 | strategy s { 33 | Region init := { state = s1 && i = 0 }; 34 | } 35 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/as-nested2.fst2: -------------------------------------------------------------------------------- 1 | // Example 'nested2' in the paper "G. Amato, F. Scozzari. Localizing widening and narrowing. SAS 2013" 2 | // This example show the improvement it is possible to obtain through the use of localized narrowing. 3 | 4 | model amato_scozzari_sas13_nested2 { 5 | 6 | var i, j; 7 | states s1, s2; 8 | 9 | transition t1 := { 10 | from := s1; 11 | to := s2; 12 | guard := true; 13 | action := j' = 0; 14 | }; 15 | 16 | transition t2 := { 17 | from := s2; 18 | to := s2; 19 | guard := j < 10; 20 | action := j' = j + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := s2; 25 | to := s1; 26 | guard := j >= 10; 27 | action := i' = i+11-j; 28 | }; 29 | } 30 | 31 | strategy s { 32 | Region init := { state = s1 && i = 0 }; 33 | } 34 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/ax.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations AliasDFG10 3 | 4 | //Generated by c2fsm -cut -nodiv -int 5 | model ax { 6 | var i,j,n; 7 | //parameters n; 8 | states stop,start,lbl_7_1,cut; 9 | transition t_24 :={ 10 | from := start; 11 | to := lbl_7_1; 12 | guard := (2 <= n); 13 | action:= i' = 0, j' = 1; 14 | }; 15 | transition t_26 :={ 16 | from := start; 17 | to := stop; 18 | guard := (n <= 1); 19 | action:= i' = 1, j' = 0; 20 | }; 21 | transition t_18 :={ 22 | from := lbl_7_1; 23 | to := lbl_7_1; 24 | guard := (j+2 <= n); 25 | action:= j' = j+1; 26 | }; 27 | transition t_19 :={ 28 | from := lbl_7_1; 29 | to := cut; 30 | guard := ( (i+3 <= n) && (n <= j+1) ); 31 | action:= i' = i+1; 32 | }; 33 | transition t_20 :={ 34 | from := lbl_7_1; 35 | to := stop; 36 | guard := ( (n <= i+2) && (n <= j+1) ); 37 | action:= i' = i+1; 38 | }; 39 | transition t_21 :={ 40 | from := cut; 41 | to := lbl_7_1; 42 | guard := (2 <= n); 43 | action:= j' = 1; 44 | }; 45 | transition t_22 :={ 46 | from := cut; 47 | to := cut; 48 | guard := ( (i+3 <= n) && (n <= 1) ); 49 | action:= i' = i+1, j' = 0; 50 | }; 51 | transition t_23 :={ 52 | from := cut; 53 | to := stop; 54 | guard := ( (n <= i+2) && (n <= 1) ); 55 | action:= i' = i+1, j' = 0; 56 | }; 57 | } 58 | strategy dumb { 59 | Region init := { state = start }; 60 | } 61 | 62 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/bakery.fst: -------------------------------------------------------------------------------- 1 | //! @citations BultanGP97:f1:p3 2 | //! @tags fixpoint parallelism 3 | 4 | model bultan_gerber_pugh_cav97_03 { 5 | 6 | var a, b, pc1, pc2; 7 | states q; 8 | 9 | transition e_T1 := { 10 | from := q; 11 | to := q; 12 | guard := pc1 = 1; 13 | action := pc1' = 2, a' = b + 1; 14 | }; 15 | 16 | transition e_W1a := { 17 | from := q; 18 | to := q; 19 | guard := pc1 = 2 && a < b; 20 | action := pc1' = 3; 21 | }; 22 | 23 | transition e_W1b := { 24 | from := q; 25 | to := q; 26 | guard := pc1 = 2 && b = 0; 27 | action := pc1' = 3; 28 | }; 29 | 30 | transition e_C1 := { 31 | from := q; 32 | to := q; 33 | guard := pc1 = 3; 34 | action := pc1' = 1, a' = 0; 35 | }; 36 | 37 | transition e_T2 := { 38 | from := q; 39 | to := q; 40 | guard := pc2 = 1; 41 | action := pc2' = 2, b' = a + 2; 42 | }; 43 | 44 | transition e_W2a := { 45 | from := q; 46 | to := q; 47 | guard := pc2 = 2 && b < a; 48 | action := pc2' = 3; 49 | }; 50 | 51 | transition e_W2b := { 52 | from := q; 53 | to := q; 54 | guard := pc2 = 2 && a = 0; 55 | action := pc2' = 3; 56 | }; 57 | 58 | transition e_C2 := { 59 | from := q; 60 | to := q; 61 | guard := pc2 = 3; 62 | action := pc2' = 1, b' = 0; 63 | }; 64 | 65 | } 66 | 67 | strategy s { 68 | 69 | Region init := {state = q && a = 0 && b = 0 && pc1 = 1 && pc2 = 1}; 70 | 71 | Region bad := {pc1 = 3 && pc2 = 3}; 72 | 73 | } 74 | 75 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/bardin.fst: -------------------------------------------------------------------------------- 1 | //! @citations Bardin_thesis:p41:f2.3 Gonnord_thesis:p42:f3.2 2 | //! @tags fixpoint 3 | 4 | model bardin_thesis_041 { 5 | 6 | var x, y; 7 | states q1, q2; 8 | 9 | transition t1 := { 10 | from := q1; 11 | to := q1; 12 | guard := x >= 0; 13 | action := x' = x + 2; 14 | }; 15 | 16 | transition t2 := { 17 | from := q2; 18 | to := q2; 19 | guard := true; 20 | action := x' = x + 1, y' = y + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := q1; 25 | to := q2; 26 | guard := x >= y; 27 | action := ; 28 | }; 29 | 30 | transition t4 := { 31 | from := q2; 32 | to := q1; 33 | guard := true; 34 | action := x' = x - y; 35 | }; 36 | 37 | } 38 | 39 | strategy s { 40 | 41 | Region init := {state = q1 && x >= 0}; 42 | 43 | Region bad := {state = q1 && x < 0}; 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/berkeley.fst: -------------------------------------------------------------------------------- 1 | //! @citations KatzEWPS85 2 | //! @tags parallelism 3 | 4 | model katz_eggers_wood_perkins_sheldon_isca85 { 5 | 6 | var e, ne, uo, i; 7 | states k; 8 | 9 | transition t1 := { 10 | from := k; 11 | to := k; 12 | guard := i >= 1; 13 | action := ne' = ne + e, uo' = uo + 1, i' = i - 1, e' = 0; 14 | }; 15 | 16 | transition t2 := { 17 | from := k; 18 | to := k; 19 | guard := ne + uo >= 1; 20 | action := i' = i + ne + uo - 1, e' = e + 1, ne' = 0, uo' = 0; 21 | }; 22 | 23 | transition t3 := { 24 | from := k; 25 | to := k; 26 | guard := i >= 1; 27 | action := i' = i + e + ne + uo - 1, e' = 1, ne' = 0, uo' = 0; 28 | }; 29 | 30 | } 31 | 32 | strategy s { 33 | 34 | Region init := {state = k && e = 0 && ne = 0 && uo = 0 && i >= 1}; 35 | 36 | Region bad := {e = 1 && ne = 1}; 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/car.fst: -------------------------------------------------------------------------------- 1 | //! @citations HalbwachsPR97:f5:p9 Halbwachs_thesis Gonnord_thesis:p53:f4.6 Halbwachs93:f1:p3 Merchat_thesis 2 | //! @tags fixpoint 3 | 4 | model gonnord_thesis_053 { 5 | 6 | var d, v, t; 7 | states P, P_stop, P_wall, P_toofast; 8 | 9 | transition t1 := { 10 | from := P; 11 | to := P; 12 | guard := t <= 2; 13 | action := v' = 0, t' = t + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := P; 18 | to := P; 19 | guard := v <= 1 && d <= 8; 20 | action := v' = v + 1, d' = d + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := P; 25 | to := P_stop; 26 | guard := t >= 3; 27 | action := ; 28 | }; 29 | 30 | transition t4 := { 31 | from := P; 32 | to := P_wall; 33 | guard := d >= 10; 34 | action := ; 35 | }; 36 | 37 | transition t5 := { 38 | from := P; 39 | to := P_toofast; 40 | guard := v >= 3; 41 | action := ; 42 | }; 43 | 44 | } 45 | 46 | strategy s { 47 | 48 | Region init := {state = P && d = 0 && v = 0 && t = 0}; 49 | 50 | Region bad := {state = P_wall}; 51 | 52 | } 53 | 54 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/car_simple.fst: -------------------------------------------------------------------------------- 1 | //! @citations HalbwachsPR97 Gonnord_thesis:p96:f7.5 2 | //! @tags fixpoint 3 | 4 | model gonnord_thesis_096a { 5 | 6 | var s, t, d; 7 | states q; 8 | 9 | transition t1 := { 10 | from := q; 11 | to := q; 12 | guard := s <= 3; 13 | action := d' = d + 1, s' = s + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := q; 18 | to := q; 19 | guard := true; 20 | action := s' = 0, t' = t + 1; 21 | }; 22 | 23 | } 24 | 25 | strategy s { 26 | 27 | Region init := {state = q && s = 0 && t = 0 && d = 0}; 28 | 29 | Region bad := {t < 0 || 0 > s || s > 4 || 0 > d || d > 4t + s}; 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/counters1.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations GulwaniMC09:f3:p6 3 | 4 | model gulwani_mehra_chilimbi_popl09_06a { 5 | 6 | var x, n, c; 7 | states q1, q2; 8 | 9 | transition t1 := { 10 | from := q1; 11 | to := q2; 12 | guard := x < n; 13 | action := ; 14 | }; 15 | 16 | transition t2 := { 17 | from := q2; 18 | to := q1; 19 | guard := true; 20 | action := x' = x + 1, c' = c + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := q2; 25 | to := q1; 26 | guard := true; 27 | action := x' = x + 1, c' = c + 1; 28 | }; 29 | 30 | } 31 | 32 | strategy s { 33 | 34 | Region init := {state = q1 && x = 0 && c = 0 && n >= 0}; 35 | 36 | Region bad := {c > n}; 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/counters2.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations GulwaniMC09:f3:p6 3 | 4 | model gulwani_mehra_chilimbi_popl09_06b { 5 | 6 | var x, n, c; 7 | states q1, q2; 8 | 9 | transition t1 := { 10 | from := q1; 11 | to := q1; 12 | guard := x < n; 13 | action := x' = x + 1, c' = c + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := q1; 18 | to := q2; 19 | guard := true; 20 | action := ; 21 | }; 22 | 23 | transition t3 := { 24 | from := q2; 25 | to := q2; 26 | guard := x < n; 27 | action := x' = x + 1, c' = c + 1; 28 | }; 29 | 30 | } 31 | 32 | strategy s { 33 | 34 | Region init := {state = q1 && x = 0 && c = 0 && n >= 0}; 35 | 36 | Region bad := {c > n}; 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/counters3.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations GulwaniMC09:f3:p6 3 | 4 | model gulwani_mehra_chilimbi_popl09_06c { 5 | 6 | var x, n, c; 7 | states q1, q2; 8 | 9 | transition t1 := { 10 | from := q1; 11 | to := q2; 12 | guard := x < n; 13 | action := ; 14 | }; 15 | 16 | transition t2 := { 17 | from := q2; 18 | to := q2; 19 | guard := x < n; 20 | action := x' = x + 1, c' = c + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := q2; 25 | to := q1; 26 | guard := true; 27 | action := ; 28 | }; 29 | 30 | } 31 | 32 | strategy s { 33 | 34 | Region init := {state = q1 && x = 0 && c = 0 && n >= 0}; 35 | 36 | Region bad := {c > n}; 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/counters4.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations GulwaniMC09:f3:p6 3 | 4 | model gulwani_mehra_chilimbi_popl09_06d { 5 | 6 | var x, y, n, m, c; 7 | states q; 8 | 9 | transition t1 := { 10 | from := q; 11 | to := q; 12 | guard := x < n; 13 | action := x' = x + 1, y' = y + 1, c' = c + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := q; 18 | to := q; 19 | guard := x >= n && y < m; 20 | action := x' = x + 1, y' = y + 1, c' = c + 1; 21 | }; 22 | 23 | } 24 | 25 | strategy s { 26 | 27 | Region init := {state = q && x = 0 && y = 0 && c = 0 && n >= 0 && m >= 0}; 28 | 29 | Region bad := {c > n && c > m}; 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/cousot9.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations Cousot05 3 | 4 | //Generated by c2fsm -cut -nodiv -int 5 | model main { 6 | var N,i,j; 7 | //parameters N; 8 | states stop,start,lbl_5_2,lbl_7_2; 9 | transition t_25 :={ 10 | from := start; 11 | to := stop; 12 | guard := (N <= 0); 13 | action:= i' = N; 14 | }; 15 | transition t_26 :={ 16 | from := start; 17 | to := lbl_5_2; 18 | guard := ( (1 <= N) && (1 <= j) ); 19 | action:= i' = N, j' = j-1; 20 | }; 21 | transition t_27 :={ 22 | from := start; 23 | to := lbl_7_2; 24 | guard := ( (1 <= N) && (j <= 0) ); 25 | action:= i' = N-1, j' = N; 26 | }; 27 | transition t_19 :={ 28 | from := lbl_5_2; 29 | to := stop; 30 | guard := (i <= 0); 31 | action:=; 32 | }; 33 | transition t_20 :={ 34 | from := lbl_5_2; 35 | to := lbl_5_2; 36 | guard := ( (1 <= i) && (1 <= j) ); 37 | action:= j' = j-1; 38 | }; 39 | transition t_21 :={ 40 | from := lbl_5_2; 41 | to := lbl_7_2; 42 | guard := ( (1 <= i) && (j <= 0) ); 43 | action:= i' = i-1, j' = N; 44 | }; 45 | transition t_22 :={ 46 | from := lbl_7_2; 47 | to := stop; 48 | guard := (i <= 0); 49 | action:=; 50 | }; 51 | transition t_23 :={ 52 | from := lbl_7_2; 53 | to := lbl_5_2; 54 | guard := ( (1 <= i) && (1 <= j) ); 55 | action:= j' = j-1; 56 | }; 57 | transition t_24 :={ 58 | from := lbl_7_2; 59 | to := lbl_7_2; 60 | guard := ( (1 <= i) && (j <= 0) ); 61 | action:= i' = i-1, j' = N; 62 | }; 63 | } 64 | strategy dumb { 65 | Region init := { state = start }; 66 | } 67 | 68 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/descending.fst: -------------------------------------------------------------------------------- 1 | // A model generating a very long descending chain 2 | // in the absence of narrowing. 3 | 4 | model narrowing { 5 | 6 | var n; 7 | 8 | states loop1, loop2; 9 | 10 | transition jump1 := { 11 | from := loop1; 12 | to := loop1; 13 | guard := n <= 10; 14 | action := n' = n+1; 15 | }; 16 | 17 | transition changeloop := { 18 | from := loop1; 19 | to := loop2; 20 | guard := n >= 11; 21 | action := ; 22 | }; 23 | 24 | transition jump2 := { 25 | from := loop2; 26 | to := loop2; 27 | guard := n <= 100; 28 | action := n' = n-1; 29 | }; 30 | } 31 | 32 | strategy s { 33 | Region init := { state = loop1 && n = 0 }; 34 | } 35 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/descending2.fst: -------------------------------------------------------------------------------- 1 | // A model generating an infinite descending chain 2 | // in the absence of narrowing. 3 | 4 | model narrowing { 5 | 6 | var n; 7 | 8 | states loop1, loop2; 9 | 10 | transition jump1 := { 11 | from := loop1; 12 | to := loop1; 13 | guard := n <= 10; 14 | action := n' = n+1; 15 | }; 16 | 17 | transition changeloop := { 18 | from := loop1; 19 | to := loop2; 20 | guard := n >= 12; 21 | action := ; 22 | }; 23 | 24 | transition jump2 := { 25 | from := loop2; 26 | to := loop2; 27 | guard := n <= 100; 28 | action := n' = n-1; 29 | }; 30 | } 31 | 32 | strategy s { 33 | Region init := { state = loop1 && n = 0 }; 34 | } 35 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/determinant.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations AliasDFG10 3 | 4 | model determinant{ 5 | 6 | var i, j, k, n; 7 | 8 | states start, 9 | a, d, b, c, halt; 10 | 11 | transition t0 :={ 12 | from := start; 13 | to := a; 14 | guard := n >= 1; 15 | action := ; 16 | }; 17 | 18 | transition t1 :={ 19 | from := a; 20 | to := d; 21 | guard := true; 22 | action := k' = 1; 23 | }; 24 | 25 | transition t2 :={ 26 | from := d; 27 | to := b; 28 | guard := k < n; 29 | action := i' = k+1; 30 | }; 31 | 32 | transition t3 :={ 33 | from := d; 34 | to := halt; 35 | guard := k >= n; 36 | action := i' = i; 37 | }; 38 | 39 | transition t4 :={ 40 | from := b; 41 | to := d; 42 | guard := i > n; 43 | action := k' = k+1; 44 | }; 45 | 46 | transition t5 :={ 47 | from := b; 48 | to := c; 49 | guard := i <= n; 50 | action := j' = n; 51 | }; 52 | 53 | transition t6 :={ 54 | from := c; 55 | to := c; 56 | guard := j > k; 57 | action := j' = j-1; 58 | }; 59 | 60 | transition t7 :={ 61 | from := c; 62 | to := b; 63 | guard := j <= k; 64 | action := i' = i+1; 65 | }; 66 | 67 | } 68 | 69 | strategy theStrat { 70 | Region init := {state = start}; 71 | } 72 | 73 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/disj.fst: -------------------------------------------------------------------------------- 1 | //! @citations BeyerHMR07:f4:p7 GulwaniZ10:f9:p12 2 | //! @tags fixpoint 3 | 4 | model beyer_henzinger_majumdar_rybalchenko_pldi07_07 { 5 | 6 | var x, y; 7 | states q1, q2, q3; 8 | 9 | transition t1 := { 10 | from := q1; 11 | to := q2; 12 | guard := x < 100; 13 | action := ; 14 | }; 15 | 16 | transition t2 := { 17 | from := q2; 18 | to := q1; 19 | guard := x < 50; 20 | action := x' = x + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := q2; 25 | to := q1; 26 | guard := x >= 50; 27 | action := x' = x + 1, y' = y + 1; 28 | }; 29 | 30 | transition t4 := { 31 | from := q1; 32 | to := q3; 33 | guard := x >= 100; 34 | action := ; 35 | }; 36 | 37 | } 38 | 39 | strategy s { 40 | 41 | Region init := {state = q1 && x = 0 && y = 50}; 42 | 43 | //Region bad := {state = q3 && y > 100}; 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/disjbnd1.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations GulwaniMC09:f2:p3 3 | 4 | model gulwani_mehra_chilimbi_popl09_03a { 5 | 6 | var x0, y0, x, y, n, m, c1, c2; 7 | states q1, q2; 8 | 9 | transition t1 := { 10 | from := q1; 11 | to := q2; 12 | guard := x < n; 13 | action := ; 14 | }; 15 | 16 | transition t2 := { 17 | from := q2; 18 | to := q1; 19 | guard := y < m; 20 | action := y' = y + 1, c1' = c1 + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := q2; 25 | to := q1; 26 | guard := y >= m; 27 | action := x' = x + 1, c2' = c2 + 1; 28 | }; 29 | 30 | } 31 | 32 | strategy s { 33 | 34 | Region init := {state = q1 && c1 = 0 && c2 = 0 && x = x0 && y = y0 && n >= x0 && m >= y0}; 35 | 36 | Region bad := {c1 + c2 > n - x0 + m - y0}; 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/disjbnd2.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations GulwaniMC09:f2:p3 3 | 4 | model cook_podelski_rybalchenko_pldi06_04 { 5 | 6 | var x0, z0, x, z, n, c1, c2; 7 | states q1, q2; 8 | 9 | transition t1 := { 10 | from := q1; 11 | to := q2; 12 | guard := x < n; 13 | action := ; 14 | }; 15 | 16 | transition t2 := { 17 | from := q2; 18 | to := q1; 19 | guard := z > x; 20 | action := x' = x + 1, c1' = c1 + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := q2; 25 | to := q1; 26 | guard := z <= x; 27 | action := z' = z + 1, c2' = c2 + 1; 28 | }; 29 | 30 | } 31 | 32 | strategy s { 33 | 34 | Region init := {state = q1 && x = x0 && z = z0 && c1 = 0 && c2 = 0 && n >= x0 && n >= z0}; 35 | 36 | Region bad := {c1 + c2 > 2n - x0 - z0}; 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/easy1.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations ChawdharyCGSY08 3 | 4 | //Generated by c2fsm -cut -nodiv -int 5 | model main { 6 | var x,y,z; 7 | //parameters z; 8 | states stop,start,lbl_9_1,lbl_11_1; 9 | transition t_22 :={ 10 | from := start; 11 | to := lbl_9_1; 12 | guard := (0 = z); 13 | action:= x' = 1, y' = 100; 14 | }; 15 | transition t_23 :={ 16 | from := start; 17 | to := lbl_11_1; 18 | guard := ( (z+1 <= 0) || (1 <= z) ); 19 | action:= x' = 2, y' = 100; 20 | }; 21 | transition t_15 :={ 22 | from := lbl_9_1; 23 | to := stop; 24 | guard := (40 <= x); 25 | action:=; 26 | }; 27 | transition t_16 :={ 28 | from := lbl_9_1; 29 | to := lbl_9_1; 30 | guard := ( (x <= 39) && (0 = z) ); 31 | action:= x' = x+1; 32 | }; 33 | transition t_17 :={ 34 | from := lbl_9_1; 35 | to := lbl_11_1; 36 | guard := ( ( (x <= 39) && (z+1 <= 0) ) || ( (x <= 39) && (1 <= z) ) ); 37 | action:= x' = x+2; 38 | }; 39 | transition t_18 :={ 40 | from := lbl_11_1; 41 | to := stop; 42 | guard := (40 <= x); 43 | action:=; 44 | }; 45 | transition t_19 :={ 46 | from := lbl_11_1; 47 | to := lbl_9_1; 48 | guard := ( (x <= 39) && (0 = z) ); 49 | action:= x' = x+1; 50 | }; 51 | transition t_20 :={ 52 | from := lbl_11_1; 53 | to := lbl_11_1; 54 | guard := ( ( (x <= 39) && (z+1 <= 0) ) || ( (x <= 39) && (1 <= z) ) ); 55 | action:= x' = x+2; 56 | }; 57 | } 58 | strategy dumb { 59 | Region init := { state = start }; 60 | } 61 | 62 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/easy2.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations ChawdharyCGSY08 3 | 4 | //Generated by c2fsm -cut -nodiv -int 5 | model main { 6 | var x,y,z; 7 | //parameters; 8 | states stop,start,lbl_7_1; 9 | transition t_13 :={ 10 | from := start; 11 | to := stop; 12 | guard := (z <= 0); 13 | action:=; 14 | }; 15 | transition t_14 :={ 16 | from := start; 17 | to := lbl_7_1; 18 | guard := (1 <= z); 19 | action:= x' = x+1, y' = y-1, z' = z-1; 20 | }; 21 | transition t_11 :={ 22 | from := lbl_7_1; 23 | to := stop; 24 | guard := (z <= 0); 25 | action:=; 26 | }; 27 | transition t_12 :={ 28 | from := lbl_7_1; 29 | to := lbl_7_1; 30 | guard := (1 <= z); 31 | action:= x' = x+1, y' = y-1, z' = z-1; 32 | }; 33 | } 34 | strategy dumb { 35 | Region init := { state = start }; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/exmini.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations AliasDFG10 3 | 4 | //Generated by c2fsm -cut -nodiv -int 5 | model main { 6 | var i,j,k,tmp; 7 | //parameters; 8 | states stop,start,lbl_7_1; 9 | transition t_16 :={ 10 | from := start; 11 | to := stop; 12 | guard := ( (101 <= i) || (k+1 <= j) ); 13 | action:=; 14 | }; 15 | transition t_17 :={ 16 | from := start; 17 | to := lbl_7_1; 18 | guard := ( (i <= 100) && (j <= k) ); 19 | action:= i' = j, j' = i+1, k' = k-1, tmp' = i; 20 | }; 21 | transition t_14 :={ 22 | from := lbl_7_1; 23 | to := stop; 24 | guard := ( (101 <= i) || (k+1 <= j) ); 25 | action:=; 26 | }; 27 | transition t_15 :={ 28 | from := lbl_7_1; 29 | to := lbl_7_1; 30 | guard := ( (i <= 100) && (j <= k) ); 31 | action:= i' = j, j' = i+1, k' = k-1, tmp' = i; 32 | }; 33 | } 34 | strategy dumb { 35 | Region init := { state = start }; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/forward.fst: -------------------------------------------------------------------------------- 1 | //! @citations BeyerHMR07:f1:p3 2 | //! @tags fixpoint 3 | 4 | model beyer_henzinger_majumdar_rybalchenko_pldi07_03 { 5 | 6 | var n, i, a, b; 7 | states q1, q2, q3, q4; 8 | 9 | transition t1 := { 10 | from := q1; 11 | to := q2; 12 | guard := i < n; 13 | action := ; 14 | }; 15 | 16 | transition t2 := { 17 | from := q2; 18 | to := q3; 19 | guard := true; 20 | action := a ' = a + 1, b' = b + 2; 21 | }; 22 | 23 | transition t3 := { 24 | from := q2; 25 | to := q3; 26 | guard := true; 27 | action := a ' = a + 2, b' = b + 1; 28 | }; 29 | 30 | transition t4 := { 31 | from := q3; 32 | to := q1; 33 | guard := true; 34 | action := i' = i + 1; 35 | }; 36 | 37 | transition t5 := { 38 | from := q1; 39 | to := q4; 40 | guard := i >= n; 41 | action := ; 42 | }; 43 | 44 | } 45 | 46 | strategy s { 47 | 48 | Region init := {state = q1 && n >= 0 && i = 0 && a = 0 && b = 0}; 49 | 50 | Region bad := {state = q4 && a + b != 3n}; 51 | 52 | } 53 | 54 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/gasburner.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Gonnord_thesis:f2.15:p34 3 | 4 | model gonnord_thesis_034 { 5 | 6 | var l, t, x; 7 | states L, N; 8 | 9 | transition t1 := { 10 | from := L; 11 | to := L; 12 | guard := x <= 9; 13 | action := x' = x + 1, t' = t + 1, l' = l + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := L; 18 | to := N; 19 | guard := true; 20 | action := x' = 0; 21 | }; 22 | 23 | transition t3 := { 24 | from := N; 25 | to := N; 26 | guard := true; 27 | action := x' = x + 1, t' = t + 1; 28 | }; 29 | 30 | transition t4 := { 31 | from := N; 32 | to := L; 33 | guard := x >= 50; 34 | action := x' = 0; 35 | }; 36 | 37 | } 38 | 39 | strategy s { 40 | 41 | Region init := {state = L && x = 0 && t = 0 && l = 0}; 42 | 43 | Region bad := {6l > t + 50}; 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/gasburner_alt.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Gonnord_thesis:f7.7:p99 3 | 4 | model gonnord_thesis_099 { 5 | 6 | var u, t, l, v; 7 | states q; 8 | 9 | transition t1 := { 10 | from := q; 11 | to := q; 12 | guard := u <= 59 && v <= 9; 13 | action := u' = u + 1, t' = t + 1, l' = l + 1, v' = v + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := q; 18 | to := q; 19 | guard := u <= 59; 20 | action := u' = u + 1, t' = t + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := q; 25 | to := q; 26 | guard := u = 60; 27 | action := u' = 0, v' = 0; 28 | }; 29 | 30 | } 31 | 32 | strategy s { 33 | 34 | Region init := {state = q && u = 0 && t = 0 && l = 0 && v = 0}; 35 | 36 | Region bad := {6l > t + 50}; 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/gonnord1.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Gonnord_thesis:f4.3:p50 3 | 4 | model gonnord_thesis_050 { 5 | 6 | var x, y; 7 | states p; 8 | 9 | transition t1 := { 10 | from := p; 11 | to := p; 12 | guard := x >= 0; 13 | action := x' = x + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := p; 18 | to := p; 19 | guard := x = 0; 20 | action := x' = x + 1, y' = y + 1; 21 | }; 22 | 23 | } 24 | 25 | strategy s { 26 | 27 | Region init := {state = p && x = 0 && y = 0}; 28 | 29 | Region bad := {x < 0 || y < 0 || y > x || y > 1}; 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/gonnord2.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Gonnord_thesis:f4.7:p55 3 | 4 | model gonnord_thesis_055 { 5 | 6 | var i, j, k; 7 | states k1, k2; 8 | 9 | transition t1 := { 10 | from := k1; 11 | to := k1; 12 | guard := i <= 100 && j < 9; 13 | action := i' = i + 2, k' = k + 1, j' = j + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := k1; 18 | to := k1; 19 | guard := i <= 100 && j < 9; 20 | action := i' = i + 2, j' = j + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := k1; 25 | to := k1; 26 | guard := i <= 100 && j = 9; 27 | action := i' = i + 2, k' = k + 2, j' = 0; 28 | }; 29 | 30 | transition t4 := { 31 | from := k1; 32 | to := k2; 33 | guard := i > 100; 34 | action := ; 35 | }; 36 | 37 | } 38 | 39 | strategy s { 40 | 41 | Region init := {state = k1 && i = 0 && j = 0 && k = 0}; 42 | 43 | Region bad := {i < 2j || 11i < 2j + 20k || i > 2j + 10k || j < 0}; 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/gonnord3.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Gonnord_thesis:f4.9:p57 3 | 4 | model gonnord_thesis_057 { 5 | 6 | var i, j; 7 | states q1, q2, q3; 8 | 9 | transition t1 := { 10 | from := q1; 11 | to := q2; 12 | guard := i <= 100; 13 | action := i' = i + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := q2; 18 | to := q1; 19 | guard := true; 20 | action := ; 21 | }; 22 | 23 | transition t3 := { 24 | from := q2; 25 | to := q2; 26 | guard := j <= 19; 27 | action := j' = i + j; 28 | }; 29 | 30 | transition t4 := { 31 | from := q1; 32 | to := q3; 33 | guard := i > 100; 34 | action := ; 35 | }; 36 | 37 | } 38 | 39 | strategy s { 40 | 41 | Region init := {state = q1 && i = 0 && j = -100}; 42 | 43 | Region bad := {state = q1 && (0 > i || 0 > j + 100 || i > j + 201)}; 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/gonnord4.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Gonnord_thesis:f7.3:p93 3 | 4 | model gonnord_thesis_093a { 5 | 6 | var x, z; 7 | states q; 8 | 9 | transition t1 := { 10 | from := q; 11 | to := q; 12 | guard := z <= 9; 13 | action := x' = x + 1, z' = z + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := q; 18 | to := q; 19 | guard := z = 10; 20 | action := z' = 0; 21 | }; 22 | 23 | } 24 | 25 | strategy s { 26 | 27 | Region init := {state = q && x = 0 && z = 0}; 28 | 29 | Region bad := {z > x || z > 10 || z < 0}; 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/gonnord5.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Gonnord_thesis:f7.4:p93 3 | 4 | model gonnord_thesis_93b { 5 | 6 | var x, z; 7 | states q; 8 | 9 | transition t1 := { 10 | from := q; 11 | to := q; 12 | guard := x >= 2z; 13 | action := x' = x + 1, z' = z + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := q; 18 | to := q; 19 | guard := true; 20 | action := z' = 0; 21 | }; 22 | 23 | } 24 | 25 | strategy s { 26 | 27 | Region init := {state = q && x = 0 && z = 0}; 28 | 29 | Region bad := {x < z || z < 0 || x < 2z - 1}; 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/gonnord6.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Gonnord_thesis:f7.6:p96 3 | 4 | model gonnord_thesis_096b { 5 | 6 | var x, y, z; 7 | states q; 8 | 9 | transition t1 := { 10 | from := q; 11 | to := q; 12 | guard := x >= 2z; 13 | action := x' = x + 1, y ' = y + 1, z' = z + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := q; 18 | to := q; 19 | guard := true; 20 | action := z' = 0; 21 | }; 22 | 23 | } 24 | 25 | strategy s { 26 | 27 | Region init := {state = q && x = 0 && y = 0 && z = 0}; 28 | 29 | Region bad := {x < 0 || y < 0 || z < 0 || z > x || x > y}; 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/gopan_reps.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations GopanR06:f1:p3 GopanR07:p4:f1 GulwaniJK09:f10b:p10 GulwaniZ10:f9:p12 3 | 4 | model gopan_cav06_03 { 5 | 6 | var x, y; 7 | states n1, n2, n3, n4, n5, n6, n_x; 8 | 9 | transition t1 := { 10 | from := n1; 11 | to := n2; 12 | guard := x <= 50; 13 | action := ; 14 | }; 15 | 16 | transition t2 := { 17 | from := n2; 18 | to := n4; 19 | guard := true; 20 | action := y' = y + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := n1; 25 | to := n3; 26 | guard := x >= 51; 27 | action := ; 28 | }; 29 | 30 | transition t4 := { 31 | from := n3; 32 | to := n4; 33 | guard := true; 34 | action := y' = y - 1; 35 | }; 36 | 37 | transition t5 := { 38 | from := n4; 39 | to := n_x; 40 | guard := y <= -1; 41 | action := ; 42 | }; 43 | 44 | transition t6 := { 45 | from := n4; 46 | to := n5; 47 | guard := y >= 0; 48 | action := ; 49 | }; 50 | 51 | transition t7 := { 52 | from := n5; 53 | to := n6; 54 | guard := true; 55 | action := x' = x + 1; 56 | }; 57 | 58 | transition t8 := { 59 | from := n6; 60 | to := n1; 61 | guard := true; 62 | action := ; 63 | }; 64 | 65 | } 66 | 67 | strategy s { 68 | 69 | Region init := {state = n1 && x = 0 && y = 0}; 70 | 71 | Region bad := {state = n1 && (y < 0 || y > x || y > -x + 102)}; 72 | 73 | } 74 | 75 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/gopan_reps_alt1.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations GopanR06:f3a:p5 GopanR07:f2:p5 3 | 4 | model gopan_cav06_05a { 5 | 6 | var x, y; 7 | states n1, n2, n4, n5, n6; 8 | 9 | transition t1 := { 10 | from := n1; 11 | to := n2; 12 | guard := x <= 50; 13 | action := ; 14 | }; 15 | 16 | transition t2 := { 17 | from := n2; 18 | to := n4; 19 | guard := true; 20 | action := y' = y + 1; 21 | }; 22 | 23 | transition t6 := { 24 | from := n4; 25 | to := n5; 26 | guard := y >= 0; 27 | action := ; 28 | }; 29 | 30 | transition t7 := { 31 | from := n5; 32 | to := n6; 33 | guard := true; 34 | action := x' = x + 1; 35 | }; 36 | 37 | } 38 | 39 | strategy s { 40 | 41 | Region init := {state = n1 && x = 0 && y = 0}; 42 | 43 | Region bad := {state = n1 && (x != y || x < 0 || x > 51)}; 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/gopan_reps_alt2.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations GopanR06:f3b:p5 GopanR07:f2:p5 3 | 4 | model gopan_cav06_05b { 5 | 6 | var x, y; 7 | states n1, n2, n3, n4, n5, n6, n_x; 8 | 9 | transition t1 := { 10 | from := n1; 11 | to := n2; 12 | guard := x <= 50; 13 | action := ; 14 | }; 15 | 16 | transition t2 := { 17 | from := n2; 18 | to := n4; 19 | guard := true; 20 | action := y' = y + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := n1; 25 | to := n3; 26 | guard := x >= 51; 27 | action := ; 28 | }; 29 | 30 | transition t4 := { 31 | from := n3; 32 | to := n4; 33 | guard := true; 34 | action := y' = y - 1; 35 | }; 36 | 37 | transition t6 := { 38 | from := n4; 39 | to := n5; 40 | guard := y >= 0; 41 | action := ; 42 | }; 43 | 44 | transition t7 := { 45 | from := n5; 46 | to := n6; 47 | guard := true; 48 | action := x' = x + 1; 49 | }; 50 | 51 | transition t8 := { 52 | from := n6; 53 | to := n1; 54 | guard := true; 55 | action := ; 56 | }; 57 | 58 | } 59 | 60 | strategy s { 61 | 62 | Region init := {state = n1 && x = 0 && y = 0}; 63 | 64 | Region bad := {state = n1 && (y < 0 || y > x || y > -x + 102)}; 65 | 66 | } 67 | 68 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/gulwani1.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations Gulwani09:f1a:p3 3 | 4 | model gulwani_cav09_03a { 5 | 6 | var x, y, i, m; 7 | states q; 8 | 9 | transition t1 := { 10 | from := q; 11 | to := q; 12 | guard := x < 100 && y < m; 13 | action := y' = y + 1, i' = i + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := q; 18 | to := q; 19 | guard := x < 100 && y >= m; 20 | action := x' = x + 1, i' = i + 1; 21 | }; 22 | 23 | } 24 | 25 | strategy s { 26 | 27 | Region init := {state = q && x = 0 && y = 0 && m >= 0 && i = 0}; 28 | 29 | Region bad := {i > 100 + m}; 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/gulwani1_alt.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations Gulwani09:f1b:p3 3 | 4 | model gulwani_cav09_03b { 5 | 6 | var x, y, i1, i2, m; 7 | states q; 8 | 9 | transition t1 := { 10 | from := q; 11 | to := q; 12 | guard := x < 100 && y < m; 13 | action := y' = y + 1, i1' = i1 + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := q; 18 | to := q; 19 | guard := x < 100 && y >= m; 20 | action := x' = x + 1, i2' = i2 + 1; 21 | }; 22 | 23 | } 24 | 25 | strategy s { 26 | 27 | Region init := {state = q && x = 0 && y = 0 && m >= 0 && i1 = 0 && i2 = 0}; 28 | 29 | Region bad := {i1 + i2 > 100 + m}; 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/gulwani2.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity nonlinear 2 | //! @citations Gulwani09:f2a:p4 3 | 4 | model gulwani_cav09_04a { 5 | 6 | var x, y, m, n, i; 7 | states q; 8 | 9 | transition t1 := { 10 | from := q; 11 | to := q; 12 | guard := x < n && y < m; 13 | action := y' = y + 1, i' = i + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := q; 18 | to := q; 19 | guard := x < n && y >= m; 20 | action := y' = 0, x' = x + 1, i' = i + 1; 21 | }; 22 | 23 | } 24 | 25 | strategy s { 26 | 27 | Region init := {state = q && x = 0 && y = 0 && m >= 0 && n >= 0 && i = 0}; 28 | 29 | Region bad := {i > n * (m + 1)}; 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/gulwani2_alt.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity nonlinear 2 | //! @citations Gulwani09:f2b:p4 3 | 4 | model gulwani_cav09_04b { 5 | 6 | var x, y, m, n, i1, i2; 7 | states q; 8 | 9 | transition t1 := { 10 | from := q; 11 | to := q; 12 | guard := x < n && y < m; 13 | action := y' = y + 1, i1' = i1 + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := q; 18 | to := q; 19 | guard := x < n && y >= m; 20 | action := y' = 0, x' = x + 1, i2' = i2 + 1; 21 | }; 22 | 23 | } 24 | 25 | strategy s { 26 | 27 | Region init := {state = q && x = 0 && y = 0 && m >= 0 && n >= 0 && i1 = 0 && i2 = 0}; 28 | 29 | Region bad := {i1 + i2 > n * (m + 1)}; 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/gulwani3.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations Gulwani09:f3:p6 3 | 4 | model gulwani_cav09_06 { 5 | 6 | var x, y, n, i1, i2; 7 | states q1, q2; 8 | 9 | transition t1 := { 10 | from := q1; 11 | to := q2; 12 | guard := x < n; 13 | action := i1' = i1 + 1, y' = x; 14 | }; 15 | 16 | transition t2 := { 17 | from := q2; 18 | to := q2; 19 | guard := y < n; 20 | action := i2' = i2 + 1, y' = y + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := q2; 25 | to := q1; 26 | guard := true; 27 | action := x' = y + 1; 28 | }; 29 | 30 | } 31 | 32 | strategy s { 33 | 34 | Region init := {state = q1 && n >= 0 && x = 0 && i1 = 0 && i2 = 0}; 35 | 36 | Region bad := {i2 > n}; 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/gulwani4.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations GulwaniJK09:f1:p2 3 | 4 | model gulwani_jain_koskinen_pldi09_02 { 5 | 6 | var id, tmp, max_id, i; 7 | states q; 8 | 9 | transition t1 := { 10 | from := q; 11 | to := q; 12 | guard := tmp != id && tmp <= max_id; 13 | action := tmp' = tmp + 1, i' = i + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := q; 18 | to := q; 19 | guard := tmp != id && tmp > max_id; 20 | action := tmp' = 0, i' = i + 1; 21 | }; 22 | 23 | } 24 | 25 | strategy s { 26 | 27 | Region init := {state = q && 0 <= id && id < max_id && tmp = id + 1 && i = 0}; 28 | 29 | Region bad := {i > max_id + 1}; 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/halbwachs1.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Gonnord_thesis:f2.12:p31 Halbwachs_thesis 3 | 4 | model gonnord_thesis_031 { 5 | 6 | var i, j; 7 | states k1, k2; 8 | 9 | transition t1 := { 10 | from := k1; 11 | to := k1; 12 | guard := i <= 100; 13 | action := i' = i + 4; 14 | }; 15 | 16 | transition t2 := { 17 | from := k1; 18 | to := k1; 19 | guard := i <= 100; 20 | action := i' = i + 2, j' = j + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := k1; 25 | to := k2; 26 | guard := i > 100; 27 | action := ; 28 | }; 29 | 30 | } 31 | 32 | strategy s { 33 | 34 | Region init := {state = k1 && i = 0 && j = 0}; 35 | 36 | Region bad := {2j > i || 0 > j}; 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/halbwachs2.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Gonnord_thesis:f6.8:p83 Halbwachs_thesis 3 | 4 | model gonnord_thesis_083 { 5 | 6 | var x, y; 7 | states q1, q2; 8 | 9 | transition t1 := { 10 | from := q1; 11 | to := q1; 12 | guard := x <= 100; 13 | action := x' = x + 1, y' = y + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := q1; 18 | to := q1; 19 | guard := x <= 100; 20 | action := x' = x + 2; 21 | }; 22 | 23 | transition t3 := { 24 | from := q1; 25 | to := q2; 26 | guard := x > 100; 27 | action := ; 28 | }; 29 | 30 | } 31 | 32 | strategy s { 33 | 34 | Region init := {state = q1 && x = 0 && y = 0}; 35 | 36 | Region bad := {y > x || y > -x + 202 || x > 102 || y < 0}; 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/halbwachs3.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Halbwachs_misc10:p08 3 | 4 | model halbwachs_aussois10_08 { 5 | 6 | var x, y; 7 | states k; 8 | 9 | transition t1 := { 10 | from := k; 11 | to := k; 12 | guard := x <= 100; 13 | action := x' = x + 2; 14 | }; 15 | 16 | transition t2 := { 17 | from := k; 18 | to := k; 19 | guard := x <= 100; 20 | action := x' = x + 1, y' = y + 1; 21 | }; 22 | 23 | } 24 | 25 | strategy s { 26 | 27 | Region init := {state = k && x = 0 && y = 0}; 28 | 29 | Region bad := {y > x || y < 0 || x < 0}; 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/halbwachs4.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Halbwachs_misc10:p16 3 | 4 | model halbwachs_aussois10_16 { 5 | 6 | var b, ok, x, y; 7 | states k; 8 | 9 | transition t1 := { 10 | from := k; 11 | to := k; 12 | guard := b = 0 && ok = 1 && x >= y; 13 | action := b' = 1, x' = x + 1, ok' = 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := k; 18 | to := k; 19 | guard := b = 0 && ok = 0; 20 | action := b' = 1, x' = x + 1, ok' = 0; 21 | }; 22 | 23 | transition t3 := { 24 | from := k; 25 | to := k; 26 | guard := b = 0 && x < y; 27 | action := b' = 1, x' = x + 1, ok' = 0; 28 | }; 29 | 30 | transition t4 := { 31 | from := k; 32 | to := k; 33 | guard := b = 1 && ok = 1 && x >= y; 34 | action := b' = 0, y' = y + 1, ok' = 1; 35 | }; 36 | 37 | transition t5 := { 38 | from := k; 39 | to := k; 40 | guard := b = 1 && ok = 0; 41 | action := b' = 0, y' = y + 1, ok' = 0; 42 | }; 43 | 44 | transition t6 := { 45 | from := k; 46 | to := k; 47 | guard := b = 1 && x < y; 48 | action := b' = 0, y' = y + 1, ok' = 0; 49 | }; 50 | 51 | } 52 | 53 | strategy s { 54 | 55 | Region init := {state = k && b = 0 && ok = 1 && x = 0 && y = 0}; 56 | 57 | Region bad := {ok = 0}; 58 | 59 | } 60 | 61 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/halbwachs6.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Halbwachs_misc10:p40 3 | 4 | model halbwachs_aussois10_40 { 5 | 6 | var v, t, x, d; 7 | states k; 8 | 9 | transition t1 := { 10 | from := k; 11 | to := k; 12 | guard := x <= 4; 13 | action := x' = x + 1, v' = v + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := k; 18 | to := k; 19 | guard := d <= 9; 20 | action := d' = d + 1, t' = t + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := k; 25 | to := k; 26 | guard := d = 10 && x >= 2; 27 | action := x' = 0, d' = 0; 28 | }; 29 | 30 | } 31 | 32 | strategy s { 33 | 34 | Region init := {state = k && v = 0 && t = 0 && x = 0 && d = 0}; 35 | 36 | Region bad := {v < 0 || t < 0 || 2v > t + 10 || 5v < t - 10}; 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/halbwachs7.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Halbwachs_misc10:p43 3 | 4 | model halbwachs_aussois10_43 { 5 | 6 | var t, s, d; 7 | states k; 8 | 9 | transition t1 := { 10 | from := k; 11 | to := k; 12 | guard := s <= 3; 13 | action := s' = s + 1, d' = d + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := k; 18 | to := k; 19 | guard := true; 20 | action := t' = t + 1, s' = 0; 21 | }; 22 | 23 | } 24 | 25 | strategy s { 26 | 27 | Region init := {state = k && t = 0 && s = 0 && d = 0}; 28 | 29 | Region bad := {t < 0 || 0 > s || s > 4 || 0 > d || d > 4t + s}; 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/halbwachs8.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Halbwachs_thesis:f3.1:p60 3 | 4 | model halbwachs_thesis_60 { 5 | 6 | var i, j; 7 | states k1, k2, k3; 8 | 9 | transition t1 := { 10 | from := k1; 11 | to := k2; 12 | guard := i <= 100; 13 | action := ; 14 | }; 15 | 16 | transition t2 := { 17 | from := k1; 18 | to := k3; 19 | guard := i > 100; 20 | action := ; 21 | }; 22 | 23 | transition t3 := { 24 | from := k2; 25 | to := k1; 26 | guard := true; 27 | action := i' = i + 4; 28 | }; 29 | 30 | transition t4 := { 31 | from := k2; 32 | to := k1; 33 | guard := true; 34 | action := i' = i + 2, j' = j + 1; 35 | }; 36 | 37 | } 38 | 39 | strategy s { 40 | 41 | Region init := {state = k1 && i = 0 && j = 0}; 42 | 43 | Region bad := {state = k3 && j > 51}; 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/halbwachs9.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Halbwachs_thesis:p128 3 | 4 | model halbwachs_thesis_60 { 5 | 6 | var i, j, k; 7 | states k1, k2, k3; 8 | 9 | transition t1 := { 10 | from := k1; 11 | to := k2; 12 | guard := i <= 100; 13 | action := k' = k + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := k1; 18 | to := k3; 19 | guard := i > 100; 20 | action := ; 21 | }; 22 | 23 | transition t3 := { 24 | from := k2; 25 | to := k1; 26 | guard := true; 27 | action := i' = i + 4; 28 | }; 29 | 30 | transition t4 := { 31 | from := k2; 32 | to := k1; 33 | guard := true; 34 | action := i' = i + 2, j' = j + 1; 35 | }; 36 | 37 | } 38 | 39 | strategy s { 40 | 41 | Region init := {state = k1 && i = 0 && j = 0 && k = 0}; 42 | 43 | Region bad := {state = k1 && i + 2j != 4k}; 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/henry.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Henry_misc11:p19 3 | 4 | model henry_gdrgpl_19 { 5 | 6 | var x, d; 7 | states k; 8 | 9 | transition t1 := { 10 | from := k; 11 | to := k; 12 | guard := x = 0; 13 | action := d' = 1, x' = x + d; 14 | }; 15 | 16 | transition t2 := { 17 | from := k; 18 | to := k; 19 | guard := 1 <= x && x <= 999; 20 | action := x' = x + d; 21 | }; 22 | 23 | transition t3 := { 24 | from := k; 25 | to := k; 26 | guard := x = 1000; 27 | action := d' = -1, x' = x + d; 28 | }; 29 | 30 | } 31 | 32 | strategy s { 33 | 34 | Region init := {state = k && x = 0 && d = 1}; 35 | 36 | Region bad := {d > 1 || d < -1 || x < 0 || d < 2x - 1999}; 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/insertsort.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations AliasDFG10 3 | 4 | //Generated by c2fsm -cut -nodiv -int 5 | model main { 6 | var i,j,length,tmp_1,value; 7 | //parameters j,length; 8 | states stop,start,lbl_4_3,lbl_3_1,lbl_1_3; 9 | transition t_18 :={ 10 | from := start; 11 | to := stop; 12 | guard := (length <= 1); 13 | action:= i' = 1; 14 | }; 15 | transition t_19 :={ 16 | from := start; 17 | to := lbl_3_1; 18 | guard := (2 <= length); 19 | action:= i' = 1, value' = ?; 20 | }; 21 | transition t_20 :={ 22 | from := lbl_4_3; 23 | to := lbl_4_3; 24 | guard := (0 <= j); 25 | action:= j' = j-1; 26 | }; 27 | transition t_21 :={ 28 | from := lbl_4_3; 29 | to := lbl_1_3; 30 | guard := true; 31 | action:= i' = i+1, tmp_1' = i; 32 | }; 33 | transition t_22 :={ 34 | from := lbl_3_1; 35 | to := lbl_4_3; 36 | guard := (1 <= i); 37 | action:= j' = i-2; 38 | }; 39 | transition t_23 :={ 40 | from := lbl_3_1; 41 | to := lbl_1_3; 42 | guard := true; 43 | action:= i' = i+1, j' = i-1, tmp_1' = i; 44 | }; 45 | transition t_16 :={ 46 | from := lbl_1_3; 47 | to := stop; 48 | guard := (length <= i); 49 | action:=; 50 | }; 51 | transition t_17 :={ 52 | from := lbl_1_3; 53 | to := lbl_3_1; 54 | guard := (i+1 <= length); 55 | action:= value' = ?; 56 | }; 57 | } 58 | strategy dumb { 59 | Region init := { state = start }; 60 | } 61 | 62 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/interleaving1.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity nonlinear 2 | //! @citations GulwaniJK09:f4:p5 3 | 4 | model gulwani_jain_koskinen_pldi09_05a { 5 | 6 | var v1, v2, n, m, i; 7 | states q; 8 | 9 | transition t1 := { 10 | from := q; 11 | to := q; 12 | guard := v1 > 0 && v2 < m; 13 | action := v2' = v2 + 1, v1' = v1 - 1, i' = i + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := q; 18 | to := q; 19 | guard := v1 > 0 && v2 >= m; 20 | action := v2' = 0, i' = i + 1; 21 | }; 22 | 23 | } 24 | 25 | strategy s { 26 | 27 | Region init := {state = q && n > 0 && m > 0 && v1 = n && v2 = 0}; 28 | 29 | Region bad := {m * i > n + m * n}; 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/interleaving2.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity nonlinear 2 | //! @citations GulwaniJK09:f4:p5 3 | 4 | model gulwani_jain_koskinen_pldi09_05b { 5 | 6 | var i, j, m, n, c; 7 | states q; 8 | 9 | transition t1 := { 10 | from := q; 11 | to := q; 12 | guard := i < n && j < m; 13 | action := j' = j + 1, c' = c + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := q; 18 | to := q; 19 | guard := i < n && j >= m; 20 | action := j' = 0, i' = i + 1, c' = c + 1; 21 | }; 22 | 23 | } 24 | 25 | strategy s { 26 | 27 | Region init := {state = q && 0 < m && m < n && i = 0 && j = 0 && c = 0}; 28 | 29 | Region bad := {c > n * m}; 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/interleaving3.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity nonlinear 2 | //! @citations GulwaniJK09:f4:p5 3 | 4 | model gulwani_jain_koskinen_pldi09_05c { 5 | 6 | var i, m, n, c; 7 | states q; 8 | 9 | transition t1 := { 10 | from := q; 11 | to := q; 12 | guard := i > 0 && i < m; 13 | action := i' = i - 1, c' = c + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := q; 18 | to := q; 19 | guard := i > 0 && i >= m; 20 | action := i' = i - m, c' = c + 1; 21 | }; 22 | 23 | } 24 | 25 | strategy s { 26 | 27 | Region init := {state = q && 0 < m && m < n && i = n}; 28 | 29 | Region bad := {m * i > n + m * m}; 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/interleaving4.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations GulwaniJK09:f4:p5 3 | 4 | model gulwani_jain_koskinen_pldi09_05d { 5 | 6 | var i, m, n, b, c; 7 | states q; 8 | 9 | transition t1 := { 10 | from := q; 11 | to := q; 12 | guard := 0 < i && i < n && b = 1; 13 | action := i' = i + 1, c' = c + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := q; 18 | to := q; 19 | guard := 0 < i && i < n && b = 0; 20 | action := i' = i - 1, c' = c + 1; 21 | }; 22 | 23 | } 24 | 25 | strategy s { 26 | 27 | Region init := {state = q && 0 < m && m < n && i = m && c = 0}; 28 | 29 | Region bad := {c > m && c > n - m}; 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/jeannet1.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Jeannet_thesis:f2.1:p16 3 | 4 | model jeannet_thesis_016 { 5 | 6 | var i, j; 7 | states k1, k2, k3; 8 | 9 | transition t1 := { 10 | from := k1; 11 | to := k2; 12 | guard := i + j <= 20; 13 | action := ; 14 | }; 15 | 16 | transition t2 := { 17 | from := k1; 18 | to := k3; 19 | guard := i + j > 20; 20 | action := ; 21 | }; 22 | 23 | transition t3 := { 24 | from := k2; 25 | to := k1; 26 | guard := i >= 10; 27 | action := i' = i + 4; 28 | }; 29 | 30 | transition t4 := { 31 | from := k2; 32 | to := k1; 33 | guard := i < 10; 34 | action := i' = i + 2, j' = j + 1; 35 | }; 36 | 37 | } 38 | 39 | strategy s { 40 | 41 | Region init := {state = k1 && i = 2 && j = 0}; 42 | 43 | Region bad := {state = k2 && (i < 2j + 2 || 2j >= 10)}; 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/jeannet2.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Jeannet_thesis:f4.1:p40 3 | 4 | model jeannet_thesis_040 { 5 | 6 | var x, y; 7 | states k1, k2, err; 8 | 9 | transition t1 := { 10 | from := k1; 11 | to := k1; 12 | guard := x < 9; 13 | action := x' = x + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := k1; 18 | to := k2; 19 | guard := x = 9; 20 | action := x' = x + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := k2; 25 | to := k2; 26 | guard := true; 27 | action := x' = x + 1, y' = y + 1; 28 | }; 29 | 30 | transition t4 := { 31 | from := k2; 32 | to := err; 33 | guard := x <= 13 && y >= 4; 34 | action := ; 35 | }; 36 | 37 | } 38 | 39 | strategy s { 40 | 41 | Region init := {state = k1 && x = 0 && y = 0}; 42 | 43 | Region bad := {state = err}; 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/jeannet3.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Jeannet_thesis:f4.2:p41 3 | 4 | model jeannet_thesis_041 { 5 | 6 | var x, y; 7 | states k1, k2, k3, k4, err; 8 | 9 | transition t1 := { 10 | from := k1; 11 | to := k2; 12 | guard := x >= y; 13 | action := x' = x + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := k2; 18 | to := k3; 19 | guard := x >= y; 20 | action := y' = y + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := k3; 25 | to := k4; 26 | guard := x >= y; 27 | action := x' = x + 1; 28 | }; 29 | 30 | transition t4 := { 31 | from := k4; 32 | to := k1; 33 | guard := x >= y; 34 | action := y' = y + 1; 35 | }; 36 | 37 | transition t5 := { 38 | from := k1; 39 | to := err; 40 | guard := x < y; 41 | action := ; 42 | }; 43 | 44 | transition t6 := { 45 | from := k2; 46 | to := err; 47 | guard := x < y; 48 | action := ; 49 | }; 50 | 51 | transition t7 := { 52 | from := k3; 53 | to := err; 54 | guard := x < y; 55 | action := ; 56 | }; 57 | 58 | transition t8 := { 59 | from := k4; 60 | to := err; 61 | guard := x < y; 62 | action := ; 63 | }; 64 | 65 | } 66 | 67 | strategy s { 68 | 69 | Region init := {state = k1 && x = 0 && y = 0}; 70 | 71 | Region bad := {state = err}; 72 | 73 | } 74 | 75 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/jeannet4.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Jeannet_thesis:p104 3 | 4 | model jeannet_thesis_104 { 5 | 6 | var x, y, b0, b1; 7 | states k; 8 | 9 | transition t1 := { 10 | from := k; 11 | to := k; 12 | guard := x >= y && b0 = b1; 13 | action := b0' = 1 - b1, b1' = b0, x' = x + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := k; 18 | to := k; 19 | guard := x >= y && b0 != b1; 20 | action := b0' = 1 - b1, b1' = b0, y' = y + 1; 21 | }; 22 | 23 | } 24 | 25 | strategy s { 26 | 27 | Region init := {state = k && x = 0 && y = 0 && b0 = 0 && b1 = 0}; 28 | 29 | Region bad := {state = k && x < y}; 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/jeannet5.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Jeannet_thesis:p109:f8.4 3 | 4 | model jeannet_thesis_109 { 5 | 6 | var x, y, e; 7 | states i, a, b; 8 | 9 | transition t1 := { 10 | from := i; 11 | to := a; 12 | guard := e = 1; 13 | action := ; 14 | }; 15 | 16 | transition t2 := { 17 | from := i; 18 | to := b; 19 | guard := e = 0; 20 | action := ; 21 | }; 22 | 23 | transition t3 := { 24 | from := a; 25 | to := a; 26 | guard := e = 1; 27 | action := x' = x + 1; 28 | }; 29 | 30 | transition t4 := { 31 | from := a; 32 | to := a; 33 | guard := e = 1; 34 | action := x' = x + 1, y' = y + 1; 35 | }; 36 | 37 | transition t5 := { 38 | from := a; 39 | to := b; 40 | guard := e = 0; 41 | action := ; 42 | }; 43 | 44 | transition t6 := { 45 | from := b; 46 | to := a; 47 | guard := true; 48 | action := x' = x + 1, y' = y + 2; 49 | }; 50 | 51 | } 52 | 53 | strategy s { 54 | 55 | Region init := {state = i && x = 0 && y = 0 && 0 <= e && e <= 1}; 56 | 57 | Region bad := {state = b && y != 2x}; 58 | 59 | } 60 | 61 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/jeannet6.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations Jeannet_thesis:p111:f8.5 3 | 4 | model jeannet_thesis_111 { 5 | 6 | var x, y; 7 | states i, d; 8 | 9 | transition t1 := { 10 | from := i; 11 | to := i; 12 | guard := x <= 9; 13 | action := x' = x + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := i; 18 | to := d; 19 | guard := x >= 10; 20 | action := x' = x + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := d; 25 | to := d; 26 | guard := x >= 6; 27 | action := x' = x - 1; 28 | }; 29 | 30 | transition t4 := { 31 | from := d; 32 | to := i; 33 | guard := x <= 5; 34 | action := x' = x - 1; 35 | }; 36 | 37 | } 38 | 39 | strategy s { 40 | 41 | Region init := {state = i && x = 0}; 42 | 43 | Region bad := {state = d && (5 > x || x > 11)}; 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/leeyannakis_bad.fst: -------------------------------------------------------------------------------- 1 | //! @tags termination 2 | //! @citations GulavaniHKNR06:p7:f6 3 | 4 | model gulavani_henzinger_kannan_nori_rajamani_sigsoft06_07 { 5 | 6 | var y; 7 | states q; 8 | 9 | transition t := { 10 | from := q; 11 | to := q; 12 | guard := y > 0; 13 | action := y' = y - 1; 14 | }; 15 | 16 | } 17 | 18 | strategy s { 19 | 20 | Region init := {state = q}; 21 | 22 | } 23 | 24 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/loops.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations PodelskiR04 3 | 4 | //Generated by c2fsm -cut -nodiv -int 5 | model main { 6 | var n,x,y; 7 | //parameters n; 8 | states stop,start,lbl_12_1,lbl_10_1; 9 | transition t_22 :={ 10 | from := start; 11 | to := stop; 12 | guard := (n+1 <= 0); 13 | action:= x' = n; 14 | }; 15 | transition t_34 :={ 16 | from := start; 17 | to := lbl_12_1; 18 | guard := ( (n <= 1) && (0 <= n) ); 19 | action:= x' = n-1, y' = 1; 20 | }; 21 | transition t_35 :={ 22 | from := start; 23 | to := lbl_10_1; 24 | guard := (2 <= n); 25 | action:= x' = n, y' = 2; 26 | }; 27 | transition t_29 :={ 28 | from := lbl_12_1; 29 | to := stop; 30 | guard := (x+1 <= 0); 31 | action:=; 32 | }; 33 | transition t_30 :={ 34 | from := lbl_12_1; 35 | to := lbl_12_1; 36 | guard := ( (x <= 1) && (0 <= x) ); 37 | action:= x' = x-1, y' = 1; 38 | }; 39 | transition t_31 :={ 40 | from := lbl_12_1; 41 | to := lbl_10_1; 42 | guard := (2 <= x); 43 | action:= y' = 2; 44 | }; 45 | transition t_25 :={ 46 | from := lbl_10_1; 47 | to := lbl_10_1; 48 | guard := (y+1 <= x); 49 | action:= y' = 2y; 50 | }; 51 | transition t_26 :={ 52 | from := lbl_10_1; 53 | to := lbl_12_1; 54 | guard := (x <= y); 55 | action:= x' = x-1; 56 | }; 57 | } 58 | strategy dumb { 59 | Region init := { state = start }; 60 | } 61 | 62 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/microsoftex2.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations GulwaniZ10:f2:p4 3 | 4 | model gulwani_zuleger_pldi10_04a { 5 | 6 | var n, n0, m, i; 7 | states q1, q2; 8 | 9 | transition t1 := { 10 | from := q1; 11 | to := q2; 12 | guard := n > 0 && m > 0; 13 | action := n' = n - 1, m' = m - 1, i' = i + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := q2; 18 | to := q2; 19 | guard := true; 20 | action := n' = n - 1, m' = m + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := q2; 25 | to := q1; 26 | guard := true; 27 | action := ; 28 | }; 29 | 30 | } 31 | 32 | strategy s { 33 | 34 | Region init := {state = q1 && n > 0 && m > 0 && n = n0 && i = 0}; 35 | 36 | Region bad := {i > n0}; 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/microsoftex4.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations GulwaniZ10:f2:p4 3 | 4 | model gulwani_zuleger_pldi10_04b { 5 | 6 | var flag, n, n0, i; 7 | states q1, q2; 8 | 9 | transition t1 := { 10 | from := q1; 11 | to := q2; 12 | guard := flag = 1; 13 | action := flag' = 0, i' = i + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := q2; 18 | to := q2; 19 | guard := n > 0; 20 | action := n' = n - 1, flag' = 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := q2; 25 | to := q1; 26 | guard := true; 27 | action := ; 28 | }; 29 | 30 | } 31 | 32 | strategy s { 33 | 34 | Region init := {state = q1 && n >= 0 && n = n0 && flag = 1 && i = 0}; 35 | 36 | Region bad := {i > n0 + 1}; 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/microsoftex5.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations GulwaniZ10:f2:p4 3 | 4 | model gulwani_zuleger_pldi10_04c { 5 | 6 | var flag, n, n0, i, c; 7 | states q1, q2; 8 | 9 | transition t1 := { 10 | from := q1; 11 | to := q2; 12 | guard := i < n; 13 | action := flag' = 0, c' = c + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := q2; 18 | to := q2; 19 | guard := true; 20 | action := flag' = 1, n' = n - 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := q2; 25 | to := q1; 26 | guard := flag = 1; 27 | action := ; 28 | }; 29 | 30 | transition t4 := { 31 | from := q2; 32 | to := q1; 33 | guard := flag = 0; 34 | action := i' = i + 1; 35 | }; 36 | 37 | } 38 | 39 | strategy s { 40 | 41 | Region init := {state = q1 && n >= 0 && n = n0 && flag = 1 && i = 0 && c = 0}; 42 | 43 | Region bad := {c > n0}; 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/microsoftex6.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations GulwaniZ10:f3:p3 3 | 4 | model cook_podelski_rybalchenko_pldi06_04 { 5 | 6 | var x0, z0, x, z, n, c1, c2; 7 | states q1, q2; 8 | 9 | transition t1 := { 10 | from := q1; 11 | to := q2; 12 | guard := x < n; 13 | action := ; 14 | }; 15 | 16 | transition t2 := { 17 | from := q2; 18 | to := q1; 19 | guard := z > x; 20 | action := x' = x + 1, c1' = c1 + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := q2; 25 | to := q1; 26 | guard := z <= x; 27 | action := z' = z + 1, c2' = c2 + 1; 28 | }; 29 | 30 | } 31 | 32 | strategy s { 33 | 34 | Region init := {state = q1 && x = x0 && z = z0 && c1 = 0 && c2 = 0 && n >= x0 && n >= z0}; 35 | 36 | Region bad := {c1 + c2 > 2n - x0 - z0}; 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/microsoftex7.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations GulwaniZ10:f3:p3 3 | 4 | model gulwani_zuleger_pldi10_03b { 5 | 6 | var n, m, j; 7 | states q1, q2; 8 | 9 | transition t1a := { 10 | from := q1; 11 | to := q2; 12 | guard := j < n; 13 | action := ; 14 | }; 15 | 16 | transition t1b := { 17 | from := q1; 18 | to := q2; 19 | guard := j > n; 20 | action := ; 21 | }; 22 | 23 | transition t2 := { 24 | from := q2; 25 | to := q1; 26 | guard := j > m; 27 | action := j' = 0; 28 | }; 29 | 30 | transition t3 := { 31 | from := q2; 32 | to := q1; 33 | guard := j <= m; 34 | action := j' = j + 1; 35 | }; 36 | 37 | } 38 | 39 | strategy s { 40 | 41 | Region init := {state = q1 && 0 < n && n < m && j = n + 1}; 42 | 43 | } 44 | 45 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/multcounters1.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations GulwaniMC09:f4:p6 3 | 4 | model gulwani_mehra_chilimbi_popl09_06e { 5 | 6 | var x, y, n, m, c1, c2; 7 | states q1, q2; 8 | 9 | transition t1 := { 10 | from := q1; 11 | to := q2; 12 | guard := x < n; 13 | action := ; 14 | }; 15 | 16 | transition t2 := { 17 | from := q2; 18 | to := q1; 19 | guard := y < m; 20 | action := y' = y + 1, c1' = c1 + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := q2; 25 | to := q1; 26 | guard := y >= m; 27 | action := x' = x + 1, c2' = c2 + 1; 28 | }; 29 | 30 | } 31 | 32 | strategy s { 33 | 34 | Region init := {state = q1 && x = 0 && y = 0 && c1 = 0 && c2 = 0 && n >= 0 && m >= 0}; 35 | 36 | Region bad := {c1 + c2 > n + m}; 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/multcounters2.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations GulwaniMC09:f4:p6 3 | 4 | model gulwani_mehra_chilimbi_popl09_06f { 5 | 6 | var x0, y0, x, y, n, m, c1, c2; 7 | states q1, q2; 8 | 9 | transition t1 := { 10 | from := q1; 11 | to := q2; 12 | guard := x < n; 13 | action := ; 14 | }; 15 | 16 | transition t2 := { 17 | from := q2; 18 | to := q2; 19 | guard := y < m; 20 | action := y' = y + 1, c1' = c1 + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := q2; 25 | to := q1; 26 | guard := true; 27 | action := x' = x + 1, c2' = c2 + 1; 28 | }; 29 | 30 | } 31 | 32 | strategy s { 33 | 34 | Region init := {state = q1 && x = x0 && y = y0 && 0 <= x0 && x0 <= n && 0 <= y0 && y0 <= m && c1 = 0 && c2 = 0 && n >= 0 && m >= 0}; 35 | 36 | Region bad := {c1 + c2 > n + m - x0 - y0}; 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/multcounters3.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity nonlinear 2 | //! @citations GulwaniMC09:f4:p6 3 | 4 | model gulwani_mehra_chilimbi_popl09_06g { 5 | 6 | var x, y, n, m, c1, c2; 7 | states q1, q2; 8 | 9 | transition t1 := { 10 | from := q1; 11 | to := q2; 12 | guard := x < n; 13 | action := ; 14 | }; 15 | 16 | transition t2 := { 17 | from := q2; 18 | to := q1; 19 | guard := y < m; 20 | action := y' = y + 1, c1' = c1 + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := q2; 25 | to := q1; 26 | guard := y >= m; 27 | action := y' = 0, x' = x + 1, c2' = c2 + 1; 28 | }; 29 | 30 | } 31 | 32 | strategy s { 33 | 34 | Region init := {state = q1 && x = 0 && y = 0 && c1 = 0 && c2 = 0 && n >= 0 && m >= 0}; 35 | 36 | Region bad := {c1 + c2 > n * (m + 1)}; 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/multcounters4.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity nonlinear 2 | //! @citations GulwaniMC09:f4:p6 3 | 4 | model gulwani_mehra_chilimbi_popl09_06h { 5 | 6 | var x, y, n, m, c1, c2; 7 | states q1, q2; 8 | 9 | transition t1 := { 10 | from := q1; 11 | to := q2; 12 | guard := x < n; 13 | action := y' = 0, x' = x + 1, c1' = c1 + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := q2; 18 | to := q2; 19 | guard := y < m; 20 | action := y' = y + 1, c2' = c2 + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := q2; 25 | to := q1; 26 | guard := true; 27 | action := ; 28 | }; 29 | 30 | } 31 | 32 | strategy s { 33 | 34 | Region init := {state = q1 && x = 0 && y = 0 && c1 = 0 && c2 = 0 && n >= 0 && m >= 0}; 35 | 36 | Region bad := {c1 + c2 > n * (m + 1)}; 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/nd_loop.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations AliasDFG10 3 | 4 | //Generated by c2fsm -cut -nodiv -int 5 | model nd_loop { 6 | var x,y; 7 | //parameters; 8 | states stop,start,lbl_5_1,cut; 9 | transition t_22 :={ 10 | from := start; 11 | to := lbl_5_1; 12 | guard := true; 13 | action:= x' = ?, y' = 0; 14 | }; 15 | transition t_18 :={ 16 | from := lbl_5_1; 17 | to := stop; 18 | guard := ( (x <= y) || (y+3 <= x) ); 19 | action:=; 20 | }; 21 | transition t_19 :={ 22 | from := lbl_5_1; 23 | to := cut; 24 | guard := ( ( (x <= y+2) && (x <= 9) ) && (y+1 <= x) ); 25 | action:=; 26 | }; 27 | transition t_20 :={ 28 | from := lbl_5_1; 29 | to := stop; 30 | guard := ( ( (x <= y+2) && (y+1 <= x) ) && (10 <= x) ); 31 | action:=; 32 | }; 33 | transition t_21 :={ 34 | from := cut; 35 | to := lbl_5_1; 36 | guard := true; 37 | action:= x' = ?, y' = x; 38 | }; 39 | } 40 | strategy dumb { 41 | Region init := { state = start }; 42 | } 43 | 44 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/ndecr.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations AliasDFG10 3 | 4 | //Generated by c2fsm -cut -nodiv -int 5 | model main { 6 | var i,n; 7 | //parameters n; 8 | states stop,start,lbl_3_2; 9 | transition t_8 :={ 10 | from := start; 11 | to := stop; 12 | guard := (i <= 1); 13 | action:=; 14 | }; 15 | transition t_9 :={ 16 | from := start; 17 | to := lbl_3_2; 18 | guard := (2 <= i); 19 | action:= i' = i-1; 20 | }; 21 | transition t_6 :={ 22 | from := lbl_3_2; 23 | to := stop; 24 | guard := (i <= 1); 25 | action:=; 26 | }; 27 | transition t_7 :={ 28 | from := lbl_3_2; 29 | to := lbl_3_2; 30 | guard := (2 <= i); 31 | action:= i' = i-1; 32 | }; 33 | } 34 | strategy dumb { 35 | Region init := { state = start }; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/nested.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity nonlinear 2 | //! @citations GulwaniJK09:f2:p3 3 | 4 | model gulwani_jain_koskinen_pldi09_03 { 5 | 6 | var n, m, N, i, j, k, c; 7 | states L1, L2, L3; 8 | 9 | transition t1 := { 10 | from := L1; 11 | to := L2; 12 | guard := i < n; 13 | action := j' = 0, c' = c + 1; 14 | }; 15 | 16 | transition t2 := { 17 | from := L2; 18 | to := L3; 19 | guard := j < m; 20 | action := j' = j + 1, k' = i, c' = c + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := L3; 25 | to := L3; 26 | guard := k < N; 27 | action := k' = k + 1, c' = c + 1; 28 | }; 29 | 30 | transition t4 := { 31 | from := L3; 32 | to := L2; 33 | guard := true; 34 | action := i' = k; 35 | }; 36 | 37 | transition t5 := { 38 | from := L2; 39 | to := L1; 40 | guard := true; 41 | action := i' = i + 1; 42 | }; 43 | 44 | } 45 | 46 | strategy s { 47 | 48 | Region init := {state = L1 && 0 <= n && 0 <= m && 0 <= N}; 49 | 50 | Region bad := {c > n + m * n + N}; 51 | 52 | } 53 | 54 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/popeea.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint 2 | //! @citations PopeeaC06:p2 GulwaniZ10:f9:p12 3 | 4 | model popeea_chin_asian06_02 { 5 | 6 | var x, l, upd, N; 7 | states q1, q2, q3, q4; 8 | 9 | transition t1 := { 10 | from := q1; 11 | to := q2; 12 | guard := x < N; 13 | action := ; 14 | }; 15 | 16 | transition t2 := { 17 | from := q2; 18 | to := q3; 19 | guard := true; 20 | action := l' = x, upd' = 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := q2; 25 | to := q3; 26 | guard := true; 27 | action := ; 28 | }; 29 | 30 | transition t4 := { 31 | from := q3; 32 | to := q1; 33 | guard := true; 34 | action := x' = x + 1; 35 | }; 36 | 37 | transition t5 := { 38 | from := q1; 39 | to := q4; 40 | guard := x >= N; 41 | action := ; 42 | }; 43 | 44 | } 45 | 46 | strategy s { 47 | 48 | Region init := {state = q1 && x = 0 && upd = 0}; 49 | 50 | Region bad := {state = q4 && upd = 1 && (0 > l || l >= N)}; 51 | 52 | } 53 | 54 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/random1d.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations ChawdharyCGSY08 3 | 4 | //Generated by c2fsm -cut -nodiv -int 5 | model main { 6 | var a,mx,x; 7 | //parameters mx; 8 | states stop,start,lbl_10_1; 9 | transition t_22 :={ 10 | from := start; 11 | to := stop; 12 | guard := (mx <= 0); 13 | action:=; 14 | }; 15 | transition t_30 :={ 16 | from := start; 17 | to := lbl_10_1; 18 | guard := (1 <= mx); 19 | action:= a' = 1, x' = 2; 20 | }; 21 | transition t_31 :={ 22 | from := start; 23 | to := lbl_10_1; 24 | guard := (1 <= mx); 25 | action:= a' = -1, x' = 2; 26 | }; 27 | transition t_26 :={ 28 | from := lbl_10_1; 29 | to := stop; 30 | guard := (mx+1 <= x); 31 | action:=; 32 | }; 33 | transition t_27 :={ 34 | from := lbl_10_1; 35 | to := lbl_10_1; 36 | guard := (x <= mx); 37 | action:= a' = a+1, x' = x+1; 38 | }; 39 | transition t_28 :={ 40 | from := lbl_10_1; 41 | to := lbl_10_1; 42 | guard := (x <= mx); 43 | action:= a' = a-1, x' = x+1; 44 | }; 45 | } 46 | strategy dumb { 47 | Region init := { state = start }; 48 | } 49 | 50 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/relation1.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations AliasDFG10 3 | 4 | //Generated by c2fsm -cut -nodiv -int 5 | model relation1 { 6 | var x,y; 7 | //parameters; 8 | states stop,start,lbl_4_1; 9 | transition t_22 :={ 10 | from := start; 11 | to := lbl_4_1; 12 | guard := true; 13 | action:= x' = ?; 14 | }; 15 | transition t_18 :={ 16 | from := lbl_4_1; 17 | to := stop; 18 | guard := true; 19 | action:= y' = x; 20 | }; 21 | } 22 | strategy dumb { 23 | Region init := { state = start }; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/rsd.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations AliasDFG10 3 | 4 | //Generated by c2fsm -cut -nodiv -int 5 | model main { 6 | var da,db,r,temp; 7 | //parameters r; 8 | states stop,start,lbl_8_2,lbl_12_1; 9 | transition t_28 :={ 10 | from := start; 11 | to := stop; 12 | guard := (r+1 <= 0); 13 | action:=; 14 | }; 15 | transition t_38 :={ 16 | from := start; 17 | to := lbl_8_2; 18 | guard := (0 <= r); 19 | action:= da' = 2r-1, db' = 2r; 20 | }; 21 | transition t_39 :={ 22 | from := start; 23 | to := lbl_12_1; 24 | guard := (0 <= r); 25 | action:= da' = 2r-1, db' = 2r-1, temp' = 2r; 26 | }; 27 | transition t_31 :={ 28 | from := lbl_8_2; 29 | to := stop; 30 | guard := (da+1 <= r); 31 | action:=; 32 | }; 33 | transition t_32 :={ 34 | from := lbl_8_2; 35 | to := lbl_8_2; 36 | guard := (r <= da); 37 | action:= da' = da-1; 38 | }; 39 | transition t_33 :={ 40 | from := lbl_8_2; 41 | to := lbl_12_1; 42 | guard := (r <= da); 43 | action:= da' = db-1, db' = db-1, temp' = da; 44 | }; 45 | transition t_34 :={ 46 | from := lbl_12_1; 47 | to := stop; 48 | guard := (da+1 <= r); 49 | action:=; 50 | }; 51 | transition t_35 :={ 52 | from := lbl_12_1; 53 | to := lbl_8_2; 54 | guard := (r <= da); 55 | action:= da' = da-1; 56 | }; 57 | transition t_36 :={ 58 | from := lbl_12_1; 59 | to := lbl_12_1; 60 | guard := (r <= da); 61 | action:= da' = db-1, db' = db-1, temp' = da; 62 | }; 63 | } 64 | strategy dumb { 65 | Region init := { state = start }; 66 | } 67 | 68 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/slam.fst: -------------------------------------------------------------------------------- 1 | //! @tags termination 2 | //! @citations GulavaniHKNR06:p5:f3 GulwaniJK09:f10d:p10 GulwaniZ10:f9:p12 HenzingerJMS02:f1:p2 3 | 4 | model gulavani_henzinger_kannan_nori_rajamani_sigsoft06_05 { 5 | 6 | var lock_state, x, y; 7 | states q1, q2, q3, q4; 8 | 9 | transition t1 := { 10 | from := q1; 11 | to := q2; 12 | guard := true; 13 | action := lock_state' = 0, x' = y; 14 | }; 15 | 16 | transition t2 := { 17 | from := q2; 18 | to := q3; 19 | guard := true; 20 | action := lock_state' = 1, y' = y + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := q2; 25 | to := q3; 26 | guard := true; 27 | action := ; 28 | }; 29 | 30 | transition t4 := { 31 | from := q3; 32 | to := q2; 33 | guard := x != y; 34 | action := ; 35 | }; 36 | 37 | transition t5 := { 38 | from := q3; 39 | to := q4; 40 | guard := x = y; 41 | action := ; 42 | }; 43 | 44 | } 45 | 46 | strategy s { 47 | 48 | Region init := {state = q1 && lock_state = 1}; 49 | 50 | Region bad := {state = q4 && lock_state != 0}; 51 | 52 | } 53 | 54 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/slam_bad.fst: -------------------------------------------------------------------------------- 1 | //! @tags termination 2 | //! @citations GulavaniHKNR06:p3:f1 3 | 4 | model gulavani_henzinger_kannan_nori_rajamani_sigsoft06_03 { 5 | 6 | var i, c; 7 | states q; 8 | 9 | transition t := { 10 | from := q; 11 | to := q; 12 | guard := i < 1000; 13 | action := c' = c + i, i' = i + 1; 14 | }; 15 | 16 | } 17 | 18 | strategy s { 19 | 20 | Region init := {state = q && i = 0 && c = 0}; 21 | 22 | } 23 | 24 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/speedometer.fst: -------------------------------------------------------------------------------- 1 | //! @tags fixpoint nonlinear 2 | //! @citations GopanR07:f4:p10 3 | 4 | model gopan_reps_cav06_10 { 5 | 6 | var d, t, s, c; 7 | states n1, n2, n3, n4, n5, n6; 8 | 9 | transition t1 := { 10 | from := n1; 11 | to := n2; 12 | guard := true; 13 | action := ; 14 | }; 15 | 16 | transition t2 := { 17 | from := n2; 18 | to := n3; 19 | guard := true; 20 | action := t' = t + 1, s' = 0; 21 | }; 22 | 23 | transition t3 := { 24 | from := n3; 25 | to := n6; 26 | guard := true; 27 | action := ; 28 | }; 29 | 30 | transition t4 := { 31 | from := n1; 32 | to := n4; 33 | guard := true; 34 | action := ; 35 | }; 36 | 37 | transition t5 := { 38 | from := n4; 39 | to := n5; 40 | guard := s < c; 41 | action := ; 42 | }; 43 | 44 | transition t6 := { 45 | from := n5; 46 | to := n6; 47 | guard := true; 48 | action := d' = d + 1, s' = s + 1; 49 | }; 50 | 51 | transition t7 := { 52 | from := n4; 53 | to := n6; 54 | guard := s >= c; 55 | action := ; 56 | }; 57 | 58 | transition t8 := { 59 | from := n6; 60 | to := n1; 61 | guard := true; 62 | action := ; 63 | }; 64 | 65 | } 66 | 67 | strategy s { 68 | 69 | Region init := {state = n1 && d = 0 && t = 0 && s = 0}; 70 | 71 | Region bad := {state = n1 && (s > d || d > c * t + s || 0 > s || s > c)}; 72 | 73 | } 74 | 75 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/sum.fst: -------------------------------------------------------------------------------- 1 | // A model to test the sum domain 2 | 3 | model sum { 4 | 5 | var i, x, y; 6 | 7 | states loop, firstif, secondif, endloop, end; 8 | 9 | transition exit := { 10 | from := loop; 11 | to := end; 12 | guard := i > 4; 13 | action := ; 14 | }; 15 | 16 | transition incr := { 17 | from := loop; 18 | to := firstif; 19 | guard := i <= 4; 20 | action := i' = i + 1; 21 | }; 22 | 23 | transition firstif1 := { 24 | from := firstif; 25 | to := secondif; 26 | guard := TRUE; 27 | action := x' = i - 1; 28 | }; 29 | 30 | transition firstif2 := { 31 | from := firstif; 32 | to := secondif; 33 | guard := TRUE; 34 | action := x' = i; 35 | }; 36 | 37 | transition secondif1 := { 38 | from := secondif; 39 | to := endloop; 40 | guard := TRUE; 41 | action := y' = i - 1; 42 | }; 43 | 44 | transition secondif2 := { 45 | from := secondif; 46 | to := endloop; 47 | guard := TRUE; 48 | action := y' = i; 49 | }; 50 | 51 | transition again := { 52 | from := endloop; 53 | to := loop; 54 | guard := true; 55 | action := ; 56 | }; 57 | 58 | } 59 | 60 | strategy s { 61 | Region init := { state = loop && i = 0 && x = 0 && y = 0 }; 62 | } 63 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/synergy_bad.fst: -------------------------------------------------------------------------------- 1 | //! @tags termination 2 | //! @citations GulavaniHKNR06:p9:f9 3 | 4 | model gulavani_henzinger_kannan_nori_rajamani_sigsoft06_09 { 5 | 6 | var x, y; 7 | states q; 8 | 9 | transition t := { 10 | from := q; 11 | to := q; 12 | guard := y >= 0; 13 | action := y' = y + x; 14 | }; 15 | 16 | } 17 | 18 | strategy s { 19 | 20 | Region init := {state = q && x = 0 && y = 0}; 21 | 22 | } 23 | 24 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/terminate.fst: -------------------------------------------------------------------------------- 1 | //! @tags termination complexity 2 | //! @citations ColonS01 3 | 4 | //Generated by c2fsm -cut -nodiv -int 5 | model main { 6 | var ell,i,j,k; 7 | //parameters; 8 | states stop,start,lbl_7_2; 9 | transition t_15 :={ 10 | from := start; 11 | to := stop; 12 | guard := ( (101 <= i) || (k+1 <= j) ); 13 | action:=; 14 | }; 15 | transition t_16 :={ 16 | from := start; 17 | to := lbl_7_2; 18 | guard := ( (i <= 100) && (j <= k) ); 19 | action:= ell' = i, i' = j, j' = i+1, k' = k-1; 20 | }; 21 | transition t_13 :={ 22 | from := lbl_7_2; 23 | to := stop; 24 | guard := ( (101 <= i) || (k+1 <= j) ); 25 | action:=; 26 | }; 27 | transition t_14 :={ 28 | from := lbl_7_2; 29 | to := lbl_7_2; 30 | guard := ( (i <= 100) && (j <= k) ); 31 | action:= ell' = i, i' = j, j' = i+1, k' = k-1; 32 | }; 33 | } 34 | strategy dumb { 35 | Region init := { state = start }; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/terminator.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations CookPR06:f3:p4 3 | 4 | model cook_podelski_rybalchenko_pldi06_04 { 5 | 6 | var x0, z0, x, z, n, c1, c2; 7 | states q1, q2; 8 | 9 | transition t1 := { 10 | from := q1; 11 | to := q2; 12 | guard := x < n; 13 | action := ; 14 | }; 15 | 16 | transition t2 := { 17 | from := q2; 18 | to := q1; 19 | guard := z > x; 20 | action := x' = x + 1, c1' = c1 + 1; 21 | }; 22 | 23 | transition t3 := { 24 | from := q2; 25 | to := q1; 26 | guard := z <= x; 27 | action := z' = z + 1, c2' = c2 + 1; 28 | }; 29 | 30 | } 31 | 32 | strategy s { 33 | 34 | Region init := {state = q1 && x = x0 && z = z0 && c1 = 0 && c2 = 0 && n >= x0 && n >= z0}; 35 | 36 | Region bad := {c1 + c2 > 2n - x0 - z0}; 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/ticket.fst: -------------------------------------------------------------------------------- 1 | //! @citations BultanGP97:f3:p8 2 | //! @tags fixpoint parallelism 3 | 4 | model bultan_gerber_pugh_cav97_08 { 5 | 6 | var a, b, t, s, pc1, pc2; 7 | states q; 8 | 9 | transition e_T1 := { 10 | from := q; 11 | to := q; 12 | guard := pc1 = 1; 13 | action := pc1' = 2, a' = t, t' = t + 1; 14 | }; 15 | 16 | transition e_W1 := { 17 | from := q; 18 | to := q; 19 | guard := pc1 = 2 && a <= s; 20 | action := pc1' = 3; 21 | }; 22 | 23 | transition e_C1 := { 24 | from := q; 25 | to := q; 26 | guard := pc1 = 3; 27 | action := pc1' = 1, s' = s + 1; 28 | }; 29 | 30 | transition e_T2 := { 31 | from := q; 32 | to := q; 33 | guard := pc2 = 1; 34 | action := pc2' = 2, b' = t, t' = t + 1; 35 | }; 36 | 37 | transition e_W2 := { 38 | from := q; 39 | to := q; 40 | guard := pc2 = 2 && b <= s; 41 | action := pc2' = 3; 42 | }; 43 | 44 | transition e_C2 := { 45 | from := q; 46 | to := q; 47 | guard := pc2 = 3; 48 | action := pc2' = 1, s' = s + 1; 49 | }; 50 | 51 | } 52 | 53 | strategy s { 54 | 55 | Region init := {state = q && t = s && pc1 = 1 && pc2 = 1}; 56 | 57 | Region bad := {pc1 = 3 && pc2 = 3}; 58 | 59 | } 60 | 61 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/wcet2.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations AliasDFG10 3 | 4 | //Generated by c2fsm -cut -nodiv -int 5 | model main { 6 | var i,j,tmp,tmp_1; 7 | //parameters; 8 | states stop,start,lbl_9_2,lbl_8_2; 9 | transition t_15 :={ 10 | from := start; 11 | to := stop; 12 | guard := (5 <= i); 13 | action:=; 14 | }; 15 | transition t_21 :={ 16 | from := start; 17 | to := lbl_9_2; 18 | guard := (i <= 2); 19 | action:= i' = i+1, j' = 0, tmp' = i; 20 | }; 21 | transition t_22 :={ 22 | from := start; 23 | to := lbl_8_2; 24 | guard := ( (i <= 4) && (3 <= i) ); 25 | action:= j' = 1, tmp_1' = 0; 26 | }; 27 | transition t_13 :={ 28 | from := lbl_9_2; 29 | to := stop; 30 | guard := (5 <= i); 31 | action:=; 32 | }; 33 | transition t_19 :={ 34 | from := lbl_9_2; 35 | to := lbl_9_2; 36 | guard := (i <= 2); 37 | action:= i' = i+1, j' = 0, tmp' = i; 38 | }; 39 | transition t_20 :={ 40 | from := lbl_9_2; 41 | to := lbl_8_2; 42 | guard := ( (i <= 4) && (3 <= i) ); 43 | action:= j' = 1, tmp_1' = 0; 44 | }; 45 | transition t_17 :={ 46 | from := lbl_8_2; 47 | to := lbl_9_2; 48 | guard := ( (i <= 2) || (10 <= j) ); 49 | action:= i' = i+1, tmp' = i; 50 | }; 51 | transition t_18 :={ 52 | from := lbl_8_2; 53 | to := lbl_8_2; 54 | guard := ( (3 <= i) && (j <= 9) ); 55 | action:= j' = j+1, tmp_1' = j; 56 | }; 57 | } 58 | strategy dumb { 59 | Region init := { state = start }; 60 | } 61 | 62 | -------------------------------------------------------------------------------- /core/src/test/resources/fast/while2.fst: -------------------------------------------------------------------------------- 1 | //! @tags complexity 2 | //! @citations AliasDFG10 3 | 4 | //Generated by c2fsm -cut -nodiv -int 5 | model main { 6 | var N,i,j; 7 | //parameters N; 8 | states stop,start,lbl_7_2,lbl_6_2; 9 | transition t_18 :={ 10 | from := start; 11 | to := stop; 12 | guard := (N <= 0); 13 | action:= i' = N; 14 | }; 15 | transition t_25 :={ 16 | from := start; 17 | to := lbl_6_2; 18 | guard := (1 <= N); 19 | action:= i' = N, j' = N-1; 20 | }; 21 | transition t_16 :={ 22 | from := lbl_7_2; 23 | to := stop; 24 | guard := (i <= 0); 25 | action:=; 26 | }; 27 | transition t_22 :={ 28 | from := lbl_7_2; 29 | to := lbl_7_2; 30 | guard := ( (N <= 0) && (1 <= i) ); 31 | action:= i' = i-1, j' = N; 32 | }; 33 | transition t_23 :={ 34 | from := lbl_7_2; 35 | to := lbl_6_2; 36 | guard := ( (1 <= N) && (1 <= i) ); 37 | action:= j' = N-1; 38 | }; 39 | transition t_20 :={ 40 | from := lbl_6_2; 41 | to := lbl_7_2; 42 | guard := (j <= 0); 43 | action:= i' = i-1; 44 | }; 45 | transition t_21 :={ 46 | from := lbl_6_2; 47 | to := lbl_6_2; 48 | guard := (1 <= j); 49 | action:= j' = j-1; 50 | }; 51 | } 52 | strategy dumb { 53 | Region init := { state = start }; 54 | } 55 | 56 | -------------------------------------------------------------------------------- /core/src/test/resources/javatest/A.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/A.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/Abs.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/Abs.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/Abs1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/Abs1.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/Abs2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/Abs2.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/B.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/B.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/InstantiableInterface.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/InstantiableInterface.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/K.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/K.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/ListA.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/ListA.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/ListA2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/ListA2.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/ListA3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/ListA3.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/ListInterface.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/ListInterface.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/ListInterface2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/ListInterface2.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/ListInterface3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/ListInterface3.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/ListInterface4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/ListInterface4.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/NoAbs1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/NoAbs1.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/OtherInterface.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/OtherInterface.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/Pair.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/Pair.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/ParameterTest.java: -------------------------------------------------------------------------------- 1 | package javatest; 2 | 3 | public class ParameterTest { 4 | 5 | int emptyInt() { 6 | return 0; 7 | } 8 | 9 | ParameterTest emptyNull() { 10 | return null; 11 | } 12 | 13 | ParameterTest emptyThis() { 14 | return this; 15 | } 16 | 17 | int unusedParameters(int a, ParameterTest b, int c) { 18 | return 0; 19 | } 20 | ParameterTest returnParameter(int a, ParameterTest b) { 21 | return b; 22 | } 23 | 24 | ParameterTest returnThis(int a, ParameterTest b) { 25 | return this; 26 | } 27 | 28 | ParameterTest create() { 29 | ParameterTest a; 30 | a = new ParameterTest(); 31 | return a; 32 | } 33 | 34 | ParameterTest create2(int x, ParameterTest y) { 35 | ParameterTest a; 36 | a = new ParameterTest(); 37 | y = a; 38 | return y; 39 | } 40 | 41 | ParameterTest createCall(int x, ParameterTest y) { 42 | ParameterTest a; 43 | a = new ParameterTest(); 44 | y = a; 45 | y = returnParameterS(x,a); 46 | return y; 47 | } 48 | 49 | static int emptyIntS() { 50 | return 0; 51 | } 52 | 53 | static ParameterTest emptyNullS() { 54 | return null; 55 | } 56 | 57 | static int unusedParametersS(int a, ParameterTest b, int c) { 58 | return 0; 59 | } 60 | 61 | static ParameterTest returnParameterS(int a, ParameterTest b) { 62 | return b; 63 | } 64 | 65 | 66 | } 67 | -------------------------------------------------------------------------------- /core/src/test/resources/javatest/R3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/R3.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/S1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/S1.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/S2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/S2.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/S3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/S3.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/S4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/S4.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/S5.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/S5.class -------------------------------------------------------------------------------- /core/src/test/resources/javatest/SimpleTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jandom-devel/Jandom/7133115bfca17ac2e30dbc5a2772cbaf0e7bf4fc/core/src/test/resources/javatest/SimpleTest.class -------------------------------------------------------------------------------- /core/src/test/resources/jimpletest/jimpletest.A.jimple: -------------------------------------------------------------------------------- 1 | class jimpletest.A extends java.lang.Object 2 | { 3 | 4 | void () 5 | { 6 | jimpletest.A this; 7 | 8 | this := @this: javatest.A; 9 | 10 | specialinvoke this.()>(); 11 | 12 | return; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /core/src/test/resources/jimpletest/jimpletest.B.jimple: -------------------------------------------------------------------------------- 1 | class jimpletest.B extends java.lang.Object 2 | { 3 | 4 | void () 5 | { 6 | jimpletest.B this; 7 | 8 | this := @this: javatest.B; 9 | 10 | specialinvoke this.()>(); 11 | 12 | return; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /core/src/test/resources/jimpletest/jimpletest.ListA.jimple: -------------------------------------------------------------------------------- 1 | class jimpletest.ListA extends java.lang.Object 2 | { 3 | jimpletest.ListA next; 4 | jimpletest.A v; 5 | 6 | void () 7 | { 8 | jimpletest.ListA this; 9 | 10 | this := @this: jimpletest.ListA; 11 | 12 | specialinvoke this.()>(); 13 | 14 | return; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /core/src/test/resources/jimpletest/jimpletest.Pair.jimple: -------------------------------------------------------------------------------- 1 | class jimpletest.Pair extends java.lang.Object 2 | { 3 | jimpletest.A v; 4 | jimpletest.B w; 5 | 6 | void () 7 | { 8 | javatest.Pair this; 9 | 10 | this := @this: jimpletest.Pair; 11 | 12 | specialinvoke this.()>(); 13 | 14 | return; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /core/src/test/resources/random/array.limit.R: -------------------------------------------------------------------------------- 1 | ## Scansione array di n elementi 2 | ## 3 | ## BOX: 4 | ## invariante: 1<=n, 1<=x 5 | ## 6 | ## ROTATED BOX, COMBINED BOX: come BOX il problema è che la PCA tiene separati gli assi x e k 7 | ## 8 | ## both ROTATED BOX with GENERATORS and SIMPLIFY : nulla, si potrebbe migliorare il trattamento di assume 9 | ## ----- both COMBINED BOX with GENERATORS and SIMPLIFY 10 | ## invariante: 1<=n, 1<=x, x-n<=1 11 | ## 12 | ## ROTATED BOX AD HOC: 13 | ## analyze.function(array.limit,rotatedbox.domain(solve(matrix(c(-1,1,1,0),nrow=2, byrow=TRUE))), vars=c("n","x")) 14 | ## invariante: 1<=n, x-n<=1 15 | ## COMBINED BOX AD HOC: combinazione di BOX e ROTATED BOX AD-HOC 16 | ## 17 | ## notare che se prendo assi molto simili (n, x-1.1*n) non riesco più ad avere 18 | ## nessuna informazione su x-n 19 | 20 | array.limit=function(n) { 21 | assume(n>=1) 22 | x=1 23 | while (x=0) { 22 | x = x-1 23 | if (brandom()) 24 | y = y+1 25 | } 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /core/src/test/resources/random/octagon-3.R: -------------------------------------------------------------------------------- 1 | ## Octagon-3: the third program example in Octagon paper [Mine06] 2 | 3 | ## TARGET: at the end, n <= x <= n+1, 0 <= n 4 | ## BOX: 0 <= n 5 | ## PTOPE: n <= x 6 | ## --- COMBINED: n <= x <= n+1, 0 <= n 7 | ## --- OCTAGON: come COMBINED 8 | 9 | ## ICA like PCA 10 | 11 | if (FALSE) " 12 | /* Versione INTERPROC */ 13 | var x: real, n: real; 14 | begin 15 | x=0; 16 | assume n>=0; 17 | while x=0) 26 | while (x0 do 19 | x = x+1; 20 | i = i-1; 21 | done; 22 | end 23 | " 24 | 25 | octagon4 = function() { 26 | i = 16 27 | x = 1 28 | while (i>0) { 29 | x = x+1 30 | i = i-1 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /core/src/test/resources/random/octagon-5.R: -------------------------------------------------------------------------------- 1 | ## Octagon-5: the fifth program example in Octagon paper [Mine06] 2 | ## Absolute Value 3 | 4 | ## TARGET: inside the last if: -69 <= x <= 69, 0 <= y <=69 5 | ## BOX: -100 <= x <= 100, 0 <= y <=69 6 | ## PTOPE: -69<=x<=69 , 0<=y<=138 7 | ## COMBO: OK 8 | ## ---- OCTAGON: OK 9 | 10 | ## ICA like PCA, but it also works with theta=0.98 while PCA does not work in this case 11 | if (FALSE) " 12 | /* Versione INTERPROC */ 13 | var x:real, y:real; 14 | begin 15 | assume x>=-100 and x<=100; 16 | y=x; 17 | if y<=0 then 18 | y=-y; 19 | endif; 20 | if y<=69 then 21 | skip; 22 | endif; 23 | end 24 | " 25 | 26 | absval = function (x) { 27 | assume(x>=-100 && x <=100) 28 | y=x 29 | if (y<=0) y = -y 30 | if (y<=69) y = y 31 | } 32 | 33 | absval.cases = list( 34 | list(x=-100), list(x=-10), list(x=0), list(x=10), list(x=100) 35 | ) 36 | 37 | list(absval, absval.cases) 38 | 39 | -------------------------------------------------------------------------------- /core/src/test/resources/random/octagon-6.R: -------------------------------------------------------------------------------- 1 | ## Octagon-6: the sixth program example in Octagon paper [Mine06] 2 | ## RATE LIMITER 3 | 4 | ## TARGET: at the beginning of while: -128 <= y <= 128 5 | ## BOX: no 6 | ## PTOPE: no 7 | ## COMBO: no 8 | ## --- OCTAGON: -144 <= y <= 144 using widening with threshold 9 | 10 | ## PTOPE ad-hoc 1: y <= 160 using delayed widenings and matrix 11 | ## y x d s r 12 | ## PC1 1 0 0 0 0 13 | ## PC2 0 1 0 0 0 14 | ## PC3 0 0 1 0 0 15 | ## PC4 0 -1 0 1 1 16 | ## PC5 0 0 -1 1 0 17 | 18 | ## PTOPE ad-hoc 2: -160 <= y using delayed widenings and matrix 19 | ## y x d s r 20 | ## PC5 0 0 1 1 0 (other rows as above) 21 | 22 | ## COMBO ad-hoc: -128 <= y <= 128 using delayed widenings and matrix 23 | ## y x d s r 24 | ## PC3 0 0 1 1 0 (other rows as PTOPE ad-hoc 1) 25 | 26 | ## ICA: singular matrix! 27 | 28 | ratelim = function() { 29 | y=0 30 | while (brandom()) { 31 | x = trunc(runif(1,-128,129)) 32 | assume(x>=-128 && x<=128) 33 | d = trunc(runif(1,0,17)) 34 | assume(d>=0 && d<=16) 35 | s = y 36 | r = x-s 37 | y = x 38 | if (r<=-d) y = s-d 39 | if (d<=r) y = s+d 40 | } 41 | } 42 | 43 | ratelim.cases = function(n) { 44 | lapply(1:n,function(n) list()) 45 | } 46 | 47 | list(ratelim, ratelim.cases(10)) 48 | 49 | -------------------------------------------------------------------------------- /core/src/test/resources/random/octagon-6bis.R: -------------------------------------------------------------------------------- 1 | ## Octagon-6bis: the sixth program example in Octagon paper [Mine06] 2 | ## RATE LIMITER 3 | 4 | ## The while condition has been changed to TRUE. The use of brandom makes 5 | ## the executions traces too small. 6 | ## In a previous bugged version of RANDOM this was relevant, but now it isn't: 7 | ## PCA/OSCA does not find good axes in any case. 8 | 9 | ## ICA: singular matrix 10 | 11 | ratelim = function() { 12 | y=0 13 | while (TRUE) { 14 | x = trunc(runif(1,-128,129)) 15 | assume(x>=-128 && x<=128) 16 | d = trunc(runif(1,0,17)) 17 | assume(d>=0 && d<=16) 18 | s = y 19 | r = x-s 20 | y=x 21 | if (r<=-d) y=s-d 22 | if (d<=r) y=s+d 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /core/src/test/resources/random/parallel.lines.R: -------------------------------------------------------------------------------- 1 | ### 2 | ### Parallels: two exponentials computed in parallel 3 | ### 4 | 5 | ## 6 | ## Both PCA and OSCA cannot find any result 7 | ## Using the matrix: 8 | ## 1 -1 9 | ## 1 -2 10 | ## we can prove the invariant x=y. 11 | ## The matrix can be found as follows (maybe): 12 | ## - find the first principal component of the PCA 13 | ## - remove all points which have variance zero, and find again 14 | ## the first principal component of the PCA 15 | 16 | ## ICA with theta=0.80 singular 17 | ## ICA with theta=0.98 OK! 18 | 19 | parallel.lines = function() { 20 | x=1 21 | y=1 22 | while (TRUE) { 23 | x = x+y 24 | y = 2*y 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /core/src/test/resources/random/policy-1.R: -------------------------------------------------------------------------------- 1 | # This example appear in the paper 2 | # "A Policy Iteration Algorithm for Computing Fixed Points in 3 | # Static Analysis of Programs" 4 | # 5 | # Other examples in http://www.di.ens.fr/~goubault/Politiques 6 | # 7 | # Not very interesting. It is only used to check performance of interval 8 | # analysis. 9 | 10 | policy1 <- function() 11 | { 12 | i=1 13 | j=10 14 | while (j>=i) { 15 | i = i+2; 16 | j = -1+j; 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /core/src/test/resources/random/policy-2.R: -------------------------------------------------------------------------------- 1 | # This example appear in the paper 2 | # "A Policy Iteration Algorithm for Computing Fixed Points in 3 | # Static Analysis of Programs" 4 | # 5 | # Other examples in http://www.di.ens.fr/~goubault/Politiques 6 | # 7 | # Policy iteration may prove that, at the end of the example, 8 | # it is the case that j <= 120. Box, ptopes, octagon, polyhedra 9 | # cannot prove it. 10 | 11 | # ICA: singular 12 | 13 | 14 | if (FALSE) " 15 | /* Interproc versione */ 16 | var i:real, j:real, k:real; 17 | begin 18 | i = 0; 19 | k = 9; 20 | j = -100; 21 | while (i<=100) do 22 | i = i+1; 23 | while (j<20) do 24 | j = i+j; 25 | done; 26 | k = 4; 27 | while (k<=3) do 28 | k = k+1; 29 | done; 30 | done; 31 | end 32 | " 33 | 34 | policy2 <- function() 35 | { 36 | i = 0 37 | k = 9 38 | j = -100 39 | while (i<=100) { 40 | i = i+1 41 | while (j<20) 42 | j = i+j 43 | k = 4 44 | while (k<=3) 45 | k = k+1 46 | } 47 | } 48 | 49 | 50 | -------------------------------------------------------------------------------- /core/src/test/resources/random/precise.ineq.R: -------------------------------------------------------------------------------- 1 | # 2 | # Strict Inequalitities 3 | # 4 | # This example wants to show that inequalities and disequalities 5 | # are handled very precisely in RANDOM. 6 | # 7 | 8 | # 9 | # Target: at the end, x=4, y=0, z=0 10 | # Intervals et al in RANDOM: OK! 11 | # Intervals et octagon in INTERPROC: 0<=y<=1, 0<=z<=1 12 | 13 | if (FALSE) " 14 | /* INTEPROC version */ 15 | var x:real, y:real, z:real; 16 | begin 17 | x=4; 18 | y=0; 19 | z=0; 20 | if (x<4) 21 | y=1; 22 | endif; 23 | if (x!=4) 24 | z=1; 25 | endif 26 | end 27 | " 28 | 29 | precise.ineq = function() { 30 | x = 4 31 | y = 0 32 | z = 0 33 | if (x<4) y=1 34 | if (x!=4) z=1 35 | } 36 | -------------------------------------------------------------------------------- /core/src/test/resources/random/provatest.R: -------------------------------------------------------------------------------- 1 | ### Prova della implementazione operazione select, e confronto con APRON 2 | 3 | if (FALSE) " 4 | Versione INTERPROC 5 | 6 | proc testtry () returns (res: int) var x: int, y:int, z:int; 7 | begin 8 | assume x >= 0 and y >= 0 and x <= 1 and y<=1; 9 | assume z >= 0 and z <= 5; 10 | if -x-y+z+1<=0 then 11 | res=1; 12 | else 13 | res=0; 14 | endif; 15 | end 16 | 17 | var r:int; 18 | begin 19 | r = testtry(); 20 | end 21 | " 22 | 23 | 24 | test.try = function() { 25 | assume(0 <=x && x <= 1) 26 | assume(0 <=y && y <= 1) 27 | assume(0 <= z && z <= 5) 28 | if ( -x - y + z + 1<=0) 29 | res=1 30 | else 31 | res=0 32 | } 33 | -------------------------------------------------------------------------------- /core/src/test/resources/random/ratelim-monniaux.R: -------------------------------------------------------------------------------- 1 | ratelim_monniaux = function() { 2 | x_old = 0 3 | while (TRUE) { 4 | assume(x>= -100000 && x <=100000) 5 | if (x > x_old+10) x= x_old +10 6 | if (x < x_old-10) x= x_old -10 7 | x_old = x 8 | } 9 | } -------------------------------------------------------------------------------- /core/src/test/resources/random/reviewer3.R: -------------------------------------------------------------------------------- 1 | # 2 | # Program suggested by reviewer 3 of JSC 3 | # 4 | 5 | # Target: at the beggining of while: y <= 2x, y >= -2x 6 | # PCA and ICA find the standard axes 7 | # Ad-Hoc matrices work 8 | 9 | reviewer3 <- function () { 10 | x = 0 11 | y = 0 12 | while ( TRUE ) { 13 | y = y + 1; 14 | if ( brandom() ) 15 | x = 2 * y 16 | else 17 | x = - 2 * y 18 | } 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /core/src/test/resources/random/trydoublematrix.R: -------------------------------------------------------------------------------- 1 | f = function() { 2 | x = 0 3 | while (x < 100) { 4 | x = x + 1 5 | y = 0 6 | while (y < x) 7 | y = y + 1 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /core/src/test/resources/random/trygeneralptopes.R: -------------------------------------------------------------------------------- 1 | f <- function() { 2 | x = 1 3 | y = 1 4 | while (y < 100) { 5 | y = y + y 6 | y = y + y 7 | x = x + x 8 | x = x + x 9 | } 10 | } 11 | 12 | 13 | -------------------------------------------------------------------------------- /core/src/test/resources/random/widening.R: -------------------------------------------------------------------------------- 1 | # Prova widening 2 | 3 | if (FALSE) " 4 | /* Versione INTERPROC di Wide */ 5 | var x:real,y:real; 6 | begin 7 | x=0; 8 | y=0; 9 | while (x<100) do 10 | x=x+1; 11 | if (brandom) then 12 | y=x; 13 | endif; 14 | done; 15 | end 16 | " 17 | 18 | wide = function(k) { 19 | x = 0 20 | y = 0 21 | while (x<100) { 22 | x=x+1 23 | if (k[x]<=0) y=x 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /core/src/test/resources/random/xyline.R: -------------------------------------------------------------------------------- 1 | ## Esempio di scansione della retta x + y = 0 2 | ## 3 | ## BOX: 4 | ## invariante while: -11<=x<=10 , -10<=y<=11 (-21<=x+y<=21, -22<=x-y<=20) 5 | ## 6 | ## ROTATED BOX no SIMPLIFY: 7 | ## invariante while: -1<=x<=127381033450515456 , -10<=y<=127381033450515456 , 8 | ## -2.04112019628891e-15<=x+y<=254762066901030880, -22<=x-y<=20 9 | ## COMBINED BOX no SIMPLIFY: 10 | ## invariante del while: -1<=x<=10 , -10<=y<=11, -2.04112019628891e-15<=x+y<=20, -2<=x-y<=20 11 | ## 12 | ## ----- both ROTATED BOX: 13 | ## invariante while: -1<=x<=10, -10<=y<=1, 0<=x+y<=0, -2<=x-y<=20 14 | ## both COMBINED BOX: 15 | ## invariante while: come ROTATED BOX 16 | ## 17 | ## INTERPROC: box come i nostri, octagon da gli stessi risultati del combined ad-hoc 18 | 19 | if (FALSE) " 20 | /* Versione INTERPROC */ 21 | 22 | var x:real, y:real; 23 | begin 24 | x=10; 25 | y=-10; 26 | while x>y do 27 | x= x-1; 28 | y= y+1; 29 | done; 30 | end 31 | " 32 | 33 | xyline=function() { 34 | x=10 35 | y=-10 36 | while(x>y) { 37 | x= x-1 38 | y= y+1 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /core/src/test/resources/random/xyline.param.R: -------------------------------------------------------------------------------- 1 | ## Versione parametrica di xyline 2 | ## 3 | ## BOX: 4 | ## invariante: 0<=k 5 | ## 6 | ## ROTATED BOX, COMBINED BOX: come BOX 7 | ## le tre componenti principali sono "k, x+y, x-y" e quindi non si ha relazione tra k ed x, y 8 | ## 9 | ## ROTATED BOX with GENERATOR (10): 10 | ## invariante: x-k<=0, 0<=k+x+2*y 11 | ## COMBINED BOX with GENERATOR (10): 12 | ## invariante: come ROTATED BOX + BOX, in più -k-x+y<=2 13 | ## 14 | ## inverted ROTATED BOX with GENERATOR (10): nulla 15 | ## inverted COMBINED BOX with GENERATOR (10): come BOX 16 | ## 17 | ## ROTATED BOX AD HOC: 18 | ## analyze.function(xyline.param,rotatedbox.domain(solve(matrix(c(1,0,-1,1,-1,0,1,1,0),nrow=3, byrow=TRUE))), vars=c("x","y","k"),displayed.forms=c("x","y","k","x-y","x+y","x-k","k+x+2*y","-k-x+y")) 19 | ## invariante: -1<=x, y<=1, -1<=k, -2<=x-y, 0<=x+y<=0, x-k<=0 (0<=k+x+2*y, -k-x+y<=3) 20 | ## ----- COMBINED BOX AD HOC: 21 | ## stessa matrice di cui sopra 22 | ## invariante come sopra, in più: 0<=k (-k-x+y<=2) 23 | ## 24 | ## INTERPROC 25 | ## box: stessi risultati dei nostri box 26 | ## octagon: ottengo gli stessi risultati di Ad-Hoc Combined Box. Ma il nostro tool consente anche di ottenere 27 | ## proprietà derivate come 0<=k+x+2*y 28 | ## 29 | 30 | xyline.param=function(k) { 31 | assume(k>0) 32 | x=k 33 | y=-k 34 | while(x>y) { 35 | x= x-1 36 | y= y+1 37 | } 38 | } 39 | 40 | xyline.param.cases = function(n) { 41 | params=list() 42 | for (i in 1:n) 43 | params=c(params,list(list(k=i))) 44 | return(params) 45 | } 46 | 47 | list(xyline.param, xyline.param.cases(10)) 48 | -------------------------------------------------------------------------------- /core/src/test/resources/random/xyline.param2.R: -------------------------------------------------------------------------------- 1 | ## Versione parametrica di xyline più "buona" 2 | ## 3 | ## BOX invariante: nulla 4 | ## ROTATED BOX with GENERATORS new SIMPLIFY: -Inf<=-x+y<=Inf , 0<=x+y<=0 5 | ## COMBO BOX with GENERATORS new SIMPLIFY: -1<=x<=Inf , -Inf<=y<=1 : -Inf<=-x+y<=2 , 0<=x+y<=0 6 | 7 | xyline.param2=function(x) { 8 | assume(x>0) 9 | y=-x 10 | .tracetag(3) 11 | while(x>y) { 12 | x= x-1 13 | y= y+1 14 | } 15 | } 16 | 17 | xyline.param2.cases = function(n) { 18 | params=list() 19 | for (i in 1:n) 20 | params=c(params,list(list(x=i))) 21 | return(params) 22 | } 23 | 24 | list(xyline.param2, xyline.param2.cases(10)) 25 | -------------------------------------------------------------------------------- /core/src/test/scala/it/unich/jandom/domains/EmptyExistsSuite.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of a 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.domains 20 | 21 | /** 22 | * This is a trait for testing those domains where the bottom element 23 | * represents emptyness in each fiber. 24 | * @author Gianluca Amato 25 | */ 26 | trait EmptyExistsSuite extends CartesianFiberedDomainSuite { 27 | describe("The bottom") { 28 | it("is empty") { 29 | forAll(someFibers) { (f) => 30 | assert(dom.bottom(f).isEmpty) 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /core/src/test/scala/it/unich/jandom/domains/PreciseIntersectionSuite.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2016 Jandom Team 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of a 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.domains 20 | 21 | /** 22 | * This is a trait for testing those domains where the intersection 23 | * operation computes the greatest lower bound. 24 | * @author Gianluca Amato 25 | */ 26 | trait PreciseIntersectionSuite extends CartesianFiberedDomainSuite { 27 | describe("The intersection method") { 28 | it("returns a lower bound") { 29 | forAll(someCoupleProperties) { (p1, p2) => 30 | assert((p1 intersection p2) <= p2) 31 | assert((p1 intersection p2) <= p1) 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /core/src/test/scala/it/unich/jandom/domains/objects/PreciseDefiniteNullness.scala: -------------------------------------------------------------------------------- 1 | 2 | package it.unich.jandom.domains.objects 3 | 4 | /** 5 | * This suite implements tests for those object domain which precisely track 6 | * definite nullness. 7 | * Created by amato on 4/1/14. 8 | */ 9 | trait PreciseDefiniteNullness extends ObjectDomainSuite { 10 | 11 | describe("The bottom element") { 12 | it("has all variable definitively null") { 13 | forAll (someFibersAndVars) { (fiber, i) => 14 | assert(dom.bottom(fiber).mustBeNull(i)) 15 | } 16 | } 17 | } 18 | 19 | describe("The assignNull method") { 20 | it("makes variable definitively null") { 21 | forAll (somePropertiesAndVars) { (p,i) => 22 | assert(p.assignNull(i).mustBeNull(i)) 23 | } 24 | } 25 | it("should produce a lesser property than top") { 26 | forAll (someFibersAndVars) { (f,i) => 27 | val top = dom.top(f) 28 | assert(top.assignNull(i) < top) 29 | } 30 | } 31 | } 32 | 33 | describe("The testNull method") { 34 | it("is the identity on bottom") { 35 | forAll(someFibersAndVars) { (fiber, j) => 36 | assert(dom.bottom(fiber).testNull(j).isBottom) 37 | } 38 | } 39 | } 40 | 41 | describe("The testNotNull method") { 42 | it("is identity on bottom") { 43 | forAll(someFibersAndVars) { (fiber, j) => 44 | assert(dom.bottom(fiber).testNotNull(j).isBottom) 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /core/src/test/scala/it/unich/jandom/domains/objects/PreciseDefiniteWeakAliasing.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of a 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.domains.objects 20 | 21 | /** 22 | * A trait for testing object domains which precisely implements definite weak aliasing 23 | * @author Gianluca Amato 24 | * 25 | */ 26 | trait PreciseDefiniteWeakAliasing extends ObjectDomainSuite { 27 | 28 | describe("The bottom element") { 29 | it("has all variables definitively weak aliased") { 30 | forAll(someFibersAndTwoVars) { (fiber, i, j) => 31 | assert(dom.bottom(fiber).mustBeWeakAliases(i, j)) 32 | } 33 | } 34 | } 35 | 36 | describe("The assignVariable method") { 37 | it("makes variables definitively aliases") { 38 | forAll(someAssignVariable) { (p, dst, src) => 39 | assert(p.assignVariable(dst, src).mustBeWeakAliases(dst, src)) 40 | } 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /core/src/test/scala/it/unich/jandom/domains/objects/UPSuite.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2013 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty ofa 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.domains.objects 20 | 21 | import org.scalatest.funsuite.AnyFunSuite 22 | 23 | /** 24 | * Test suite for unordered pairs. 25 | * @author Gianluca Amato 26 | */ 27 | class UPSuite extends AnyFunSuite { 28 | test ("UP's are unrodered"){ assert( UP(2,3) == UP(3,2) )} 29 | test ("UP's may be trasnformed into ordered pairs") { assert( UP.unapply(UP(3,2)) === Some((2,3)) ) } 30 | test ("replacement of elements") { 31 | assert ( UP(2,3).replace(4,3) === UP(2,4)) 32 | assert ( UP(2,3).replace(3,3) === UP(2,3)) 33 | assert ( UP(2,3).replace(3,5) === UP(2,3)) 34 | } 35 | test ("containment check") { 36 | assert ( UP(2,3) contains 3 ) 37 | assert ( ! (UP(2,3) contains 4) ) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /core/src/test/scala/it/unich/jandom/objectmodels/TestObjectModelSuite.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of a 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.objectmodels 20 | 21 | import org.scalatest.funspec.AnyFunSpec 22 | 23 | /** 24 | * A test for the TestObjectModel. 25 | * @author Gianluca Amato 26 | */ 27 | class TestObjectModelSuite extends AnyFunSpec with ObjectModelSuite { 28 | val om = TestObjectModel 29 | val someTypes = Table[om.Type]("type", om.tsuper, om.tmiddle, om.tsub, om.tother, om.tprim) 30 | } 31 | -------------------------------------------------------------------------------- /core/src/test/scala/it/unich/jandom/objectmodels/TrivialObjectModelSuite.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of a 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.objectmodels 20 | 21 | import org.scalatest.funspec.AnyFunSpec 22 | 23 | /** 24 | * A test for the TrivialObjectModel. 25 | * @author Gianluca Amato 26 | */ 27 | class TrivialObjectModelSuite extends AnyFunSpec with ObjectModelSuite { 28 | val om = TrivialObjectModel 29 | val someTypes = Table("type", ()) 30 | } 31 | -------------------------------------------------------------------------------- /core/src/test/scala/it/unich/jandom/utils/IterableFunctionSuite.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 Gianluca Amato 3 | * 4 | * This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains 5 | * JANDOM is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * JANDOM is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty ofa 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with JANDOM. If not, see . 17 | */ 18 | 19 | package it.unich.jandom.utils 20 | 21 | import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks 22 | import org.scalatest.funspec.AnyFunSpec 23 | 24 | class IterableFunctionSuite extends AnyFunSpec with ScalaCheckPropertyChecks { 25 | describe("An empty iterable function") { 26 | val f = IterableFunction.empty[Int,Int] 27 | it("has empty domain") { 28 | assert(f.isEmpty) 29 | } 30 | } 31 | 32 | describe("An interable function derived from a map") { 33 | it("has the same functional behaviour of the map") { 34 | forAll { (m: Map[Int, Int]) => 35 | val f: IterableFunction[Int, Int] = m 36 | for ( (x,y) <- m.toSeq) assertResult(y) { f(x) } 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /project/CustomKeys.scala: -------------------------------------------------------------------------------- 1 | import sbt._ 2 | 3 | object CustomKeys { 4 | val apronJar = settingKey[Option[String]]("Location of the Apron library") 5 | val gmpJar = settingKey[Option[String]]("Location of the GMP library") 6 | val pplJar = settingKey[Option[String]]("Location of the PPL library") 7 | val gitHeadCommitSHA = taskKey[String]("Current git commit SHA") 8 | } 9 | -------------------------------------------------------------------------------- /project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=1.6.2 2 | -------------------------------------------------------------------------------- /project/plugins.sbt: -------------------------------------------------------------------------------- 1 | addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0") 2 | addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") 3 | addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3") 4 | addSbtPlugin("org.jetbrains" % "sbt-ide-settings" % "1.1.0") 5 | --------------------------------------------------------------------------------