public static void AritySimplifierDemo() { var rules = new RuleSet(); var term = rules.Define1("term"); var node = ( ( term("o1") & term("o2") & term("o3") & term("o4") ) | term("oo1") | term("oo2") ) & term("ooo1"); var expr = new L1Expression(node); expr.Traverse(new TreeDumper()); expr.Xform(new AritySimplifier()); expr.Traverse(new AstValidator()); expr.Traverse(new TreeDumper()); }
private static Clause[] Disassemble(L1Expression expression) { var clone = (L1Expression)expression.Clone(); clone.Xform(new CnfTransformer()); return clone.Analyze<Clause[]>(new CnfDisassembler()); }
public bool Prove(L1Expression expression) { var clauses = new List<Clause>(); clauses.AddRange(Disassembler.Disassemble(Axioms.ToArray())); clauses.AddRange(Disassembler.Disassemble(Factum.ToArray())); clauses.AddRange(Disassembler.Disassemble(!expression.Root)); return !Prover.NaiveResolution(clauses.ToArray()); }