Class TrivialLiteralCleaner
- All Implemented Interfaces:
LogicProcess
,SchemaTransformationProcess
A trivial literal is a literal that always evaluates to true, or that always evaluates to false. For instance, BooleanBuiltInLiterals are trivial literals. Hence, this class remove such literals from the bodies of the derivation rules and logic constraints. E.g.: "@1 :- P(x), TRUE()" will be transformed into "@1 :- P(x)"
Currently, this class detects the following trivial literals:
- BooleanBuiltInLiterals. I.e., "TRUE()", "FALSE()" built in literals.
- Derived literals whose bodies contains trivial literals. E.g. "P(x) :- B(x), FALSE()"
This class does not remove any logic constraint, nor removes derived predicates. Hence, if a logic constraint is only composed of one trivial literal, it will remain as it is. E.g. "@1 :- TRUE()" will remain as it is.
Similarly, the class does not remove any derived predicate. So, if a derived predicate is only composed of one derivation rule which is always false, it will remain as it is. E.g. "P(x) :- FALSE()" will remain as it is.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclean
(LogicSchema logicSchema) executeTransformation
(LogicSchema logicSchema) Methods inherited from class edu.upc.fib.inlab.imp.kse.logics.logicschema.services.processes.LogicSchemaTransformationProcess
checkLogicSchema, execute
-
Constructor Details
-
TrivialLiteralCleaner
public TrivialLiteralCleaner()
-
-
Method Details
-
executeTransformation
- Parameters:
logicSchema
- not null- Returns:
- a transformation where the final logicSchema a new logicSchema with the trivial literals removed.
-
clean
- Parameters:
logicSchema
- not null- Returns:
- a new logicSchema with the trivial literals removed.
-