Package edu.uky.ai.logic
Class Predication
java.lang.Object
edu.uky.ai.logic.Predication
- All Implemented Interfaces:
Atom
,Formula
,Literal
,Proposition
,Comparable<Formula>
The atoms of predicate logic, which are composed of statements that express
relationships between things in the world (i.e.
Term
s).- Author:
- Stephen G. Ware
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal String
The relationship between the terms, (often a preposition)final ImmutableArray<Term>
The terms between which the relationship holdsFields inherited from interface edu.uky.ai.logic.Proposition
FALSE, TRUE
-
Constructor Summary
ConstructorsConstructorDescriptionPredication
(String predicate, Term... terms) Constructs a new predication with the given predicate and terms.Predication
(String predicate, ImmutableArray<Term> terms) Constructs a new predication with the given predicate and terms.Predication
(String predicate, Iterable<Term> terms) Constructs a new predication with the given predicate and terms. -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
boolean
isGround()
Checks whether this formula contains any variables.substitute
(Substitution substitution) Returns a version of this formula such that any elements that appear in the given substitution are replaced.toString()
Finds the bindings that would be necessary to make this formula the same as another formula (if any exist).
-
Field Details
-
predicate
The relationship between the terms, (often a preposition) -
terms
The terms between which the relationship holds
-
-
Constructor Details
-
Predication
Constructs a new predication with the given predicate and terms.- Parameters:
predicate
- the relationship between the termsterms
- the terms between which the relationship holds
-
Predication
Constructs a new predication with the given predicate and terms.- Parameters:
predicate
- the relationship between the termsterms
- the terms between which the relationship holds
-
Predication
Constructs a new predication with the given predicate and terms.- Parameters:
predicate
- the relationship between the termsterms
- the terms between which the relationship holds
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
isGround
public boolean isGround()Description copied from interface:Formula
Checks whether this formula contains any variables. -
substitute
Description copied from interface:Formula
Returns a version of this formula such that any elements that appear in the given substitution are replaced.- Specified by:
substitute
in interfaceAtom
- Specified by:
substitute
in interfaceFormula
- Specified by:
substitute
in interfaceLiteral
- Specified by:
substitute
in interfaceProposition
- Parameters:
substitution
- the substitution- Returns:
- a formula with replacements from the substitution
-
unify
Description copied from interface:Formula
Finds the bindings that would be necessary to make this formula the same as another formula (if any exist).
-