import Sequenic.T3.SuiteUtils.Query.Equation import static Sequenic.T3.SuiteUtils.Query.Equation.* String[] pats1 = ["foo(x,y)", "moo(*,y)", "g"] String[] pats2 = ["moo(*,y)", "foo(z,x)"] lhs = parseLHSpat(pats1) rhs = parseRHSpat(lhs,pats2) println(showPattern(lhs)) println(showPattern(rhs)) // eq = clause("foo(x,y) ; moo(*,y) ; g()") . equiv (clause("moo(*,y,z) ; foo(z,x)")) // but you can ommit some dot and brackets: eq1 = clause("foo(x,y) ; moo(*,y) ; g()") equiv clause("moo(*,y,z) ; foo(z,x)") println(eq1.show()) // unfortunately that is a bit too unpredictable, when omitting is ok, and when not. E.g. here // we can't omit them: eq2 = (clause("foo(x,y) ; moo(*,y) ; g()") >> {s -> s.retval}). equiv (clause("moo(*,y,z) ; foo(z,x)") >> {s -> s.tobj}) println(eq2.show())