diff options
author | OszkarSemerath <semerath@mit.bme.hu> | 2022-04-01 21:19:41 +0200 |
---|---|---|
committer | OszkarSemerath <semerath@mit.bme.hu> | 2022-04-01 21:19:41 +0200 |
commit | a10534dde067632746f47a135dea949385035498 (patch) | |
tree | ed297193c051a26088683bae09ecd1c9e5115c30 | |
parent | Numeric solver fixes (diff) | |
download | VIATRA-Generator-a10534dde067632746f47a135dea949385035498.tar.gz VIATRA-Generator-a10534dde067632746f47a135dea949385035498.tar.zst VIATRA-Generator-a10534dde067632746f47a135dea949385035498.zip |
made Z3 optional dependency if there are no numbers
2 files changed, 24 insertions, 7 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/META-INF/MANIFEST.MF b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/META-INF/MANIFEST.MF index f5eb5514..49cf50b0 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/META-INF/MANIFEST.MF +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/META-INF/MANIFEST.MF | |||
@@ -25,7 +25,7 @@ Require-Bundle: hu.bme.mit.inf.dslreasoner.logic.model;bundle-version="1.0.0", | |||
25 | org.eclipse.xtext;bundle-version="2.10.0", | 25 | org.eclipse.xtext;bundle-version="2.10.0", |
26 | org.eclipse.viatra.transformation.runtime.emf;bundle-version="2.0.0", | 26 | org.eclipse.viatra.transformation.runtime.emf;bundle-version="2.0.0", |
27 | org.eclipse.xtext.xbase;bundle-version="2.10.0", | 27 | org.eclipse.xtext.xbase;bundle-version="2.10.0", |
28 | hu.bme.mit.inf.dslreasoner.ilp.cbc;bundle-version="1.0.0", | 28 | hu.bme.mit.inf.dslreasoner.ilp.cbc;bundle-version="1.0.0";resolution:=optional, |
29 | org.eclipse.viatra.query.runtime.rete;bundle-version="2.0.0", | 29 | org.eclipse.viatra.query.runtime.rete;bundle-version="2.0.0", |
30 | com.microsoft.z3 | 30 | com.microsoft.z3 |
31 | Bundle-RequiredExecutionEnvironment: JavaSE-11 | 31 | Bundle-RequiredExecutionEnvironment: JavaSE-11 |
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/NumericRefinementUnit.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/NumericRefinementUnit.xtend index b3e2d78d..0b765854 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/NumericRefinementUnit.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/NumericRefinementUnit.xtend | |||
@@ -35,8 +35,8 @@ class NumericRefinementUnit { | |||
35 | var ThreadContext threadContext | 35 | var ThreadContext threadContext |
36 | val constraint2MustUnitPropagationPrecondition = new HashMap<PConstraint,ViatraQueryMatcher<? extends IPatternMatch>> | 36 | val constraint2MustUnitPropagationPrecondition = new HashMap<PConstraint,ViatraQueryMatcher<? extends IPatternMatch>> |
37 | val constraint2CurrentUnitPropagationPrecondition = new HashMap<PConstraint,ViatraQueryMatcher<? extends IPatternMatch>> | 37 | val constraint2CurrentUnitPropagationPrecondition = new HashMap<PConstraint,ViatraQueryMatcher<? extends IPatternMatch>> |
38 | var NumericTranslator translator = null; | 38 | var NumericTranslator _translator = null; |
39 | 39 | val ViatraReasonerConfiguration config | |
40 | 40 | ||
41 | val boolean intermediateConsistencyCheck | 41 | val boolean intermediateConsistencyCheck |
42 | val boolean caching; | 42 | val boolean caching; |
@@ -53,7 +53,15 @@ class NumericRefinementUnit { | |||
53 | this.intermediateConsistencyCheck = config.runIntermediateNumericalConsistencyChecks | 53 | this.intermediateConsistencyCheck = config.runIntermediateNumericalConsistencyChecks |
54 | this.caching = caching | 54 | this.caching = caching |
55 | this.strategy = config.strategy | 55 | this.strategy = config.strategy |
56 | this.translator = new NumericTranslator(createNumericTranslator(config),config.numericSolverTimeout) | 56 | this._translator = null |
57 | this.config = config | ||
58 | } | ||
59 | |||
60 | def private getTranslator() { | ||
61 | if(_translator === null) { | ||
62 | _translator = new NumericTranslator(createNumericTranslator(config),config.numericSolverTimeout) | ||
63 | } | ||
64 | return _translator | ||
57 | } | 65 | } |
58 | 66 | ||
59 | def createNumericTranslator(ViatraReasonerConfiguration config) { | 67 | def createNumericTranslator(ViatraReasonerConfiguration config) { |
@@ -115,9 +123,18 @@ class NumericRefinementUnit { | |||
115 | def getCachingTime(){cachingTime} | 123 | def getCachingTime(){cachingTime} |
116 | def getNumberOfSolverCalls(){numberOfSolverCalls} | 124 | def getNumberOfSolverCalls(){numberOfSolverCalls} |
117 | def getNumberOfCachedSolverCalls(){numberOfCachedSolverCalls} | 125 | def getNumberOfCachedSolverCalls(){numberOfCachedSolverCalls} |
118 | def getSolverFormingProblem(){this.translator.formingProblemTime} | 126 | def getSolverFormingProblem(){ |
119 | def getSolverSolvingProblem(){this.translator.solvingProblemTime} | 127 | if(this._translator === null) { return 0; } |
120 | def getSolverSolution(){this.translator.formingSolutionTime} | 128 | else return this.translator.formingProblemTime |
129 | } | ||
130 | def getSolverSolvingProblem(){ | ||
131 | if(this._translator === null) { return 0; } | ||
132 | else this.translator.solvingProblemTime | ||
133 | } | ||
134 | def getSolverSolution(){ | ||
135 | if(this._translator === null) { return 0; } | ||
136 | else this.translator.formingSolutionTime | ||
137 | } | ||
121 | def getNumericSolverSelection(){this.translator.numericSolver} | 138 | def getNumericSolverSelection(){this.translator.numericSolver} |
122 | 139 | ||
123 | def boolean maySatisfiable() { | 140 | def boolean maySatisfiable() { |