Package edu.uky.ai.logic
Class Constant
java.lang.Object
edu.uky.ai.logic.Term
edu.uky.ai.logic.Constant
- All Implemented Interfaces:
Formula
,Comparable<Formula>
A constant represents a specific unique thing.
- Author:
- Stephen G. Ware
-
Field Summary
Fields inherited from class edu.uky.ai.logic.Term
DEFAULT_TYPE, name, type
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
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.
-
Constructor Details
-
Constant
Constructs a constant with the given type and name.- Parameters:
type
- the type of the constantname
- the name of the constant
-
-
Method Details
-
isGround
public boolean isGround()Description copied from interface:Formula
Checks whether this formula contains any variables.- Returns:
- true if the formula is ground, false otherwise
-
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 interfaceFormula
- Overrides:
substitute
in classTerm
- Parameters:
substitution
- the substitution- Returns:
- a formula with replacements from the substitution
-