Package edu.uky.ai.logic
Class ListBindings
java.lang.Object
edu.uky.ai.logic.ListBindings
- All Implemented Interfaces:
Bindings
,Substitution
An implementation of
Bindings
based on a linked list. This data
structure is immutable, meaning that operations which would modify it return
a new object and leave the original unchanged.- Author:
- Stephen G. Ware
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionDefines what a given formula should be replaced with.Declares that two terms must have the same value.setNotEqual
(Term t1, Term t2) Declares that two terms must have different values.toString()
-
Field Details
-
EMPTY
An empty set of bindings
-
-
Method Details
-
toString
-
get
Description copied from interface:Substitution
Defines what a given formula should be replaced with.- Specified by:
get
in interfaceSubstitution
- Parameters:
original
- the formula which may be replaced- Returns:
- the replacement formula, or the original formula if no replacement is defined
-
setEqual
Description copied from interface:Bindings
Declares that two terms must have the same value. -
setNotEqual
Description copied from interface:Bindings
Declares that two terms must have different values.- Specified by:
setNotEqual
in interfaceBindings
- Parameters:
t1
- the first termt2
- the second term- Returns:
- a set of bindings in which both terms must have different values, or null if such a set would contain a contradiction
-