Predicate
An abstract class in Root.Township, Alta.Intelligence.
Base for a logic term in the AI knowledge system: a functor with argument terms that is evaluated against a KnowledgeHolder to produce weighted results. Operators combine predicates.
- Listed in Creatures and AI
- Inherits or implements
ITerm,ICompoundPart - Derived types
Compound,Not,Operator,True - Attributes
DebuggerDisplay
Constructors
| Member | What it is |
|---|---|
Predicate(BaseAtom functor, params ITerm[] terms) | Creates a Predicate from functor and terms. |
Properties
| Member | What it is |
|---|---|
BaseAtom Functor { get; private set; } | The predicate's head atom. |
ITerm[] Terms { get; private set; } | The predicate's arguments. |
2 private and internal properties
Methods
| Member | What it is |
|---|---|
ITerm CheckBind(Dictionary<ITerm, ITerm> bindings) | Returns this predicate with any bound variables replaced, or itself if nothing is bound. |
void ConstantInitialize(IAtomDefinition definition) | Initializes constant terms from an atom definition. |
bool Contains(ITerm other) | True if the given term is this predicate, its functor or inside any of its terms. |
IEnumerable<Result> Evaluate(KnowledgeHolder knowledgeHolder) (iterator) | Evaluates against a knowledge holder and merges results with the same bindings, keeping the highest weighting. |
static Predicate op_Addition(Predicate left, Predicate right) | Combines two predicates with Plus. |
static Predicate op_BitwiseAnd(Predicate left, Predicate right) | Combines two predicates with And. |
static Predicate op_BitwiseOr(Predicate left, Predicate right) | Combines two predicates with Or. |
static Predicate op_ExclusiveOr(Predicate left, Predicate right) | Combines two predicates with Xor. |
static Predicate op_Implicit(bool value) | Converts a bool: true becomes a True predicate, false becomes null. |
static Predicate op_LogicalNot(Predicate right) | Wraps a predicate in Not. |
protected abstract IEnumerable<Result> EvaluateInternal(KnowledgeHolder knowledgeHolder) | Subclass evaluation. Results are deduplicated by Evaluate. |
protected abstract Predicate FromCompoundPart(CompoundPart compoundPart) | Builds a predicate of the same kind from a rebuilt functor and terms. |
Used in
Members of other types that take, return or hold a Predicate:
And.And, And.FromCompoundPart, Atom.Define, Atom<T1, T2, T3, T4>.Define, Atom<T1, T2, T3>.Define, Atom<T1, T2>.Define, Atom<T>.Define, BaseAtom.Definition.Definition, BaseAtom.Definition.Goal, Compound.FromCompoundPart, IAtomDefinition.Goal, Not.FromCompoundPart, Not.Not, Not.Right, Operator.Left, Operator.Operator, Operator.Right, Or.FromCompoundPart, Or.Or, Plus.FromCompoundPart, Plus.Plus, True.FromCompoundPart, Xor.FromCompoundPart, Xor.Xor.