Commit b36a3c1f authored by LULUDBR\Lulu's avatar LULUDBR\Lulu

Merge remote-tracking branch 'origin/master'

parents f323aa01 9f657295
package edu.kit.iti.formal.psdbg.termmatcher; package edu.kit.iti.formal.psdbg.termmatcher;
import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.logic.Semisequent; import de.uka.ilkd.key.logic.Semisequent;
import de.uka.ilkd.key.logic.Sequent; import de.uka.ilkd.key.logic.Sequent;
import de.uka.ilkd.key.logic.Term; import de.uka.ilkd.key.logic.Term;
...@@ -21,8 +22,8 @@ import org.apache.logging.log4j.Logger; ...@@ -21,8 +22,8 @@ import org.apache.logging.log4j.Logger;
public class MatcherFacade { public class MatcherFacade {
private static Logger logger = LogManager.getLogger(MatcherFacade.class); private static Logger logger = LogManager.getLogger(MatcherFacade.class);
public static Matchings matches(String pattern, Term keyTerm) { public static Matchings matches(String pattern, Term keyTerm, Services services) {
MatcherImpl matcher = new MatcherImpl(); MatcherImpl matcher = new MatcherImpl(services);
matcher.setCatchAll(false); matcher.setCatchAll(false);
MatchPatternParser mpp = getParser(pattern); MatchPatternParser mpp = getParser(pattern);
MatchPatternParser.TermPatternContext ctx = mpp.termPattern(); MatchPatternParser.TermPatternContext ctx = mpp.termPattern();
...@@ -50,12 +51,13 @@ public class MatcherFacade { ...@@ -50,12 +51,13 @@ public class MatcherFacade {
* @param pattern Semisequent pattern e.g. f(x), f(x) * @param pattern Semisequent pattern e.g. f(x), f(x)
* @param semiSeq Concrete KeY Semisequent * @param semiSeq Concrete KeY Semisequent
* @param catchAll * @param catchAll
* @param services
* @return Matchings * @return Matchings
*/ */
public static Matchings matches(String pattern, Semisequent semiSeq, boolean catchAll) { public static Matchings matches(String pattern, Semisequent semiSeq, boolean catchAll, Services services) {
MatchPatternParser mpp = getParser(pattern); MatchPatternParser mpp = getParser(pattern);
MatchPatternParser.SemiSeqPatternContext ctx = mpp.semiSeqPattern(); MatchPatternParser.SemiSeqPatternContext ctx = mpp.semiSeqPattern();
MatcherImpl matcher = new MatcherImpl(); MatcherImpl matcher = new MatcherImpl(services);
matcher.setCatchAll(catchAll); matcher.setCatchAll(catchAll);
Matchings m = matcher.accept(ctx, MatchPathFacade.createRoot(semiSeq)); Matchings m = matcher.accept(ctx, MatchPathFacade.createRoot(semiSeq));
return m; return m;
...@@ -67,9 +69,10 @@ public class MatcherFacade { ...@@ -67,9 +69,10 @@ public class MatcherFacade {
* *
* @param pattern e.g., f(x) ==> f(y) * @param pattern e.g., f(x) ==> f(y)
* @param sequent * @param sequent
* @param services
* @return * @return
*/ */
public static Matchings matches(String pattern, Sequent sequent, boolean catchAll) { public static Matchings matches(String pattern, Sequent sequent, boolean catchAll, Services services) {
MatchPatternParser mpp = getParser(pattern); MatchPatternParser mpp = getParser(pattern);
MatchPatternParser.SequentPatternContext ctx = mpp.sequentPattern(); MatchPatternParser.SequentPatternContext ctx = mpp.sequentPattern();
logger.info("Matching \n" + pattern + "\n" + sequent.toString()); logger.info("Matching \n" + pattern + "\n" + sequent.toString());
...@@ -78,21 +81,22 @@ public class MatcherFacade { ...@@ -78,21 +81,22 @@ public class MatcherFacade {
return new Matchings(); return new Matchings();
} }
MatcherImpl matcher = new MatcherImpl(); MatcherImpl matcher = new MatcherImpl(services);
matcher.setCatchAll(catchAll); matcher.setCatchAll(catchAll);
Matchings m = matcher.accept(ctx, MatchPathFacade.create(sequent)); Matchings m = matcher.accept(ctx, MatchPathFacade.create(sequent));
return m; return m;
} }
/** /**
* Like {@link #matches(String, Sequent)} but allows to use * Like {@link #matches(String, Sequent, Services)} but allows to use
* MatcherImpl#isCatchAll. * MatcherImpl#isCatchAll.
* *
* @param pattern * @param pattern
* @param sequent * @param sequent
* @param services
* @return * @return
*/ */
public static Matchings matches(String pattern, Sequent sequent) { public static Matchings matches(String pattern, Sequent sequent, Services services) {
return matches(pattern, sequent, true); return matches(pattern, sequent, true, services);
} }
} }
package edu.kit.iti.formal.psdbg.termmatcher; package edu.kit.iti.formal.psdbg.termmatcher;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import de.uka.ilkd.key.logic.Semisequent; import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.logic.SequentFormula; import de.uka.ilkd.key.logic.*;
import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.op.QuantifiableVariable; import de.uka.ilkd.key.logic.op.QuantifiableVariable;
import edu.kit.formal.psdb.termmatcher.MatchPatternLexer; import edu.kit.formal.psdb.termmatcher.MatchPatternLexer;
import edu.kit.formal.psdb.termmatcher.MatchPatternParser; import edu.kit.formal.psdb.termmatcher.MatchPatternParser;
import edu.kit.iti.formal.psdbg.termmatcher.mp.MatchPath; import edu.kit.iti.formal.psdbg.termmatcher.mp.MatchPath;
import static edu.kit.iti.formal.psdbg.termmatcher.mp.MatchPathFacade.*;
import lombok.Getter; import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter; import lombok.Setter;
import org.antlr.v4.runtime.CommonToken; import org.antlr.v4.runtime.CommonToken;
import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.Token;
...@@ -20,21 +19,24 @@ import java.util.stream.Collectors; ...@@ -20,21 +19,24 @@ import java.util.stream.Collectors;
import java.util.stream.IntStream; import java.util.stream.IntStream;
import java.util.stream.Stream; import java.util.stream.Stream;
import static edu.kit.iti.formal.psdbg.termmatcher.mp.MatchPathFacade.*;
/** /**
* Matchpattern visitor visits the matchpatterns of case-statements * Matchpattern visitor visits the matchpatterns of case-statements
* *
* @author Alexander Weigl * @author Alexander Weigl
* @author S. Grebing * @author S. Grebing
*/ */
@RequiredArgsConstructor
class MatcherImpl extends MatchPatternDualVisitor<Matchings, MatchPath> { class MatcherImpl extends MatchPatternDualVisitor<Matchings, MatchPath> {
static final Matchings NO_MATCH = new Matchings(); static final Matchings NO_MATCH = new Matchings();
static final Matchings EMPTY_MATCH = Matchings.singleton("EMPTY_MATCH", null); static final Matchings EMPTY_MATCH = Matchings.singleton("EMPTY_MATCH", null);
static final Map<String, MatchPath> EMPTY_VARIABLE_ASSIGNMENT = EMPTY_MATCH.first(); static final Map<String, MatchPath> EMPTY_VARIABLE_ASSIGNMENT = EMPTY_MATCH.first();
@Getter
private final Services services;
Random random = new Random(42L); Random random = new Random(42L);
/* /*
* Reduce two matchinfos * Reduce two matchinfos
* *
...@@ -67,7 +69,6 @@ class MatcherImpl extends MatchPatternDualVisitor<Matchings, MatchPath> { ...@@ -67,7 +69,6 @@ class MatcherImpl extends MatchPatternDualVisitor<Matchings, MatchPath> {
} }
*/ */
private List<Integer> currentPosition = new ArrayList<>(); private List<Integer> currentPosition = new ArrayList<>();
/** /**
* If true, we assume every term in the pattern has a binder. * If true, we assume every term in the pattern has a binder.
* The binding names are generated. * The binding names are generated.
...@@ -79,17 +80,28 @@ class MatcherImpl extends MatchPatternDualVisitor<Matchings, MatchPath> { ...@@ -79,17 +80,28 @@ class MatcherImpl extends MatchPatternDualVisitor<Matchings, MatchPath> {
private boolean catchAll = false; private boolean catchAll = false;
private static HashMap<String, MatchPath> reduceConform(Map<String, MatchPath> h1, Map<String, MatchPath> h2) { private static HashMap<String, MatchPath> reduceConform(Map<String, MatchPath> h1, Map<String, MatchPath> h2) {
HashMap<String, MatchPath> listOfElementsofH1 = new HashMap<>(h1);
HashMap<String, MatchPath> h3 = new HashMap<>(h1); for (String s1 : listOfElementsofH1.keySet()) {
for (String s1 : h3.keySet()) { if (!s1.equals("EMPTY_MATCH") && h2.containsKey(s1)) {
if (!s1.equals("EMPTY_MATCH") && (h2.containsKey(s1) && !h2.get(s1).equals(h1.get(s1)))) { if (h2.get(s1) instanceof MatchPath.MPQuantifiableVariable &&
return null; !((QuantifiableVariable) h2.get(s1).getUnit()).name().toString().equals(h1.get(s1).toString())) {
} return null;
}
if (h1.get(s1) instanceof MatchPath.MPQuantifiableVariable &&
!((QuantifiableVariable) h1.get(s1).getUnit()).name().toString().equals(h2.get(s1).toString())) {
return null;
}
if (!h2.get(s1).equals(h1.get(s1))) {
return null;
}
}
} }
h3.putAll(h2); listOfElementsofH1.putAll(h2);
return h3; return listOfElementsofH1;
} }
/** /**
...@@ -122,6 +134,7 @@ class MatcherImpl extends MatchPatternDualVisitor<Matchings, MatchPath> { ...@@ -122,6 +134,7 @@ class MatcherImpl extends MatchPatternDualVisitor<Matchings, MatchPath> {
return oneMatch ? m3 : NO_MATCH; return oneMatch ? m3 : NO_MATCH;
} }
/** /**
* Transform a number term into an int value. * Transform a number term into an int value.
* <p> * <p>
...@@ -449,11 +462,17 @@ class MatcherImpl extends MatchPatternDualVisitor<Matchings, MatchPath> { ...@@ -449,11 +462,17 @@ class MatcherImpl extends MatchPatternDualVisitor<Matchings, MatchPath> {
QuantifiableVariable qv = toMatch.boundVars().get(i); QuantifiableVariable qv = toMatch.boundVars().get(i);
if (qfPattern.getType() == MatchPatternLexer.DONTCARE) { if (qfPattern.getType() == MatchPatternLexer.DONTCARE) {
match = reduceConform(match, Matchings.singleton(qfPattern.getText(), new MatchPath.MPQuantifiableVarible(peek, qv, i))); //match = reduceConform(match, Matchings.singleton(qfPattern.getText(), new MatchPath.MPQuantifiableVarible(peek, qv, i)));
match = reduceConform(match, EMPTY_MATCH);
continue; continue;
} }
if (qfPattern.getType() == MatchPatternLexer.SID) { if (qfPattern.getType() == MatchPatternLexer.SID) {
match = reduceConform(match, Matchings.singleton(qfPattern.getText(), new MatchPath.MPQuantifiableVarible(peek, qv, i))); TermFactory tf = new TermFactory(new HashMap<>());
TermBuilder tb = new TermBuilder(tf, services);
Term termQVariable = tb.var(qv);
match = reduceConform(match, Matchings.singleton(qfPattern.getText(),
new MatchPath.MPTerm(peek, termQVariable, -i)));
} else { } else {
if (!qv.name().toString().equals(qfPattern.getText())) { if (!qv.name().toString().equals(qfPattern.getText())) {
return NO_MATCH; return NO_MATCH;
...@@ -464,8 +483,17 @@ class MatcherImpl extends MatchPatternDualVisitor<Matchings, MatchPath> { ...@@ -464,8 +483,17 @@ class MatcherImpl extends MatchPatternDualVisitor<Matchings, MatchPath> {
Matchings fromTerm = accept(ctx.skope, create(peek, 0)); Matchings fromTerm = accept(ctx.skope, create(peek, 0));
//return handleBindClause(ctx.bindClause(), path, m); Matchings retM = reduceConform(fromTerm, match);
Matchings retM = reduceConformQuant(fromTerm, match); retM.forEach(stringMatchPathMap -> {
stringMatchPathMap.forEach((s, matchPath) -> {
if (matchPath instanceof MatchPath.MPQuantifiableVariable) {
//create term from variablename and put instead into map
}
}
);
});
return handleBindClause(ctx.bindClause(), peek, retM); return handleBindClause(ctx.bindClause(), peek, retM);
} }
...@@ -532,33 +560,6 @@ class MatcherImpl extends MatchPatternDualVisitor<Matchings, MatchPath> { ...@@ -532,33 +560,6 @@ class MatcherImpl extends MatchPatternDualVisitor<Matchings, MatchPath> {
} }
private Matchings reduceConformQuant(Matchings fromTerm, Matchings match) {
Matchings ret = new Matchings();
Map<String, MatchPath> quantifiedVarMap = match.first();
List<Map<String, MatchPath>> list = fromTerm.stream().filter(
map -> map.entrySet().stream().allMatch(
entry -> {
if (entry.getValue() != null) {
MatchPath mp = (MatchPath) entry.getValue();
Term mterm = (Term) mp.getUnit();
if (quantifiedVarMap.containsKey(entry.getKey())) {
return ((QuantifiableVariable) quantifiedVarMap.get(entry.getKey()).getUnit()).name().toString().
equals(mterm.op().name().toString());
} else {
return true;
}
} else {
return true;
}
}
)
).collect(Collectors.toList());
ret.addAll(list);
return ret;
}
@Override @Override
public Matchings visitExprParen(MatchPatternParser.ExprParenContext ctx, MatchPath peek) { public Matchings visitExprParen(MatchPatternParser.ExprParenContext ctx, MatchPath peek) {
...@@ -618,6 +619,39 @@ class MatcherImpl extends MatchPatternDualVisitor<Matchings, MatchPath> { ...@@ -618,6 +619,39 @@ class MatcherImpl extends MatchPatternDualVisitor<Matchings, MatchPath> {
} }
public int getRandomNumber() { public int getRandomNumber() {
return random.nextInt(); return Math.abs(random.nextInt());
} }
} }
/* private Matchings reduceConformQuant(Matchings fromTerm, Matchings match) {
Matchings ret = new Matchings();
Map<String, MatchPath> quantifiedVarMap = match.first();
System.out.println("quantifiedVarMap = " + quantifiedVarMap);
List<Map<String, MatchPath>> list = fromTerm.stream().filter(
map -> map.entrySet().stream().allMatch(
entry -> {
System.out.println("entry = " + entry);
if (entry.getValue() != null) {
MatchPath mp = (MatchPath) entry.getValue();
Term mterm = (Term) mp.getUnit();
if (quantifiedVarMap.containsKey(entry.getKey())) {
QuantifiableVariable unit = (QuantifiableVariable) quantifiedVarMap.get(entry.getKey()).getUnit();
return unit.name().toString().
equals(mterm.op().name().toString());
} else {
return true;
}
} else {
//in this case we have an empty match, however, we may have bound quantVars, we need to add them
System.out.println("entry.getKey() = " + entry.getKey());
return true;
}
}
)
).collect(Collectors.toList());
ret.addAll(list);
return ret;
}*/
\ No newline at end of file
...@@ -47,9 +47,9 @@ public abstract class MatchPath<T, P> { ...@@ -47,9 +47,9 @@ public abstract class MatchPath<T, P> {
return unit.toString(); return unit.toString();
} }
public static final class MPQuantifiableVarible extends MatchPath<QuantifiableVariable, Object> { public static final class MPQuantifiableVariable extends MatchPath<QuantifiableVariable, Object> {
public MPQuantifiableVarible(MatchPath<? extends Object, ?> parent, QuantifiableVariable unit, int pos) { public MPQuantifiableVariable(MatchPath<? extends Object, ?> parent, QuantifiableVariable unit, int pos) {
super(parent, unit, pos); super(parent, unit, pos);
} }
...@@ -75,7 +75,7 @@ public abstract class MatchPath<T, P> { ...@@ -75,7 +75,7 @@ public abstract class MatchPath<T, P> {
} }
public static class MPTerm extends MatchPath<Term, Object> { public static class MPTerm extends MatchPath<Term, Object> {
MPTerm(MatchPath<? extends Object, ?> parent, Term unit, int pos) { public MPTerm(MatchPath<? extends Object, ?> parent, Term unit, int pos) {
super(parent, unit, pos); super(parent, unit, pos);
} }
......
...@@ -59,7 +59,11 @@ public class MatcherFacadeTest { ...@@ -59,7 +59,11 @@ public class MatcherFacadeTest {
shouldMatchForm("fint2(1,i)", "fint2(1,i)"); shouldMatchForm("fint2(1,i)", "fint2(1,i)");
shouldMatchForm("\\exists int i; fint2(1,i)", "(\\exists _ _)"); shouldMatchForm("\\exists int i; fint2(1,i)", "(\\exists _ ?Term)");
shouldMatchForm("\\exists int i; fint2(1,i)", "(\\exists ?X _)");
shouldMatchForm("\\exists int i; fint2(1,i)", "(\\exists ?X (fint2(1,?X)))");
shouldMatchForm("\\exists int i; \\exists int j; fint2(j,i)", "(\\exists i (\\exists j _))"); shouldMatchForm("\\exists int i; \\exists int j; fint2(j,i)", "(\\exists i (\\exists j _))");
...@@ -119,26 +123,26 @@ public class MatcherFacadeTest { ...@@ -119,26 +123,26 @@ public class MatcherFacadeTest {
private void shouldMatch(String key, String pattern) throws ParserException { private void shouldMatch(String key, String pattern) throws ParserException {
Term term = parseKeyTerm(key); Term term = parseKeyTerm(key);
Matchings m = MatcherFacade.matches(pattern, term); Matchings m = MatcherFacade.matches(pattern, term, services);
System.out.println(m); System.out.println(m);
} }
private void shouldMatch(String key, String pattern, String exp) throws ParserException { private void shouldMatch(String key, String pattern, String exp) throws ParserException {
Term term = parseKeyTerm(key); Term term = parseKeyTerm(key);
Matchings m = MatcherFacade.matches(pattern, term); Matchings m = MatcherFacade.matches(pattern, term, services);
System.out.println(m); System.out.println(m);
Assert.assertEquals(exp, m.toString()); Assert.assertEquals(exp, m.toString());
} }
private void shouldMatchForm(String form, String pattern) throws ParserException { private void shouldMatchForm(String form, String pattern) throws ParserException {
Term formula = parserFormula(form); Term formula = parserFormula(form);
Matchings m = MatcherFacade.matches(pattern, formula); Matchings m = MatcherFacade.matches(pattern, formula, services);
System.out.println(m); System.out.println(m);
} }
private void shouldMatchForm(String form, String pattern, String exp) throws ParserException { private void shouldMatchForm(String form, String pattern, String exp) throws ParserException {
Term formula = parserFormula(form); Term formula = parserFormula(form);
Matchings m = MatcherFacade.matches(pattern, formula); Matchings m = MatcherFacade.matches(pattern, formula, services);
System.out.println(m); System.out.println(m);
Assert.assertEquals(exp, m.toString()); Assert.assertEquals(exp, m.toString());
} }
...@@ -193,14 +197,14 @@ public class MatcherFacadeTest { ...@@ -193,14 +197,14 @@ public class MatcherFacadeTest {
private void shouldMatchSemiSeq(String s, String s1, String exp) throws ParserException { private void shouldMatchSemiSeq(String s, String s1, String exp) throws ParserException {
Sequent term = parseSeq(s); Sequent term = parseSeq(s);
Matchings m = MatcherFacade.matches(s1, term); Matchings m = MatcherFacade.matches(s1, term, services);
System.out.println(m); System.out.println(m);
Assert.assertEquals(exp, m.toString()); Assert.assertEquals(exp, m.toString());
} }
private void shouldMatchSemiSeq(String s, String s1) throws ParserException { private void shouldMatchSemiSeq(String s, String s1) throws ParserException {
Sequent term = parseSeq(s); Sequent term = parseSeq(s);
Matchings m = MatcherFacade.matches(s1, term); Matchings m = MatcherFacade.matches(s1, term, services);
System.out.println(m); System.out.println(m);
} }
...@@ -290,7 +294,7 @@ public class MatcherFacadeTest { ...@@ -290,7 +294,7 @@ public class MatcherFacadeTest {
private void shouldMatchSeq(String seq, String seqPattern, String exp) throws ParserException { private void shouldMatchSeq(String seq, String seqPattern, String exp) throws ParserException {
Sequent sequent = parseSeq(seq); Sequent sequent = parseSeq(seq);
Matchings m = MatcherFacade.matches(seqPattern, sequent); Matchings m = MatcherFacade.matches(seqPattern, sequent, services);
System.out.println(m); System.out.println(m);
Assert.assertEquals(removeNumbersInBinders(m), exp); Assert.assertEquals(removeNumbersInBinders(m), exp);
} }
...@@ -304,7 +308,7 @@ public class MatcherFacadeTest { ...@@ -304,7 +308,7 @@ public class MatcherFacadeTest {
private void shouldMatchSeq(String seq, String seqPattern) throws ParserException { private void shouldMatchSeq(String seq, String seqPattern) throws ParserException {
Sequent sequent = parseSeq(seq); Sequent sequent = parseSeq(seq);
Matchings m = MatcherFacade.matches(seqPattern, sequent); Matchings m = MatcherFacade.matches(seqPattern, sequent, services);
System.out.println(m); System.out.println(m);
} }
} }
\ No newline at end of file
...@@ -3,6 +3,7 @@ package edu.kit.iti.formal.psdbg.termmatcher; ...@@ -3,6 +3,7 @@ package edu.kit.iti.formal.psdbg.termmatcher;
import de.uka.ilkd.key.api.KeYApi; import de.uka.ilkd.key.api.KeYApi;
import de.uka.ilkd.key.api.ProofApi; import de.uka.ilkd.key.api.ProofApi;
import de.uka.ilkd.key.api.ProofManagementApi; import de.uka.ilkd.key.api.ProofManagementApi;
import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.logic.Sequent; import de.uka.ilkd.key.logic.Sequent;
import de.uka.ilkd.key.proof.init.ProofInputException; import de.uka.ilkd.key.proof.init.ProofInputException;
import de.uka.ilkd.key.proof.io.ProblemLoaderException; import de.uka.ilkd.key.proof.io.ProblemLoaderException;
...@@ -19,7 +20,8 @@ public class TestUpdateMatch { ...@@ -19,7 +20,8 @@ public class TestUpdateMatch {
ProofApi pa = a.startProof(a.getProofContracts().get(0)); ProofApi pa = a.startProof(a.getProofContracts().get(0));
Sequent sequent = pa.getProof().root().sequent(); Sequent sequent = pa.getProof().root().sequent();
System.out.println(sequent); System.out.println(sequent);
Matchings result = MatcherFacade.matches("... update-application(_, ?X) ...", sequent, false); Matchings result = MatcherFacade.matches("... update-application(_, ?X) ...",
sequent, false, null);
System.out.println(result); System.out.println(result);
String exp = normalize("\\<{exc=null;try { result=self.foo(_x)@Test;} catch (java.lang.Throwable e) { exc=e; } }\\> (and(and(and(gt(result,Z(0(#))),java.lang.Object::<inv>(heap,self)),equals(exc,null)),all{f:Field}(all{o:java.lang.Object}(or(or(elementOf(o,f,allLocs),and(not(equals(o,null)),not(equals(boolean::select(heapAtPre,o,java.lang.Object::<created>),TRUE)))),equals(any::select(heap,o,f),any::select(heapAtPre,o,f)))))))"); String exp = normalize("\\<{exc=null;try { result=self.foo(_x)@Test;} catch (java.lang.Throwable e) { exc=e; } }\\> (and(and(and(gt(result,Z(0(#))),java.lang.Object::<inv>(heap,self)),equals(exc,null)),all{f:Field}(all{o:java.lang.Object}(or(or(elementOf(o,f,allLocs),and(not(equals(o,null)),not(equals(boolean::select(heapAtPre,o,java.lang.Object::<created>),TRUE)))),equals(any::select(heap,o,f),any::select(heapAtPre,o,f)))))))");
String x = normalize(result.iterator().next().get("?X").getUnit().toString().replace("\n", " ")); String x = normalize(result.iterator().next().get("?X").getUnit().toString().replace("\n", " "));
......
...@@ -114,8 +114,7 @@ public class InterpreterBuilder { ...@@ -114,8 +114,7 @@ public class InterpreterBuilder {
} }
public InterpreterBuilder addKeyMatcher(ProofApi api) { public InterpreterBuilder addKeyMatcher(ProofApi api) {
ScriptApi scriptApi = api.getScriptApi(); interpreter.setMatcherApi(new KeYMatcher(api.getEnv().getServices()));
interpreter.setMatcherApi(new KeYMatcher(scriptApi, interpreter));
return this; return this;
} }
......
package edu.kit.iti.formal.psdbg.interpreter; package edu.kit.iti.formal.psdbg.interpreter;
import de.uka.ilkd.key.api.ScriptApi; import de.uka.ilkd.key.api.ProofApi;
import de.uka.ilkd.key.api.VariableAssignments; import de.uka.ilkd.key.java.Services;
import de.uka.ilkd.key.logic.Name; import de.uka.ilkd.key.logic.Name;
import de.uka.ilkd.key.logic.Term; import de.uka.ilkd.key.logic.Term;
import de.uka.ilkd.key.logic.op.SchemaVariable; import de.uka.ilkd.key.logic.op.SchemaVariable;
...@@ -18,14 +18,13 @@ import edu.kit.iti.formal.psdbg.interpreter.data.KeyData; ...@@ -18,14 +18,13 @@ import edu.kit.iti.formal.psdbg.interpreter.data.KeyData;
import edu.kit.iti.formal.psdbg.interpreter.data.SortType; import edu.kit.iti.formal.psdbg.interpreter.data.SortType;
import edu.kit.iti.formal.psdbg.interpreter.data.VariableAssignment; import edu.kit.iti.formal.psdbg.interpreter.data.VariableAssignment;
import edu.kit.iti.formal.psdbg.parser.ast.Signature;