Class Rules
java.lang.Object
fr.lirmm.graphik.integraal.core.Rules
A set of tests and utilities for manipulating rules.
- Author:
- Clément Sipieter (INRIA) <clement@6pi.fr>
-
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<Rule> computeAtomicHead(Rule rule) Generate a set of atomic head rules equivalent of the specified rule.computeAtomicHead(Iterator<Rule> rules) Generate an iterator of atomic head rules from an iterator of rules.static Collection<Rule> computeSinglePiece(Rule rule) Generate a set of mono-piece rules equivalent of the specified rule.static fr.lirmm.graphik.integraal.core.Rules.SinglePieceRulesIteratorcomputeSinglePiece(Iterator<Rule> rules) Generate an iterator of mono-piece rules from an iterator of rules.static InMemoryAtomSetcriticalInstance(Iterable<Rule> rules) Builds the critical instance associated with the given rules.static voidcriticalInstance(Iterable<Rule> rules, InMemoryAtomSet A) The skolem chase on the critical instance of R halts iff the skolem chase of R halts universally.static Collection<InMemoryAtomSet> Compute and return the set of pieces of the head according to the frontier.static booleanhasAtomicBody(Rule rule) Test if the body of the rule is atomic.static booleanhasAtomicHead(Rule rule) Test if the head of the rule is atomic.static booleanChecks whether the given atom is unary.static booleanChecks whether the rule is a concept inclusion.static booleanChecks whether the rule states the disjointness of two concepts.static booleanChecks whether the rule states the disjointness of a role and its inverse.static booleanChecks whether the rule states the disjointness of two roles.static booleanChecks whether the rule expresses a domain constraint.static booleanChecks whether the rule matches an existential role-concept pattern.static booleanisFunctional(Rule r) Checks whether the rule encodes functionality.static booleanisInclusion(Rule r) Checks whether the rule is an inclusion rule.static booleanChecks whether the rule expresses an inverse role inclusion.static booleanisInvExistRC(Rule r) Checks whether the rule matches an inverse existential role-concept pattern.static booleanChecks whether the rule introduces a mandatory incoming role.static booleanChecks whether the rule introduces a mandatory outgoing role.static booleanChecks whether the rule is a negative constraint.static booleanChecks whether the rule expresses a range constraint.static booleanChecks whether the given atom is binary.static booleanChecks whether the rule expresses a composition of two roles.static booleanChecks whether the rule is a role inclusion.static booleanisSignature(Rule r) Checks whether the rule maps a role to a concept.static booleanisThereOneAtomThatContainsAllVars(CloseableIterableWithoutException<Atom> atomset, Collection<Variable> terms) Checks whether one atom in the given atom set contains all specified variables.static booleanChecks whether the rule expresses transitivity of one role.
-
Method Details
-
hasAtomicBody
Test if the body of the rule is atomic.- Parameters:
rule- the rule to inspect- Returns:
- true if and only if the body of the specified rule contains only one atom.
-
hasAtomicHead
Test if the head of the rule is atomic.- Parameters:
rule- the rule to inspect- Returns:
- true if and only if the head of the specified rule contains only one atom.
-
isThereOneAtomThatContainsAllVars
public static boolean isThereOneAtomThatContainsAllVars(CloseableIterableWithoutException<Atom> atomset, Collection<Variable> terms) Checks whether one atom in the given atom set contains all specified variables.- Parameters:
atomset- the atom set to inspectterms- the variables that must all occur in a single atom- Returns:
- true if one atom contains all specified variables
-
getPieces
Compute and return the set of pieces of the head according to the frontier. On Rules with Existential Variables: Walking the Decidability Line Jean-François Baget, Michel Leclère, Marie-Laure Mugnier, Eric Salvat- Parameters:
rule- the rule whose head must be split into pieces- Returns:
- a Collection ofInMemoryAtomSet representing the set of pieces of the head of the specified rule.
-
computeSinglePiece
-
computeAtomicHead
-
computeSinglePiece
Generate a set of mono-piece rules equivalent of the specified rule.- Parameters:
rule- the rule to decompose- Returns:
- a Collection of Rule which is a decomposition of the specified rule to single piece rules.
-
computeAtomicHead
Generate a set of atomic head rules equivalent of the specified rule.- Parameters:
rule- the rule to decompose- Returns:
- a Collection of Rule which is a decomposition of the specified rule to atomic head rules.
-
isConcept
Checks whether the given atom is unary.- Parameters:
a- the atom to inspect- Returns:
- true if the atom is a concept atom
-
isRole
Checks whether the given atom is binary.- Parameters:
a- the atom to inspect- Returns:
- true if the atom is a role atom
-
isInclusion
Checks whether the rule is an inclusion rule.- Parameters:
r- the rule to inspect- Returns:
- true if both body and head are atomic
-
isConceptInclusion
Checks whether the rule is a concept inclusion.- Parameters:
r- the rule to inspect- Returns:
- true if the rule is a concept inclusion
-
isRoleInclusion
Checks whether the rule is a role inclusion.- Parameters:
r- the rule to inspect- Returns:
- true if the rule is a role inclusion
-
isInverseRole
Checks whether the rule expresses an inverse role inclusion.- Parameters:
r- the rule to inspect- Returns:
- true if the head role is the inverse of the body role
-
isSignature
Checks whether the rule maps a role to a concept.- Parameters:
r- the rule to inspect- Returns:
- true if the rule is a signature rule
-
isDomain
Checks whether the rule expresses a domain constraint.- Parameters:
r- the rule to inspect- Returns:
- true if the head concept is attached to the first role argument
-
isRange
Checks whether the rule expresses a range constraint.- Parameters:
r- the rule to inspect- Returns:
- true if the head concept is attached to the second role argument
-
isMandatoryRole
Checks whether the rule introduces a mandatory outgoing role.- Parameters:
r- the rule to inspect- Returns:
- true if the rule is a mandatory role rule
-
isInvMandatoryRole
Checks whether the rule introduces a mandatory incoming role.- Parameters:
r- the rule to inspect- Returns:
- true if the rule is an inverse mandatory role rule
-
isExistRC
Checks whether the rule matches an existential role-concept pattern.- Parameters:
r- the rule to inspect- Returns:
- true if the rule is of the form
C(x) -> R(x,y), D(y)
-
isInvExistRC
Checks whether the rule matches an inverse existential role-concept pattern.- Parameters:
r- the rule to inspect- Returns:
- true if the rule is of the form
C(x) -> R(y,x), D(y)
-
isRoleComposition
Checks whether the rule expresses a composition of two roles.- Parameters:
r- the rule to inspect- Returns:
- true if the rule body composes into the head role
-
isTransitivity
Checks whether the rule expresses transitivity of one role.- Parameters:
r- the rule to inspect- Returns:
- true if the rule is a transitivity rule
-
isFunctional
Checks whether the rule encodes functionality.- Parameters:
r- the rule to inspect- Returns:
- true if the rule head is the equality predicate
-
isNegativeConstraint
Checks whether the rule is a negative constraint.- Parameters:
r- the rule to inspect- Returns:
- true if the rule head is bottom
-
isDisjointConcept
Checks whether the rule states the disjointness of two concepts.- Parameters:
r- the rule to inspect- Returns:
- true if the rule is a disjoint concept rule
-
isDisjointRole
Checks whether the rule states the disjointness of two roles.- Parameters:
r- the rule to inspect- Returns:
- true if the rule is a disjoint role rule
-
isDisjointInverseRole
Checks whether the rule states the disjointness of a role and its inverse.- Parameters:
r- the rule to inspect- Returns:
- true if the disjointness is expressed on inverse roles
-
criticalInstance
Builds the critical instance associated with the given rules.- Parameters:
rules- the rules used to derive predicates and constants- Returns:
- the generated critical instance
-
criticalInstance
The skolem chase on the critical instance of R halts iff the skolem chase of R halts universally. The critical instance for a set of rules R contains all facts that can be constructed using all predicates occuring in R, all constants occurring in the body of a rule in R, and one special fresh constant.- Parameters:
rules- the rules used to derive predicates and constantsA- the target atom set receiving the critical instance facts
-