Commit c6b1c6a5 authored by Alexander Weigl's avatar Alexander Weigl

fix

parent 85a8dd1a
Pipeline #13423 failed with stage
in 2 minutes and 35 seconds
......@@ -517,7 +517,7 @@ class MatcherImpl extends MatchPatternDualVisitor<Matchings, MatchPath> {
@Override
protected Matchings visitEquality(MatchPatternParser.EqualityContext ctx, MatchPath peek) {
return visitBinaryOperation("eq", ctx.termPattern(0), ctx.termPattern(1), peek);
return visitBinaryOperation("equals", ctx.termPattern(0), ctx.termPattern(1), peek);
}
private Stream<MatchPath.MPTerm> subTerms(MatchPath.MPTerm peek) {
......
......@@ -36,6 +36,21 @@ public class MatcherFacadeTest {
abbrev = new AbbrevMap();
}
@Test
public void error() throws ParserException {
// shouldMatch("h2(2,3) = 0",
// "?X=0", "[{?X= h2(2,3)}]");
shouldMatchSeq("h2(2,3) = 0 ==>",
"?X=0 ==>", "[{?X= h2(2,3)}]");
shouldMatchSeq("h2(2,3) = 0 ==> p, !p",
"?X=0 ==>", "[{?X= h2(2,3)}]");
shouldMatchSeq("2 >= 1, h2(1,2) = h2(2,3), h2(2,3) = 0 ==> p, !p",
"?X=0 ==>", "[{?X= h2(2,3)}]");
}
@Test
public void matches() throws Exception {
shouldMatch("f(a)", "_");
......@@ -61,7 +76,8 @@ public class MatcherFacadeTest {
}
@Test public void testBindContext() throws ParserException {
@Test
public void testBindContext() throws ParserException {
//shouldMatch("f(a)", "f(a) : ?Y", "[{?Y=f(a)}]");
//shouldMatch("f(g(a))", "_ \\as ?Y", "[{?Y=f(g(a))}]");
//shouldMatch("i+i+j", "(?X + ?Y) : ?Z", "[{?X=add(i,i), ?Y=j, ?Z=add(add(i,i),j)}]");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment