Package FAtiMA.Core.wellFormedNames
Class Name
- java.lang.Object
-
- FAtiMA.Core.wellFormedNames.Name
-
- All Implemented Interfaces:
IGroundable,java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
ComposedName,Symbol
public abstract class Name extends java.lang.Object implements IGroundable, java.lang.Cloneable, java.io.Serializable
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:
Symbol,ComposedName, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Name()Creates a new Abstract Name - Not used since it's an abstract class
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract java.lang.Objectclone()Clones this Name, returning an equal copy.booleanequals(java.lang.Object o)Compares the current Name with another Nameabstract java.lang.Objectevaluate(Memory m)Evaluates this Name according to the data stored in the KnowledgeBaseabstract SymbolGetFirstLiteral()Gets the Name's First Symbol or Literalabstract java.util.ArrayList<Symbol>GetLiteralList()Generates a list with all symbols contained in the NamebooleanisConstant()Deprecated.please do not use.booleanisGrounded()Indicates 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 NameParseName(java.lang.String description)-
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface FAtiMA.Core.wellFormedNames.IGroundable
MakeGround, MakeGround, ReplaceUnboundVariables
-
-
-
-
Method Detail
-
ParseName
public static Name ParseName(java.lang.String description)
- Parameters:
description- - the String to be parsed- Returns:
- the parsed Name (can be either a Symbol or a ComposedName)
- See Also:
Symbol,Parses 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 Symbols are 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
public boolean equals(java.lang.Object o)
Compares the current Name with another Name- Overrides:
equalsin classjava.lang.Object- Parameters:
o- - the object(Name) to compare to- Returns:
- true if the Names are syntatically equal
-
GetFirstLiteral
public abstract Symbol GetFirstLiteral()
Gets the Name's First Symbol or Literal- Returns:
- the first Symbol
-
GetLiteralList
public abstract java.util.ArrayList<Symbol> GetLiteralList()
Generates a list with all symbols contained in the Name- Returns:
- the list with the symbols
-
clone
public abstract java.lang.Object clone()
Clones this Name, returning an equal copy. If this clone is changed afterwards, the original object remains the same.- Overrides:
clonein classjava.lang.Object- Returns:
- The Name's copy.
-
evaluate
public abstract java.lang.Object evaluate(Memory m)
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
-
-