AIMA.Test.Core.Experiment.Logic.Propositional.Algorithms.WalkSATTest.testAIMAExample C# (CSharp) Method

testAIMAExample() public method

public testAIMAExample ( ) : void
return void
	public void testAIMAExample() {
		KnowledgeBase kb = new KnowledgeBase();
		kb.tell(" (P => Q)");
		kb.tell("((L AND M) => P)");
		kb.tell("((B AND L) => M)");
		kb.tell("( (A AND P) => L)");
		kb.tell("((A AND B) => L)");
		kb.tell("(A)");
		kb.tell("(B)");
		WalkSAT walkSAT = new WalkSAT();
		Model m = walkSAT.findModelFor(kb.asSentence().ToString(), 1000, 0.5);
		if (m == null) {
			System.Console.WriteLine("failure");
		} else {
			m.print();
		}
	}
}