Package it.unibo.alchemist.model.sapere
Interface ILsaMolecule
-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.Dependency
,it.unibo.alchemist.model.Molecule
,java.io.Serializable
,java.lang.Comparable
,java.lang.Iterable
public interface ILsaMolecule implements Molecule, Iterable<T>, Comparable<T>
-
-
Method Summary
Modifier and Type Method Description abstract List<IExpression>
allocateVar(Map<HashString, ITreeNode<out Object>> matches)
abstract int
argsNumber()
abstract boolean
equals(Object mol)
abstract ILsaMolecule
generalize()
abstract IExpression
getArg(int i)
abstract boolean
hasDuplicateVariables()
abstract boolean
isIdenticalTo(ILsaMolecule mol)
abstract boolean
isIstance()
abstract boolean
matches(ILsaMolecule mol)
abstract boolean
matches(List<out IExpression> mol, boolean duplicateVariables)
abstract boolean
moreGenericOf(ILsaMolecule mol)
abstract int
size()
abstract HashString
toHashString()
abstract String
toString()
-
Methods inherited from class it.unibo.alchemist.model.Molecule
getName
-
Methods inherited from class java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from class java.lang.Comparable
compareTo
-
Methods inherited from class it.unibo.alchemist.model.Dependency
dependsOn, makesDependent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
allocateVar
abstract List<IExpression> allocateVar(Map<HashString, ITreeNode<out Object>> matches)
- Parameters:
matches
- the map with the variable / value bindings- Returns:
the list of the arguments updated
-
argsNumber
abstract int argsNumber()
- Returns:
the arguments number of the LSA structure.
-
equals
abstract boolean equals(Object mol)
- Parameters:
mol
- the ILsaMolecule to compare.- Returns:
true if the molecule arguments match with mol arguments.
-
generalize
abstract ILsaMolecule generalize()
- Returns:
a new ILsaMolecule produced by replacing all non-atomic and non-numeric values with variables.
-
getArg
abstract IExpression getArg(int i)
- Parameters:
i
- : position of the argument to get- Returns:
the Expression represent the argument i.
-
hasDuplicateVariables
abstract boolean hasDuplicateVariables()
- Returns:
true if this variable makes use of variables defined within the molecule itself
-
isIdenticalTo
abstract boolean isIdenticalTo(ILsaMolecule mol)
- Parameters:
mol
- the molecule to compare to- Returns:
true if lsaMolecule is identical to mol, namely that all the arguments are equal
-
isIstance
abstract boolean isIstance()
- Returns:
true if the molecule is an instance (not variable in the argouments).
-
matches
abstract boolean matches(ILsaMolecule mol)
- Parameters:
mol
- the LsaMolecule to try to match with.- Returns:
true if the two molecules match
-
matches
abstract boolean matches(List<out IExpression> mol, boolean duplicateVariables)
- Parameters:
mol
- the LsaMolecule to try to match withduplicateVariables
- if true, the matching of variables reused within the same tuple is enabled- Returns:
true if the two molecules match
-
moreGenericOf
abstract boolean moreGenericOf(ILsaMolecule mol)
- Parameters:
mol
- the molecule to compare to- Returns:
true if the molecule is more generic than the one passed
-
size
abstract int size()
- Returns:
the number of arguments
-
toHashString
abstract HashString toHashString()
- Returns:
the string representing the molecule, in a faster implementation.
-
-
-
-