Class Inspect

  • All Implemented Interfaces:
    KnowledgeBaseConsumer, PredicateFactory

    public final class Inspect
    extends AbstractPredicateFactory
    clause(X,Y) / retract(X) - matches terms to existing clauses.

    clause(X,Y) causes X and Y to be matched to the head and body of an existing clause. If no clauses are found for the predicate represented by X then the goal fails. If there are more than one that matches, the clauses will be matched one at a time as the goal is re-satisfied. X must be suitably instantiated that the predicate of the clause can be determined.

    retract(X) - remove clauses from the knowledge base. The first clause that X matches is removed from the knowledge base. When an attempt is made to re-satisfy the goal, the next clause that X matches is removed. X must be suitably instantiated that the predicate of the clause can be determined.

    • Field Detail

      • doRemoveMatches

        private final boolean doRemoveMatches
        true if matching rules should be removed (retracted) from the knowledge base as part of calls to #evaluate(Term, Term) or false if the knowledge base should remain unaltered.
    • Constructor Detail

      • Inspect

        private Inspect​(boolean doRemoveMatches)