Class DefaultRule
java.lang.Object
fr.lirmm.graphik.integraal.core.AbstractRule
fr.lirmm.graphik.integraal.core.DefaultRule
- All Implemented Interfaces:
Rule, Comparable<Rule>
- Direct Known Subclasses:
DefaultNegativeConstraint
Default implementation of a rule backed by in-memory atom sets for its body and head.
- Author:
- Clément Sipieter (INRIA) clement@6pi.f
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty unlabeled rule.DefaultRule(InMemoryAtomSet body, InMemoryAtomSet head) Creates an unlabeled rule from in-memory body and head atom sets.DefaultRule(Rule rule) Creates a copy of the provided rule.DefaultRule(CloseableIteratorWithoutException<Atom> body, CloseableIteratorWithoutException<Atom> head) Creates an unlabeled rule from iterators over its body and head atoms.DefaultRule(String label, InMemoryAtomSet body, InMemoryAtomSet head) Creates a rule from in-memory body and head atom sets.DefaultRule(String label, CloseableIteratorWithoutException<Atom> body, CloseableIteratorWithoutException<Atom> head) Creates a rule from iterators over its body and head atoms. -
Method Summary
Modifier and TypeMethodDescriptiongetBody()Get the body (the hypothesis) of this rule.Get all constants of this rule.Compute and return the set of existential variables of this rule.Compute and return the set of frontier variables of this rule.getHead()Get the head (the conclusion) of this rule.getLabel()Get the label (the name) of this rule.Get all literals of this rule.getTerms()Get all terms of this rule.Deprecated.Get all variables of this rule.voidReplaces the rule body.voidReplaces the rule head.voidSet the label (the name) of this rule.
-
Constructor Details
-
DefaultRule
public DefaultRule()Creates an empty unlabeled rule. -
DefaultRule
public DefaultRule(CloseableIteratorWithoutException<Atom> body, CloseableIteratorWithoutException<Atom> head) Creates an unlabeled rule from iterators over its body and head atoms.- Parameters:
body- the iterator over body atomshead- the iterator over head atoms
-
DefaultRule
public DefaultRule(String label, CloseableIteratorWithoutException<Atom> body, CloseableIteratorWithoutException<Atom> head) Creates a rule from iterators over its body and head atoms.- Parameters:
label- the rule labelbody- the iterator over body atomshead- the iterator over head atoms
-
DefaultRule
Creates an unlabeled rule from in-memory body and head atom sets.- Parameters:
body- the rule bodyhead- the rule head
-
DefaultRule
Creates a rule from in-memory body and head atom sets.- Parameters:
label- the rule labelbody- the rule bodyhead- the rule head
-
DefaultRule
Creates a copy of the provided rule.- Parameters:
rule- the rule to copy
-
-
Method Details
-
getBody
Description copied from interface:RuleGet the body (the hypothesis) of this rule.- Returns:
- the body of this rule.
-
setBody
-
getLabel
-
setLabel
-
getHead
Description copied from interface:RuleGet the head (the conclusion) of this rule.- Returns:
- the head of this rule.
-
setHead
-
getTerms
-
getVariables
-
getConstants
-
getLiterals
-
getTerms
Deprecated.Description copied from interface:RuleGet terms by Type.- Parameters:
type- the term type to collect- Returns:
- a Set of all Term of the specified type related to this Rule.
-
getFrontier
-
getExistentials
-