private static bool DecisionsAreConsistent(Alethicity aAlethicity, Prover9Mace4.Result aResult) { if (aResult == Prover9Mace4.Result.NoDecision) { return(true); } if (aAlethicity == Alethicity.Necessary && aResult != Prover9Mace4.Result.Necessary && aResult != Prover9Mace4.Result.Possible) { return(false); } if (aAlethicity == Alethicity.Impossible && aResult != Prover9Mace4.Result.Impossible && aResult != Prover9Mace4.Result.Unnecessary) { return(false); } if (aAlethicity == Alethicity.Contingent && (aResult == Prover9Mace4.Result.Necessary || aResult == Prover9Mace4.Result.Impossible)) { return(false); } return(true); }
public static Alethicity GetDecision(string aText) { Matrix lProposition = Parser.Parse(aText.Split('\n')); Alethicity lDecision = lProposition.Decide(); Prover9Mace4.Result lProver9sDecision = Prover9Mace4.Decide(lProposition, Prover9Mace4Timeout); Console.WriteLine("Prover9/Mace4 decided {0}.", lProver9sDecision); Assert.IsTrue( DecisionsAreConsistent(lDecision, lProver9sDecision), string.Format("Inconsistent decisions: {0}, {1}", lDecision, lProver9sDecision)); return(Parser.Parse(aText.Split('\n')).Decide()); }
public static string TextForDecision(Alethicity lDecision) { switch (lDecision) { case Alethicity.Necessary: return("necessarily true"); case Alethicity.Contingent: return("contingent"); case Alethicity.Impossible: return("self-contradictory"); default: throw new NotImplementedException( String.Format("The value Alethicity.{0} is not supported by this application.", lDecision)); } }