Package FAtiMA.Core.wellFormedNames
Class Name
java.lang.Object
FAtiMA.Core.wellFormedNames.Name
- All Implemented Interfaces:
IGroundable,Serializable,Cloneable
- Direct Known Subclasses:
ComposedName,Symbol
Abstract Well Formed Name A well formed name is used to specify goal/action
names, objects, properties, constants, and relations. It's syntax is based on
first order logic symbols, variables and predicates. a Name can be either a
Symbol or a ComposedName (composed by several symbols)
- Author:
- Joao Dias
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Objectclone()Clones this Name, returning an equal copy.booleanCompares the current Name with another Nameabstract ObjectEvaluates this Name according to the data stored in the KnowledgeBaseabstract SymbolGets the Name's First Symbol or LiteralGenerates a list with all symbols contained in the NamebooleanDeprecated.please do not use.booleanIndicates if the name is grounded (no unbound variables in it's WFN) Example: Stronger(Luke,John) is grounded while Stronger(John,[X]) is not.static NameMethods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface FAtiMA.Core.wellFormedNames.IGroundable
MakeGround, MakeGround, ReplaceUnboundVariables
-
Field Details
-
_constant
protected boolean _constant -
_grounded
protected boolean _grounded
-
-
Constructor Details
-
Name
public Name()Creates a new Abstract Name - Not used since it's an abstract class
-
-
Method Details
-
ParseName
- Parameters:
description- - the String to be parsed- Returns:
- the parsed Name (can be either a Symbol or a ComposedName)
- See Also:
-
SymbolParses a Name from a string that corresponds to a Well Formed Name The alphabet that makes up the symbols expressions of well formed names consists of: � The set of letters, upper and lowercase. � The set of digits, 0,1,..,9 � The symbols �_� and �-� Symbols expressions begin with a letter and are followed by any sequence of these legal characters. Well formed names are composed by four types of symbols: 1. The Truth symbols "True" and "False". 2. Constant symbols, which are simple symbol expressions. 3. Variables symbols, which are symbol expressions enclosed in square parentheses. Ex: [x] represents the variable x. 4. The Self symbol [SELF], a reserved special variable which refers to the agent. a) All Symbolsare well formed names. b) If S and s1,s2,...sn are symbols, then S(s1,s2,...,sn) is called a Composed Name which is also a well formed name. The following are examples of WFNs: Stronger(Luke,John) John(Position) Owner(Ball,[Y]) Ball
-
equals
Compares the current Name with another Name -
GetFirstLiteral
Gets the Name's First Symbol or Literal- Returns:
- the first Symbol
-
GetLiteralList
Generates a list with all symbols contained in the Name- Returns:
- the list with the symbols
-
clone
Clones this Name, returning an equal copy. If this clone is changed afterwards, the original object remains the same. -
evaluate
Evaluates this Name according to the data stored in the KnowledgeBase- Parameters:
m- - a reference to the memory- Returns:
- if the name is a symbol, it returns its name, otherwise it returns the value associated to the name in the KB
-
isConstant
public boolean isConstant()Deprecated.please do not use. This is deprecated.- Returns:
- true if the name corresponds to a constant symbol, i.e. if the name corresponds to a Symbol
-
isGrounded
public boolean isGrounded()Description copied from interface:IGroundableIndicates if the name is grounded (no unbound variables in it's WFN) Example: Stronger(Luke,John) is grounded while Stronger(John,[X]) is not.- Specified by:
isGroundedin interfaceIGroundable- Returns:
- true if the name is grounded, false otherwise
-