001    package aima.test.logictest.prop.algorithms;
002    
003    import junit.framework.TestCase;
004    import aima.logic.propositional.algorithms.KnowledgeBase;
005    import aima.logic.propositional.algorithms.PLFCEntails;
006    import aima.logic.propositional.parsing.PEParser;
007    
008    /**
009     * @author Ravi Mohan
010     * 
011     */
012    
013    public class PLFCEntailsTest extends TestCase {
014            PEParser parser;
015    
016            PLFCEntails plfce;
017    
018            @Override
019            public void setUp() {
020                    plfce = new PLFCEntails();
021            }
022    
023            public void testAIMAExample() {
024                    KnowledgeBase kb = new KnowledgeBase();
025                    kb.tell(" (P => Q)");
026                    kb.tell("((L AND M) => P)");
027                    kb.tell("((B AND L) => M)");
028                    kb.tell("( (A AND P) => L)");
029                    kb.tell("((A AND B) => L)");
030                    kb.tell("(A)");
031                    kb.tell("(B)");
032    
033                    assertEquals(true, plfce.plfcEntails(kb, "Q"));
034    
035            }
036    
037    }