Show / Hide Table of Contents

Delegate GroundCallback

Callback function to implement external functions.

If an external function of form @name(parameters) occurs in a logic program, then this function is called with its location, name, parameters, and a callback to inject symbols as arguments.The callback can be called multiple times; all symbols passed are injected.

If a (non-recoverable) clingo API function fails in this callback, for example, the symbol callback, the callback must return false. In case of errors not related to clingo, this function can set error Unknown and return false to stop grounding with an error.

Namespace: ClingoSharp.CoreServices.Callbacks
Assembly: ClingoSharp.CoreServices.dll
Syntax
public delegate bool GroundCallback(Location location, string name, Symbol[] arguments, IntPtr data, SymbolCallback callback, IntPtr callbackData);
Parameters
Type Name Description
Location location

location from which the external function was called

System.String name

name of the called external function

Symbol[] arguments

arguments of the called external function

System.IntPtr data

user data of the callback

SymbolCallback callback

function to inject symbols

System.IntPtr callbackData

user data for the symbol callback (must be passed untouched)

Returns
Type Description
System.Boolean

true if the function is success, false otherwise

  • Improve this Doc
  • View Source
Back to top Generated by DocFX