Class Rules
java.lang.Object
fr.inria.rules.integraal.util.Rules
Utility class for rules
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<FORule> computeSafeNegation(FORule rule) Generate a set of safe-negative rules equivalent of the specified rule.static Collection<FORule> computeSinglePiece(FORule rule) Generate a set of mono-piece rules equivalent of the specified rule.static FORuleApplies a substitution to the supplied rule and returns the resulting image.static FORulefreshRenaming(FORule rule) Create a new rule corresponding to the given rule by renaming all the variables with fresh variablesstatic FOFormulagetNegativeBodyParts(FORule rule) Returns the negative body parts of the supplied rule.static FOFormulagetPositiveBodyPart(FORule rule) Returns the positive body part of the supplied rule.
-
Constructor Details
-
Rules
public Rules()Creates the rule utility.
-
-
Method Details
-
computeSinglePiece
Generate a set of mono-piece rules equivalent of the specified rule.- Parameters:
rule- rule to split into single piece- Returns:
- a Collection of Rule which is a decomposition of the specified rule to single piece rules.
-
getPositiveBodyPart
-
getNegativeBodyParts
-
computeSafeNegation
Generate a set of safe-negative rules equivalent of the specified rule. A rule is safe-negative iff each negative part contains only variables that appear in the positive part.Let R a rule, B+ the positive part of R, B- = A1, ..., Ak a negative part of R
This decomposition replaces each B- by a new atom and adds a rule R' = B- -> p(x1, ..., xj) where x1, ..., xj are the variables that appear both in B+ and B-.
- Parameters:
rule- rule to decompose into safe negation- Returns:
- a Collection of rule which is a decomposition of the specified rule to safe-negation rules.
-
freshRenaming
-
createImageWith
Applies a substitution to the supplied rule and returns the resulting image.- Parameters:
r- the rule to apply the substitution ons- the substitution to apply- Returns:
- a new FORule corresponding to the given FORule in which the given substitution have been applied
-