public void addSubClass(ATermAppl sub, ATermAppl sup) { if( sub.equals( sup ) ) return; changes.add( ChangeType.TBOX_ADD ); tbox.addAxiom( ATermUtils.makeSub( sub, sup ) ); if( log.isLoggable( Level.FINER ) ) log.finer( "sub-class " + sub + " " + sup ); }
public void addSubClass(ATermAppl sub, ATermAppl sup) { if( sub.equals( sup ) ) return; changes.add( ChangeType.TBOX_ADD ); tbox.addAxiom( ATermUtils.makeSub( sub, sup ) ); if( log.isLoggable( Level.FINER ) ) log.finer( "sub-class " + sub + " " + sup ); }
private static void addDisjointAxiom(ATermAppl c1, ATermAppl c2, List<ATermAppl> axioms) { ATermAppl notC2 = ATermUtils.makeNot( c2 ); axioms.add( ATermUtils.makeSub( c1, notC2 ) ); if( ATermUtils.isPrimitive( c2 ) ) { ATermAppl notC1 = ATermUtils.makeNot( c1 ); axioms.add( ATermUtils.makeSub( c2, notC1 ) ); } }
private static void addDisjointAxiom(ATermAppl c1, ATermAppl c2, List<ATermAppl> axioms) { ATermAppl notC2 = ATermUtils.makeNot( c2 ); axioms.add( ATermUtils.makeSub( c1, notC2 ) ); if( ATermUtils.isPrimitive( c2 ) ) { ATermAppl notC1 = ATermUtils.makeNot( c1 ); axioms.add( ATermUtils.makeSub( c2, notC1 ) ); } }
private static List<ATermAppl> normalizeDisjointAxiom(ATermAppl... concepts) { List<ATermAppl> axioms = CollectionUtils.makeList(); for( int i = 0; i < concepts.length - 1; i++ ) { ATermAppl c1 = concepts[i]; ATermAppl notC1 = ATermUtils.makeNot( c1 ); for( int j = i + 1; j < concepts.length; j++ ) { ATermAppl c2 = concepts[j]; ATermAppl notC2 = ATermUtils.makeNot( c2 ); axioms.add( ATermUtils.makeSub( c1, notC2 ) ); if( ATermUtils.isPrimitive( c2 ) ) { axioms.add( ATermUtils.makeSub( c2, notC1 ) ); } } } return axioms; }
private static List<ATermAppl> normalizeDisjointAxiom(ATermAppl... concepts) { List<ATermAppl> axioms = CollectionUtils.makeList(); for( int i = 0; i < concepts.length - 1; i++ ) { ATermAppl c1 = concepts[i]; ATermAppl notC1 = ATermUtils.makeNot( c1 ); for( int j = i + 1; j < concepts.length; j++ ) { ATermAppl c2 = concepts[j]; ATermAppl notC2 = ATermUtils.makeNot( c2 ); axioms.add( ATermUtils.makeSub( c1, notC2 ) ); if( ATermUtils.isPrimitive( c2 ) ) { axioms.add( ATermUtils.makeSub( c2, notC1 ) ); } } } return axioms; }
private boolean absorbII(Set<ATermAppl> set) { for( ATermAppl term : set ) { TermDefinition td = tbox.Tu.getTD( term ); boolean canAbsorb; if( td != null ) canAbsorb = td.getEqClassAxioms().isEmpty(); else canAbsorb = term.getArity() == 0 && set.size() > 1; if( canAbsorb ) { set.remove( term ); ATermList setlist = ATermUtils.makeList( set ); ATermAppl conjunct = ATermUtils.makeAnd( setlist ); conjunct = ATermUtils.makeNot( conjunct ); ATermAppl sub = ATermUtils.makeSub( term, ATermUtils.nnf( conjunct ) ); tbox.Tu.addDef( sub ); if( log.isLoggable( Level.FINE ) ) log.fine( "Absorb named: " + ATermUtils.toString( sub ) ); tbox.addAxiomExplanation( sub, explanation ); return true; } } return false; }
private boolean absorbII(Set<ATermAppl> set) { for( ATermAppl term : set ) { TermDefinition td = tbox.Tu.getTD( term ); boolean canAbsorb; if( td != null ) canAbsorb = td.getEqClassAxioms().isEmpty(); else canAbsorb = term.getArity() == 0 && set.size() > 1; if( canAbsorb ) { set.remove( term ); ATermList setlist = ATermUtils.makeList( set ); ATermAppl conjunct = ATermUtils.makeAnd( setlist ); conjunct = ATermUtils.makeNot( conjunct ); ATermAppl sub = ATermUtils.makeSub( term, ATermUtils.nnf( conjunct ) ); tbox.Tu.addDef( sub ); if( log.isLoggable( Level.FINE ) ) log.fine( "Absorb named: " + ATermUtils.toString( sub ) ); tbox.addAxiomExplanation( sub, explanation ); return true; } } return false; }
public void visit(OWLSubClassOfAxiom axiom) { axiom.getSubClass().accept( this ); ATermAppl c1 = term; axiom.getSuperClass().accept( this ); ATermAppl c2 = term; if( addAxioms ) { kb.addSubClass( c1, c2 ); } else { // create the TBox axiom to remove ATermAppl subAxiom = ATermUtils.makeSub( c1, c2 ); // reload is required if remove fails reloadRequired = !kb.removeAxiom( subAxiom ); } }
private boolean absorbVII(Set<ATermAppl> set) { ATermList list = ATermUtils.makeList( set ); ATermAppl sub = ATermUtils.nnf( (ATermAppl) list.getFirst() ); list = list.getNext(); ATermAppl sup = list.isEmpty() ? ATermUtils.makeNot( sub ) : ATermUtils.makeNot( ATermUtils.makeAnd( list ) ); sup = ATermUtils.nnf( sup ); ATermAppl subClassAxiom = ATermUtils.makeSub( sub, sup ); if( log.isLoggable( Level.FINE ) ) log.fine( "GCI: " + subClassAxiom + "\nexplanation: " + explanation ); addDef( subClassAxiom ); tbox.addAxiomExplanation( subClassAxiom, explanation ); return true; }
private boolean absorbVII(Set<ATermAppl> set) { ATermList list = ATermUtils.makeList( set ); ATermAppl sub = ATermUtils.nnf( (ATermAppl) list.getFirst() ); list = list.getNext(); ATermAppl sup = list.isEmpty() ? ATermUtils.makeNot( sub ) : ATermUtils.makeNot( ATermUtils.makeAnd( list ) ); sup = ATermUtils.nnf( sup ); ATermAppl subClassAxiom = ATermUtils.makeSub( sub, sup ); if( log.isLoggable( Level.FINE ) ) log.fine( "GCI: " + subClassAxiom + "\nexplanation: " + explanation ); addDef( subClassAxiom ); tbox.addAxiomExplanation( subClassAxiom, explanation ); return true; }
@Override public void visit(OWLSubClassOfAxiom axiom) { axiom.getSubClass().accept( this ); ATermAppl c1 = term; axiom.getSuperClass().accept( this ); ATermAppl c2 = term; if( addAxioms ) { kb.addSubClass( c1, c2 ); } else { // create the TBox axiom to remove ATermAppl subAxiom = ATermUtils.makeSub( c1, c2 ); // reload is required if remove fails reloadRequired = !kb.removeAxiom( subAxiom ); } }
axiom = ATermUtils.makeSub( c2, c1 );
axiom = ATermUtils.makeSub( c2, c1 );