Interface ISymbolModule
Working with (evaluated) ground terms and related functions.
Namespace: ClingoSharp.CoreServices.Interfaces.Modules
Assembly: ClingoSharp.CoreServices.dll
Syntax
public interface ISymbolModule : IClingoModule
Methods
| Improve this Doc View SourceCreateFunction(String, Symbol[], Boolean, out Symbol)
Construct a symbol representing a function or tuple.
Declaration
bool CreateFunction(string name, Symbol[] arguments, bool positive, out Symbol symbol)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | the name of the function |
Symbol[] | arguments | the arguments of the function |
System.Boolean | positive | whether the symbol has a classical negation sign |
Symbol | symbol | the resulting symbol |
Returns
Type | Description |
---|---|
System.Boolean |
|
CreateId(String, Boolean, out Symbol)
Construct a symbol representing an id.
Declaration
bool CreateId(string name, bool positive, out Symbol symbol)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | the name |
System.Boolean | positive | whether the symbol has a classical negation sign |
Symbol | symbol | the resulting symbol |
Returns
Type | Description |
---|---|
System.Boolean |
|
Remarks
This is just a shortcut for CreateFunction(String, Symbol[], Boolean, out Symbol) with empty arguments.
CreateInfimum(out Symbol)
Construct a symbol representing #inf
.
Declaration
void CreateInfimum(out Symbol symbol)
Parameters
Type | Name | Description |
---|---|---|
Symbol | symbol | the resulting symbol |
CreateNumber(Int32, out Symbol)
Construct a symbol representing a number.
Declaration
void CreateNumber(int number, out Symbol symbol)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | number | the number |
Symbol | symbol | the resulting symbol |
CreateSignature(String, UInt32, Boolean, out Signature)
Create a new signature.
Declaration
bool CreateSignature(string name, uint arity, bool positive, out Signature signature)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | name of the signature |
System.UInt32 | arity | arity of the signature |
System.Boolean | positive | false if the signature has a classical negation sign |
Signature | signature | the resulting signature |
Returns
Type | Description |
---|---|
System.Boolean |
|
CreateString(String, out Symbol)
Construct a symbol representing a string.
Declaration
bool CreateString(string value, out Symbol symbol)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | the string |
Symbol | symbol | the resulting symbol |
Returns
Type | Description |
---|---|
System.Boolean |
|
CreateSupremum(out Symbol)
Construct a symbol representing #sup
.
Declaration
void CreateSupremum(out Symbol symbol)
Parameters
Type | Name | Description |
---|---|---|
Symbol | symbol | the resulting symbol |
GetArguments(Symbol, out Symbol[])
Get the arguments of a symbol.
Declaration
bool GetArguments(Symbol symbol, out Symbol[] arguments)
Parameters
Type | Name | Description |
---|---|---|
Symbol | symbol | the target symbol |
Symbol[] | arguments | the resulting arguments |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetArity(Signature)
Get the arity of a signature.
Declaration
uint GetArity(Signature signature)
Parameters
Type | Name | Description |
---|---|---|
Signature | signature | the target signature |
Returns
Type | Description |
---|---|
System.UInt32 | the arity of the signature |
GetHash(Signature)
Calculate a hash code of a signature.
Declaration
UIntPtr GetHash(Signature signature)
Parameters
Type | Name | Description |
---|---|---|
Signature | signature | the target signature |
Returns
Type | Description |
---|---|
System.UIntPtr | the hash code of the signature |
GetHash(Symbol)
Calculate a hash code of a symbol.
Declaration
UIntPtr GetHash(Symbol symbol)
Parameters
Type | Name | Description |
---|---|---|
Symbol | symbol | the target symbol |
Returns
Type | Description |
---|---|
System.UIntPtr | the hash code of the symbol |
GetName(Signature)
Get the name of a signature.
Declaration
string GetName(Signature signature)
Parameters
Type | Name | Description |
---|---|---|
Signature | signature | the target signature |
Returns
Type | Description |
---|---|
System.String | the name of the signature |
GetName(Symbol, out String)
Get the name of a symbol.
Declaration
bool GetName(Symbol symbol, out string name)
Parameters
Type | Name | Description |
---|---|---|
Symbol | symbol | the target symbol |
System.String | name | the resulting name |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetNumber(Symbol, out Int32)
Get the number of a symbol.
Declaration
bool GetNumber(Symbol symbol, out int number)
Parameters
Type | Name | Description |
---|---|---|
Symbol | symbol | the target symbol |
System.Int32 | number | the resulting number |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetString(Symbol, out String)
Get the string of a symbol.
Declaration
bool GetString(Symbol symbol, out string value)
Parameters
Type | Name | Description |
---|---|---|
Symbol | symbol | the target symbol |
System.String | value | the resulting string |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetType(Symbol)
Get the type of a symbol.
Declaration
SymbolType GetType(Symbol symbol)
Parameters
Type | Name | Description |
---|---|---|
Symbol | symbol | the target symbol |
Returns
Type | Description |
---|---|
SymbolType | the type of the symbol |
IsEqualTo(Signature, Signature)
Check if two signatures are equal.
Declaration
bool IsEqualTo(Signature signatureA, Signature signatureB)
Parameters
Type | Name | Description |
---|---|---|
Signature | signatureA | first signature |
Signature | signatureB | second signature |
Returns
Type | Description |
---|---|
System.Boolean | whether a == b |
IsEqualTo(Symbol, Symbol)
Check if two symbols are equal.
Declaration
bool IsEqualTo(Symbol symbolA, Symbol symbolB)
Parameters
Type | Name | Description |
---|---|---|
Symbol | symbolA | first symbol |
Symbol | symbolB | second symbol |
Returns
Type | Description |
---|---|
System.Boolean | whether a == b |
IsLessThan(Signature, Signature)
Declaration
bool IsLessThan(Signature signatureA, Signature signatureB)
Parameters
Type | Name | Description |
---|---|---|
Signature | signatureA | |
Signature | signatureB |
Returns
Type | Description |
---|---|
System.Boolean |
IsLessThan(Symbol, Symbol)
Declaration
bool IsLessThan(Symbol symbolA, Symbol symbolB)
Parameters
Type | Name | Description |
---|---|---|
Symbol | symbolA | |
Symbol | symbolB |
Returns
Type | Description |
---|---|
System.Boolean |
IsNegative(Signature)
Whether the signature is negative (is classically negated).
Declaration
bool IsNegative(Signature signature)
Parameters
Type | Name | Description |
---|---|---|
Signature | signature | the target signature |
Returns
Type | Description |
---|---|
System.Boolean | whether the signature has a sign |
IsNegative(Symbol, out Boolean)
Check if a function is negative (has a sign).
Declaration
bool IsNegative(Symbol symbol, out bool negative)
Parameters
Type | Name | Description |
---|---|---|
Symbol | symbol | the target symbol |
System.Boolean | negative | the result |
Returns
Type | Description |
---|---|
System.Boolean |
|
IsPositive(Signature)
Whether the signature is positive (is not classically negated).
Declaration
bool IsPositive(Signature signature)
Parameters
Type | Name | Description |
---|---|---|
Signature | signature | the target signature |
Returns
Type | Description |
---|---|
System.Boolean | whether the signature has no sign |
IsPositive(Symbol, out Boolean)
Check if a function is positive (does not have a sign).
Declaration
bool IsPositive(Symbol symbol, out bool positive)
Parameters
Type | Name | Description |
---|---|---|
Symbol | symbol | the target symbol |
System.Boolean | positive | the result |
Returns
Type | Description |
---|---|
System.Boolean |
|
ToString(Symbol, out String)
Get the string representation of a symbol.
Declaration
bool ToString(Symbol symbol, out string value)
Parameters
Type | Name | Description |
---|---|---|
Symbol | symbol | the target symbol |
System.String | value | the resulting string |
Returns
Type | Description |
---|---|
System.Boolean |
|