| Home | Trees | Indices | Help |
|
|---|
|
|
Python interface to ECLiPSe Prolog (http://eclipseclp.org)
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Constructor method Usage: eclipse( path, args ) path - path to ECLiPSe executable (default: 'eclipse') args - command line arguments (default: '') self.engine becomes pexpect spawn instance of ECLiPSe Prolog shell Raises: ECLiPSeExecutableNotFound |
Loads module into self.engine Usage: instance.load( path ) path - path to module file Raises: ECLiPSeCompileError |
Queries current engine state
Usage: instance.query( query )
query - usual ECLiPSe Prolog query (example: 'likes( X, Y )')
Returns:
True - if yes/no query and answer is yes
False - if yes/no query and answer is no
List of dictionaries - if normal query. Dictionary keys are returned
variable names. Example:
>>> instance.query( 'likes( Person, Food )' )
[{'Person': 'john', 'Food': 'curry'}, {'Person': 'sandy', 'Food': 'mushrooms'}]
Raises: ECLiPSeQueryError
|
Private method for constructing a result printing query. Usage: instance._printer( lvars, query ) lvars - list of logical variables to print query - query containing the variables to be printed Returns: string of the form 'query, writeln( res( 'VarName1', VarName1 ) ) ... writeln( res( 'VarNameN', VarNameN ) ),nl,fail.' |
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Wed Aug 1 18:44:56 2012 | http://epydoc.sourceforge.net |