Skip to content

msuresh1993/pythonXSB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Moved to https://bitbucket.org/pythonxsb/

To use this interface:
1. Open the file ld_pymod.P and change the python header file directory and xsb directory 

To call a python function:
1. run ['ld_pymod'].
2. callpy(MODULE_NAME, FUNCTION_NAME(parameter1,parameter2,...),X).
type - int, float, list, string, ref

Examples:
Simple python module that tests state being maintained, object passing and everything else. 
callpy(dict_test, init_dict(),X).  //note: you could combine these 3 predicates but since the first object 
								   //created will have the reference ref_1 query 2 just directly uses it. 
callpy(dict_test, add_dict(ref_1,5,10),X). // ref_1 is the id of the python object reference. hardcoded in this 
							     //example, not necessarry to do so. 

callpy(dict_test, get_value((ref_1,ref),(5,int)),X).

Dictionary Example: 
	callpy(dict_test, init_dict(), X), assert(keyval(X, dict)).
	keyval(X, dict), callpy(dict_test, add_dict(X, hello, world), Z).
	keyval(X,dict), callpy(dict_test, get_value(X, hello),Z).


Releases

No releases published

Packages

No packages published

Languages