ContractDR is a specification repair tool. It uses Counterexample-Guided Inductive Repair and Sketching to first find a repair for the specification and then tighten it, by finding the minimal repair that the repair sketch can synthesize.
ContractDR's repairs are sound, semantically minimal, that theoretically terminates.
Assuming you have Java 8, gradle, and git installed on your machine, you can follow these steps to setup ContractDR:
Clone JPF, and compile it:
$ git clone https://github.com/javapathfinder/jpf-core.git
$ cd jpf-core
$ gradle
Install ContractDR
$ cd ..
$ git clone https://github.com/sohah/ranger-discovery.git
$ cd ranger-discovery
$ ant
$ cd scripts
$ vim ToolExample.sh
update $DISCOVERYDIR, $JPFCORE
, and relative directories inside runDiscovery
alias to the appropriate
ranger-discovery
home directory installed on your machine.
Setup Z3
Z3_HOME
, in .bash_profile
export Z3_HOME=/z3installation
source ~/.bash_profile
Setup JKIND
Run ContractDR
cd $ContractDR_HOME/script
./ToolExample.sh
This command is going to repair a faulty WBS property in $ContractDR_HOME/src/DiscoveryExamples/ToolExample/Prop1/WBS_InvalidProp1.
prop1.jpf
contains the configuration for ContractDR.ContractDR's results
Repair attempts: ContractDR will attempt various dubious expressions:
WBS_InvalidProp1-REXPR-0--1
WBS_InvalidProp1-REXPR-1--1
WBS_InvalidProp1-REXPR-2--1
WBS_InvalidProp1-REXPR-3--1
WBS_InvalidProp1-REXPR-4--1
WBS_InvalidProp1-REXPR-5--1
WBS_InvalidProp1-REXPR-6--1
WBS_InvalidProp1-REXPR-7--1
WBS_InvalidProp1-REXPR-8--1
Repairs:
You can find ContractDR's repairs in
src/DiscoveryExamples/ToolExample/Prop1/wbs_all_prop1.txt
And generated unique repairs are in
src/DiscoveryExamples/ToolExample/Prop1/wbs_unique_prop1.txt
Repair Statistics:
src/DiscoveryExamples/ToolExample/Prop1/wbs_prop1_stats.txt