/* * Check advanced instance checking */ public void testTightLexicographicEntailment7() throws Exception { ProbKnowledgeBase pkb = new KBStandaloneLoader().load(FILE_PREFIX + "test_tlexent_4.xml"); ProntoReasoner reasoner = new BasicLexicographicReasoner(new PSATSolverImpl()); ConditionalConstraint lewisCC = reasoner.membershipEntailment( pkb, ATermUtils.makeTermAppl(URI_PREFIX + "Lewis"), ATermUtils.makeTermAppl(URI_PREFIX + "WingedFlying")); /* ConditionalConstraint awfCC = reasoner.subsumptionEntailment( pkb, ATermUtils .makeTermAppl( URI_PREFIX + "ArcticPenguin" ), ATermUtils.makeTermAppl( URI_PREFIX + "WingedFlying" ) ); */ /* ConditionalConstraint apfCC = reasoner.subsumptionEntailment( pkb, ATermUtils .makeTermAppl( URI_PREFIX + "ArcticPenguin" ), ATermUtils.makeTermAppl( URI_PREFIX + "FlyingObject" ) ); */ /* ConditionalConstraint lewisF = reasoner.membershipEntailment( pkb, ATermUtils .makeTermAppl( URI_PREFIX + "Lewis" ), ATermUtils .makeTermAppl( URI_PREFIX + "FlyingObject" ) ); ConditionalConstraint lewisW = reasoner.membershipEntailment( pkb, ATermUtils .makeTermAppl( URI_PREFIX + "Lewis" ), ATermUtils .makeTermAppl( URI_PREFIX + "WingedObject" ) ); */ assertEquals(0.03, lewisCC.getLowerBound(), 0.0001); assertEquals(0.46, lewisCC.getUpperBound(), 0.0001); }
/* * Check inheritance and overriding simultaneously */ public void testTightLexicographicEntailment5() throws Exception { ProbKnowledgeBase pkb = new KBStandaloneLoader().load(FILE_PREFIX + "test_tlexent_3.xml"); ProntoReasoner reasoner = new BasicLexicographicReasoner(new PSATSolverImpl()); ConditionalConstraint awfCC = reasoner.subsumptionEntailment( pkb, ATermUtils.makeTermAppl(URI_PREFIX + "ArcticPenguin"), ATermUtils.makeTermAppl(URI_PREFIX + "WingedFlying")); assertEquals(0.1, awfCC.getLowerBound(), 0.0001); assertEquals(0.5, awfCC.getUpperBound(), 0.0001); }
/* * Check simple instance checking */ public void testTightLexicographicEntailment6() throws Exception { ProbKnowledgeBase pkb = new KBStandaloneLoader().load(FILE_PREFIX + "test_tlexent_5.xml"); ProntoReasoner reasoner = new BasicLexicographicReasoner(new PSATSolverImpl()); ConditionalConstraint tweetyCC = reasoner.membershipEntailment( pkb, ATermUtils.makeTermAppl(URI_PREFIX + "Tweety"), ATermUtils.makeTermAppl(URI_PREFIX + "FlyingObject")); assertEquals(0.28, tweetyCC.getLowerBound(), 0.0001); assertEquals(0.72, tweetyCC.getUpperBound(), 0.0001); }
/** * Membership entailment is supposed to check PABox consistency for that individual. And it must * fail in this case * * @throws Exception */ public void testNotAConsistent() throws Exception { ProbKnowledgeBase pkb = new KBStandaloneLoader().load(FILE_PREFIX + "test_membership_1.xml"); ProntoReasoner reasoner = new BasicLexicographicReasoner(new PSATSolverImpl()); boolean result = false; try { reasoner.membershipEntailment( pkb, ATermUtils.makeTermAppl(URI_PREFIX + "Lewis"), ATermUtils.makeTermAppl(URI_PREFIX + "Penguin")); } catch (RuntimeException e) { result = true; } assertTrue(result); }