next up previous
Next: 6 Hybrid Domains Up: 5 Predicates and Functions Previous: 5.2 Internal Functions and

5.3 Linked-In Functions and Predicates

If a predicate or function is not internally implemented in Alchemy, but you wish to use it, then you can define this as a piece of C++ code. The file ALCHDIR/exdata/functions.cpp serves as a template for building linked-in functions and predicates. Here are some basic guidelines:

0in

In order to use linked-in functions in an MLN, the functions have to be declared and the location of the C++ file has to be disclosed. The location of the file is arbitrary; however, it must be made available to Alchemy. Here are the steps:

0in

The name of the types is arbitrary; however, the user is responsible for ensuring they can be converted to integers, etc. in the function itself, if needed. When the include statement is encountered, the C++ file is compiled and a shared object file functions.so is put in the current directory. This file is used to dynamically call the linked-in functions and predicates.


next up previous
Next: 6 Hybrid Domains Up: 5 Predicates and Functions Previous: 5.2 Internal Functions and
Marc Sumner 2010-01-22