Interface UserDefinedPredicateFactory

All Superinterfaces:
PredicateFactory
All Known Implementing Classes:
DynamicUserDefinedPredicateFactory, StaticUserDefinedPredicateFactory, TabledUserDefinedPredicateFactory

public interface UserDefinedPredicateFactory extends PredicateFactory
Maintains a record of the clauses that define a user defined predicate.

A user defined predicate is a predicate that is constructed from Prolog syntax consulted at runtime.

Class diagram
  • Method Details

    • addFirst

      void addFirst(ClauseModel clauseModel)
      Adds a clause to the beginning of the predicate's list of clauses.
      Parameters:
      clauseModel - the clause to add to the beginning of the predicate
    • addLast

      void addLast(ClauseModel clauseModel)
      Adds a clause to the end of the predicate's list of clauses.
      Parameters:
      clauseModel - the clause to add to the end of the predicate
    • getPredicateKey

      PredicateKey getPredicateKey()
      Returns the key for the predicate this object represents
      Returns:
      the key for the predicate this object represents
    • getImplications

      Iterator<ClauseModel> getImplications()
      Returns an iterator over the clauses in the predicate in proper sequence.
      Returns:
      an iterator over the clauses in the predicate in proper sequence.
    • isDynamic

      boolean isDynamic()
      Returns true is this predicate is dynamic.

      A "dynamic" predicate is a user defined predicate that can have clauses added or removed after is first defined.

      Returns:
      true is this predicate is dynamic
    • getClauseModel

      ClauseModel getClauseModel(int index)
      Returns the clause at the specified position in this predicate's list of clauses.
      Parameters:
      index - index of the clause to return
      Returns:
      the clause at the specified position in this predicate's list of clauses or null if out of bounds
    • compile

      void compile()