public void Example4() { var baseWorld = LogicSolver.WorldService.GetNewWorldConstant(); var baseIndex = new WorldIndex(baseWorld); var relation = new AccessibilityRelation(new List <IRelationProperty>() { new SerialProperty(), new TransitiveProperty() }); //x var variable = LogicSolver.TermNamer.GetNewVariable(); var func = LogicSolver.TermNamer.GetNewFunction(new List <Terminal>() { variable }); var baseFormula = new AtomicFormula(func, baseIndex); var formula = new BinaryFormula( new QuantifierFormula(new UnaryFormula(baseFormula, UnaryConnective.Necessity, baseIndex), variable, QuantifierConnective.ForAll, baseIndex), new UnaryFormula(new QuantifierFormula(baseFormula, variable, QuantifierConnective.ForAll, baseIndex), UnaryConnective.Necessity, baseIndex), BinaryConnective.Implication, baseIndex); var solver = new LogicSolver(relation); Assert.IsTrue(solver.Solve(formula)); }
public LogicSolver(AccessibilityRelation relation) { this.relation = relation; baseWorld = WorldService.GetNewWorldConstant(); relation.BaseWorld = baseWorld; //Only used on reduced sequents resolutionRule = new R1(relation); // These are applied as long as sequents have unreduced formulas rules.AddRange(new List <IInferenceRule>() { new R2(), new R3(), new R4(), new R5(), new R6(), new R7(WorldService), new R8(WorldService), new R9(TermNamer), new R10(TermNamer) }); }
public R1(AccessibilityRelation relation) { this.relation = relation; }
static void Main(string[] args) { Console.OutputEncoding = new UnicodeEncoding(); Console.WriteLine("Hello World!"); #region test8 //var baseWorld = new ConstantWorldSymbol("0"); //var baseIndex = new WorldIndex(baseWorld); //var relation = new AccessibilityRelation(new List<IRelationProperty>() { // new SerialProperty() //}); //var variable = LogicSolver.TermNamer.GetNewVariable(); //var atomicFormula = new AtomicFormula(LogicSolver.TermNamer.GetNewFunction(new List<Terminal>() { variable }), baseIndex); //var formula = new BinaryFormula( // new QuantifierFormula(new UnaryFormula(atomicFormula, UnaryConnective.Necessity, baseIndex), variable, QuantifierConnective.ForAll, baseIndex), // new UnaryFormula(new QuantifierFormula(atomicFormula, variable, QuantifierConnective.ForAll, baseIndex), UnaryConnective.Necessity, baseIndex), // BinaryConnective.Implication, baseIndex); #endregion #region test1 var baseWorld = LogicSolver.WorldService.GetNewWorldConstant(); var baseIndex = new WorldIndex(baseWorld); var relation = new AccessibilityRelation(new List <IRelationProperty>() { new SerialProperty(), new TransitiveProperty() }); var variable = LogicSolver.TermNamer.GetNewVariable(); var baseFormula = new AtomicFormula(variable, baseIndex); var formula = new BinaryFormula( new UnaryFormula(baseFormula, UnaryConnective.Necessity, baseIndex), new UnaryFormula(new UnaryFormula(baseFormula, UnaryConnective.Necessity, baseIndex), UnaryConnective.Necessity, baseIndex), BinaryConnective.Implication, baseIndex); #endregion //Example9 #region test2 //var baseWorld = LogicSolver.WorldService.GetNewWorldConstant(); //var baseIndex = new WorldIndex(baseWorld); //var relation = new AccessibilityRelation(new List<IRelationProperty>() { // new SerialProperty(), // new TransitiveProperty() //}); //var variable = LogicSolver.TermNamer.GetNewVariable(); //var atomicFormula = new AtomicFormula(LogicSolver.TermNamer.GetNewFunction(new List<Terminal>() { variable }), baseIndex); //var formula = new BinaryFormula( // new UnaryFormula(new QuantifierFormula(atomicFormula, variable, QuantifierConnective.ForAll, baseIndex), UnaryConnective.Necessity, baseIndex), // new QuantifierFormula(new UnaryFormula(atomicFormula, UnaryConnective.Necessity, baseIndex), variable, QuantifierConnective.ForAll, baseIndex), // BinaryConnective.Implication, baseIndex); #endregion Console.WriteLine(); Console.WriteLine("Formula: " + formula.ToWorldString()); var solver = new LogicSolver(relation); var result = solver.Solve(formula); Console.WriteLine("Proof found: " + result); }