TermVariable varX = getVariable("?x");
TermVariable varY = getVariable("?y");
TermVariable varZ = getVariable("?z");
Substitution s = new Substitution();
s.addMapping(varX, tf);
s.addMapping(varY, getTermObject("1"));
s.addMapping(varZ, getTermObject("2"));
Fact result = (Fact) f1.applySubstitution(s);