diff options
Diffstat (limited to 'Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericDrealProblemSolver.java')
-rw-r--r-- | Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericDrealProblemSolver.java | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericDrealProblemSolver.java b/Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericDrealProblemSolver.java index 94dfdac0..1e5742b7 100644 --- a/Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericDrealProblemSolver.java +++ b/Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericDrealProblemSolver.java | |||
@@ -18,7 +18,7 @@ import org.eclipse.xtext.xbase.XExpression; | |||
18 | 18 | ||
19 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PrimitiveElement; | 19 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PrimitiveElement; |
20 | 20 | ||
21 | public class NumericDrealProblemSolver { | 21 | public class NumericDrealProblemSolver extends NumericProblemSolver{ |
22 | private static final String N_Base = "org.eclipse.xtext.xbase.lib."; | 22 | private static final String N_Base = "org.eclipse.xtext.xbase.lib."; |
23 | private static final String N_PLUS = "operator_plus"; | 23 | private static final String N_PLUS = "operator_plus"; |
24 | private static final String N_MINUS = "operator_minus"; | 24 | private static final String N_MINUS = "operator_minus"; |
@@ -40,10 +40,6 @@ public class NumericDrealProblemSolver { | |||
40 | private String containerName; | 40 | private String containerName; |
41 | private Map<Object, String> varMap; | 41 | private Map<Object, String> varMap; |
42 | 42 | ||
43 | long endformingProblem=0; | ||
44 | long endSolvingProblem=0; | ||
45 | long endFormingSolution=0; | ||
46 | |||
47 | public NumericDrealProblemSolver() throws IOException, InterruptedException { | 43 | public NumericDrealProblemSolver() throws IOException, InterruptedException { |
48 | //setup smt2 input file | 44 | //setup smt2 input file |
49 | tempFile = File.createTempFile("smt", ".smt2"); | 45 | tempFile = File.createTempFile("smt", ".smt2"); |
@@ -70,7 +66,7 @@ public class NumericDrealProblemSolver { | |||
70 | varMap = new HashMap<Object, String>(); | 66 | varMap = new HashMap<Object, String>(); |
71 | } | 67 | } |
72 | 68 | ||
73 | public Process runProcess(List<String> cmd) throws IOException, InterruptedException { | 69 | private Process runProcess(List<String> cmd) throws IOException, InterruptedException { |
74 | // println(cmd) | 70 | // println(cmd) |
75 | ProcessBuilder pb = new ProcessBuilder(cmd); | 71 | ProcessBuilder pb = new ProcessBuilder(cmd); |
76 | pb.redirectOutput(); | 72 | pb.redirectOutput(); |
@@ -84,17 +80,6 @@ public class NumericDrealProblemSolver { | |||
84 | return p; | 80 | return p; |
85 | } | 81 | } |
86 | 82 | ||
87 | public long getEndformingProblem() { | ||
88 | return endformingProblem; | ||
89 | } | ||
90 | |||
91 | public long getEndSolvingProblem() { | ||
92 | return endSolvingProblem; | ||
93 | } | ||
94 | |||
95 | public long getEndFormingSolution() { | ||
96 | return endFormingSolution; | ||
97 | } | ||
98 | // | 83 | // |
99 | // private ArrayList<JvmIdentifiableElement> getJvmIdentifiableElements(XExpression expression) { | 84 | // private ArrayList<JvmIdentifiableElement> getJvmIdentifiableElements(XExpression expression) { |
100 | // ArrayList<JvmIdentifiableElement> allElem = new ArrayList<JvmIdentifiableElement>(); | 85 | // ArrayList<JvmIdentifiableElement> allElem = new ArrayList<JvmIdentifiableElement>(); |
@@ -115,7 +100,7 @@ public class NumericDrealProblemSolver { | |||
115 | // } | 100 | // } |
116 | // } | 101 | // } |
117 | 102 | ||
118 | public Process callDreal() throws IOException, InterruptedException { | 103 | private Process callDreal() throws IOException, InterruptedException { |
119 | List<String> drealCmd = new ArrayList<String>( | 104 | List<String> drealCmd = new ArrayList<String>( |
120 | Arrays.asList("docker", "exec", | 105 | Arrays.asList("docker", "exec", |
121 | containerName, | 106 | containerName, |
@@ -125,7 +110,7 @@ public class NumericDrealProblemSolver { | |||
125 | return runProcess(drealCmd); | 110 | return runProcess(drealCmd); |
126 | } | 111 | } |
127 | 112 | ||
128 | public boolean getDrealResult(Process p) throws IOException { | 113 | private boolean getDrealResult(Process p) throws IOException { |
129 | if (p.exitValue() == 1) {return false;} | 114 | if (p.exitValue() == 1) {return false;} |
130 | 115 | ||
131 | BufferedReader output = new BufferedReader(new InputStreamReader(p.getInputStream())); | 116 | BufferedReader output = new BufferedReader(new InputStreamReader(p.getInputStream())); |