Class TopDownSIPS
java.lang.Object
com.semedy.reasoner.rewriter.sips.TopDownSIPS
- All Implemented Interfaces:
SIPS
Arranges the sequence of the rule bodies in that way that the reasoning has
best performance Is fully based on statistics, i.e. selectivity, weights.
Does deep ordering, i.e. looks into all edb literals in all rules for these
decisions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
isEvaluable
(Rule R, int ix, BitSet groundvars, IntensionalDB IDB, SymbolTable symbols) Is rule body beginning at index with given groundvars evaluableorderBodies
(Rule rule, BitSet groundVars, long[] groundValues, IntensionalDB IDB, ExtensionalDB[] edbs, SymbolTable symbols) Arrange the bodies of a rule.
-
Constructor Details
-
TopDownSIPS
-
-
Method Details
-
orderBodies
public WeightedLiteral[] orderBodies(Rule rule, BitSet groundVars, long[] groundValues, IntensionalDB IDB, ExtensionalDB[] edbs, SymbolTable symbols) throws IOException, SemReasonerException Description copied from interface:SIPS
Arrange the bodies of a rule. Returnsnull
if it cannot be arranged.- Specified by:
orderBodies
in interfaceSIPS
- Parameters:
rule
- the rulegroundVars
- the topdown instantiated variables of the rulegroundValues
- variable instantiationsIDB
- the intensional databaseedbs
- the extensional databasessymbols
- the symbol table- Returns:
- the weighted literals or
null
if no reordering is possible with this SIPS - Throws:
IOException
RewriterException
- if an error occursSymboltableException
SemReasonerException
-
isEvaluable
public boolean isEvaluable(Rule R, int ix, BitSet groundvars, IntensionalDB IDB, SymbolTable symbols) throws IOException, SemReasonerException Is rule body beginning at index with given groundvars evaluable- Parameters:
R
-groundvars
-IDB
-- Returns:
- Throws:
IOException
SemReasonerException
-