Interface IControlModule
Functions to control the grounding and solving process.
Namespace: ClingoSharp.CoreServices.Interfaces.Modules
Assembly: ClingoSharp.CoreServices.dll
Syntax
public interface IControlModule : IClingoModule
Methods
| Improve this Doc View SourceAdd(Control, String, String[], String)
Extend the logic program with the given non-ground logic program in string form.
This function puts the given program into a block of form: #program name(parameters).
After extending the logic program, the corresponding program parts are typically grounded with
Declaration
bool Add(Control control, string name, string[] parameters, string program)
Parameters
Type | Name | Description |
---|---|---|
Control | control | a control ponter |
System.String | name | name of the program block |
System.String[] | parameters | string array of parameters of the program block |
System.String | program | string representation of the program |
Returns
Type | Description |
---|---|
System.Boolean |
|
Free(Control)
Frees a control object created with New(String[], LoggerCallback, UInt32, out Control)
Declaration
void Free(Control control)
Parameters
Type | Name | Description |
---|---|---|
Control | control | a control pointer |
GetConst(Control, String, out Symbol)
Return the symbol for a constant definition of form: #const name = symbol.
Declaration
bool GetConst(Control control, string name, out Symbol symbol)
Parameters
Type | Name | Description |
---|---|---|
Control | control | the target |
System.String | name | the name of the constant |
Symbol | symbol | the resulting symbol |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetSymbolicAtoms(Control, out SymbolicAtoms)
Get an object to inspect symbolic atoms (the relevant Herbrand base) used for grounding
Declaration
bool GetSymbolicAtoms(Control control, out SymbolicAtoms symbolicAtoms)
Parameters
Type | Name | Description |
---|---|---|
Control | control | the target |
SymbolicAtoms | symbolicAtoms | the symbolic atoms object |
Returns
Type | Description |
---|---|
System.Boolean |
|
Ground(Control, Part[], GroundCallback)
Ground the selected parts of the current (non-ground) logic program.
After grounding, logic programs can be solved with
#program
specification are by default put into a program called base without arguments.
Declaration
bool Ground(Control control, Part[] parts, GroundCallback callback)
Parameters
Type | Name | Description |
---|---|---|
Control | control | a control ponter |
Part[] | parts | array of parts to ground |
GroundCallback | callback | callback to implement external functions |
Returns
Type | Description |
---|---|
System.Boolean |
|
HasConst(Control, String, out Boolean)
Check if there is a constant definition for the given constant.
Declaration
bool HasConst(Control control, string name, out bool exists)
Parameters
Type | Name | Description |
---|---|---|
Control | control | the target |
System.String | name | the name of the constant |
System.Boolean | exists | whether a matching constant definition exists |
Returns
Type | Description |
---|---|
System.Boolean |
|
New(String[], LoggerCallback, UInt32, out Control)
Creates a new control object.
Declaration
bool New(string[] arguments, LoggerCallback logger, uint messageLimit, out Control control)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | arguments | An array of command line arguments |
LoggerCallback | logger | callback functions for warnings and info messages |
System.UInt32 | messageLimit | maximum number of times the logger callback is called |
Control | control | resulting control object |
Returns
Type | Description |
---|---|
System.Boolean |
|
Solve(Control, SolveMode, Literal[], SolveEventHandler, out SolveHandle)
Solve the currently grounded logic program enumerating its models.
Declaration
bool Solve(Control control, SolveMode mode, Literal[] assumptions, SolveEventHandler callback, out SolveHandle handle)
Parameters
Type | Name | Description |
---|---|---|
Control | control | a control ponter |
SolveMode | mode | configures the search mode |
Literal[] | assumptions | array of assumptions to solve under |
SolveEventHandler | callback | the event handler to register |
SolveHandle | handle | handle to the current search to enumerate models |
Returns
Type | Description |
---|---|
System.Boolean |
|