private static Core initCore() { Core.resetCore(); Core core = Core.getCore(); Symbole symA = new Symbole("A"); Symbole symB = new Symbole("B"); Symbole symC = new Symbole("C"); symC.addRelation(new RightNormal(new LeftAnd(symA, symB))); symC.addRelation(new RightInvert(new LeftAnd(symA, symB))); return(core); }
private static Core initCore() { Core.resetCore(); Core core = Core.getCore(); Symbole symA = new Symbole("A"); Symbole symB = new Symbole("B"); Symbole symD = new Symbole("D"); Symbole symE = new Symbole("E"); Symbole symG = new Symbole("G"); Symbole symH = new Symbole("H"); Symbole symF = new Symbole("F"); Symbole symI = new Symbole("I"); Symbole symJ = new Symbole("J"); Symbole symL = new Symbole("L"); Symbole symM = new Symbole("M"); Symbole symK = new Symbole("K"); Symbole symO = new Symbole("O"); Symbole symP = new Symbole("P"); Symbole symN = new Symbole("N"); symA.addRelation(new RightNormal(symB)); symB.addRelation(new RightNormal(new LeftAnd(symD, symE))); symF.addRelation(new RightNormal(new LeftAnd(symG, symH))); symG.addRelation(new RightNormal(new LeftAnd(symI, symJ))); symH.addRelation(new RightNormal(symG)); symK.addRelation(new RightNormal(new LeftAnd(symL, symM))); symL.addRelation(new RightAnd(symN, new LeftAnd(symO, symP))); symN.addRelation(new RightAnd(symL, new LeftAnd(symO, symP))); symM.addRelation(new RightNormal(symN)); return(core); }
private static Core initCore() { Core.resetCore(); Core core = Core.getCore(); Symbole symA = new Symbole("A"); Symbole symB = new Symbole("B"); Symbole symC = new Symbole("C"); Symbole symD = new Symbole("D"); symD.addRelation(new RightOr(symC, new LeftOr(symA, symB))); symC.addRelation(new RightOr(symD, new LeftOr(symA, symB))); return(core); }
private static Core initCore() { Core.resetCore(); Core core = Core.getCore(); Symbole symA = new Symbole("A"); Symbole symB = new Symbole("B"); Symbole symC = new Symbole("C"); symC.addRelation(new RightXor(symB, symA)); symB.addRelation(new RightXor(symC, symA)); return(core); }
public static void Test() //A + !B => C { Console.WriteLine("Expression: A + !B => C"); Core core = Core.getCore(); Symbole symA = new Symbole("A"); Symbole symB = new Symbole("B"); Symbole symC = new Symbole("C"); symC.addRelation(new RightNormal(new LeftAnd(symA, new LeftInvert(symB)))); Console.WriteLine("Test: A=" + core.getValueOf("A") + ", B=" + core.getValueOf("B") + " Res=" + core.getValueOf("C")); global::ExpertSystem.Test.writeResult(core.getValueOf("C"), Result.FALSE); core.setTrue("A"); Console.WriteLine("Test: A=" + core.getValueOf("A") + ", B=" + core.getValueOf("B") + " Res=" + core.getValueOf("C")); global::ExpertSystem.Test.writeResult(core.getValueOf("C"), Result.TRUE); core.setTrue("B"); Console.WriteLine("Test: A=" + core.getValueOf("A") + ", B=" + core.getValueOf("B") + " Res=" + core.getValueOf("C")); global::ExpertSystem.Test.writeResult(core.getValueOf("C"), Result.FALSE); Core.resetCore(); }