java.lang.Object
edu.upc.fib.inlab.imp.kse.logics.logicschema.services.processes.LogicSchemaTransformationProcess
edu.upc.fib.inlab.imp.kse.logics.logicschema.services.processes.TrivialLiteralCleaner
All Implemented Interfaces:
LogicProcess, SchemaTransformationProcess

public class TrivialLiteralCleaner extends LogicSchemaTransformationProcess
This class is responsible for removing the trivial literals from the logic constraints, and logic derivation rules, but without removing derived predicates, neither removing constraints.

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 Details

    • TrivialLiteralCleaner

      public TrivialLiteralCleaner()
  • Method Details

    • executeTransformation

      public SchemaTransformation executeTransformation(LogicSchema logicSchema)
      Parameters:
      logicSchema - not null
      Returns:
      a transformation where the final logicSchema a new logicSchema with the trivial literals removed.
    • clean

      public LogicSchema clean(LogicSchema logicSchema)
      Parameters:
      logicSchema - not null
      Returns:
      a new logicSchema with the trivial literals removed.