001 /* 002 * Created on Feb 17, 2005 003 * 004 */ 005 package aima.logic.demos; 006 007 import aima.logic.propositional.algorithms.KnowledgeBase; 008 import aima.logic.propositional.algorithms.PLResolution; 009 010 /** 011 * @author Ravi Mohan 012 * 013 */ 014 public class PLResolutionDemo { 015 private static PLResolution plr = new PLResolution(); 016 017 public static void main(String[] args) { 018 KnowledgeBase kb = new KnowledgeBase(); 019 String fact = "((B11 => (NOT P11)) AND B11)"; 020 kb.tell(fact); 021 System.out.println("\nPLResolutionDemo\n"); 022 System.out.println("adding " + fact + "to knowldegebase"); 023 displayResolutionResults(kb, "(NOT B11)"); 024 } 025 026 private static void displayResolutionResults(KnowledgeBase kb, String query) { 027 System.out.println("Running plResolution of query " + query 028 + " on knowledgeBase gives " + plr.plResolution(kb, query)); 029 } 030 }