Class SingleDerivationRuleTransformer
java.lang.Object
edu.upc.fib.inlab.imp.kse.logics.logicschema.services.processes.LogicSchemaTransformationProcess
edu.upc.fib.inlab.imp.kse.logics.logicschema.services.processes.SingleDerivationRuleTransformer
- All Implemented Interfaces:
LogicProcess
,SchemaTransformationProcess
This class is in charge of transforming one logic schema into an equivalent logic schema where every derived predicate is defined, only, through one derivation rule.
To achieve so, this class replaces the derivation rule's head to avoid repeated predicates. E.g.:
P :- A, BP :- C, D
is replaced by:
P_1 :- A, B
P_2 :- C, D
Consequently, any apparition of predicates which have been transformed (such as the predicate P in the previous example), is replaced by its new transformed predicates. E.g.:
:- P, R:- S, not(P)
is transformed to:
:- P_1, R
:- P_2, R
:- S, not(P_1), not(P_2)
-
Constructor Summary
ConstructorDescriptionCreates an SingleDerivationRuleTransformer that will use the SuffixMultipleConstraintIDGenerator as a strategy for creating new constraintIDs, if necessary.Creates an SingleDerivationRuleTransformer that will use the given generatorId strategy for creating new constraintIDs, if necessary. -
Method Summary
Modifier and TypeMethodDescriptionexecuteTransformation
(LogicSchema logicSchema) transform
(LogicSchema logicSchema) Methods inherited from class edu.upc.fib.inlab.imp.kse.logics.logicschema.services.processes.LogicSchemaTransformationProcess
checkLogicSchema, execute
-
Constructor Details
-
SingleDerivationRuleTransformer
public SingleDerivationRuleTransformer()Creates an SingleDerivationRuleTransformer that will use the SuffixMultipleConstraintIDGenerator as a strategy for creating new constraintIDs, if necessary. -
SingleDerivationRuleTransformer
Creates an SingleDerivationRuleTransformer that will use the given generatorId strategy for creating new constraintIDs, if necessary.- Parameters:
generatorId
- not null
-
-
Method Details
-
executeTransformation
- Parameters:
logicSchema
- not-null- Returns:
- a transformation where the final logicSchema is a new equivalent logic schema where every derived predicate is defined through only one derivation rule
-
transform
- Parameters:
logicSchema
- a not null logic schema- Returns:
- a new equivalent logic schema where every derived predicate is defined through only one derivation rule
-