Package com.semedy.reasoner.api.logic
Class Compound
java.lang.Object
com.semedy.reasoner.api.logic.Compound
- All Implemented Interfaces:
Serializable
,Cloneable
Represents a predicate or a function.
The symbol (predicate or function symbol) is a long.
The corresponding symbol may be found in the symbol table.
The arguments are either longs for codes, variables or objects
The symbol (predicate or function symbol) is a long.
The corresponding symbol may be found in the symbol table.
The arguments are either longs for codes, variables or objects
- Author:
- angele
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboundArguments
(BitSet boundvars) Returns bound arguments if variables are boundvoid
clone()
Get a cloneboolean
getArgument
(int i) Return the argument at index iObject[]
Get all arguments.int
getArity()
Get the arity of the compoundlong[]
Get a normalized version (all variables are renamed to Xi)getSubstitutedArgument
(int i) Return the substituted argument at index ilong
Return the symbol of the compoundReturn the symbol of the compoundreturns for each variable how often it occurs in compoundReturn all variables in compoundfinal BitSet
Return all variable positions in a bitsetint
hashCode()
boolean
isArgumentGround
(int i) boolean
isGround()
Is the compound ground (has no variables)toString()
-
Constructor Details
-
Compound
-
Compound
-
Compound
public Compound(long code) -
Compound
-
-
Method Details
-
getInternalBuffer
public long[] getInternalBuffer() -
clearInternalBuffer
public void clearInternalBuffer() -
getVariables
Return all variables in compound- Returns:
-
getVariablesAsBits
Return all variable positions in a bitset- Returns:
-
getVariableOccurrences
returns for each variable how often it occurs in compound- Returns:
-
getSymbol
public long getSymbol()Return the symbol of the compound- Returns:
-
getSymbolAsString
Return the symbol of the compound- Returns:
-
getArgument
Return the argument at index i- Parameters:
i
-- Returns:
-
isArgumentGround
public boolean isArgumentGround(int i) -
getSubstitutedArgument
Return the substituted argument at index i- Parameters:
i
-- Returns:
-
isGround
public boolean isGround()Is the compound ground (has no variables)- Returns:
-
hashCode
public int hashCode() -
equals
-
getArity
public int getArity()Get the arity of the compound- Returns:
-
getNormalized
Get a normalized version (all variables are renamed to Xi)- Returns:
-
clone
Get a clone- Returns:
- clone of the compound
-
toString
-
getArguments
Get all arguments. The arguments are NOT cloned- Returns:
-
boundArguments
Returns bound arguments if variables are bound- Parameters:
boundvars
-- Returns:
-