The core of the IDP-Z3 software is a Python component available on Pypi. The following code illustrates how to invoke it.
from idp_engine import IDP, model_expand kb = IDP.from_file("path/to/file.idp") T, S = kb.get_blocks("T, S") for model in model_expand(T,S): print(model)
Besides the methods and class available in the main block,
idp_engine exposes the
IDP class, described below.
IDP class exposes the following methods:
- from_file(file_path: str)
This class method parses the IDP source code in the file located at
- from_str(code: str)
This class method parses the IDP source code in the
DEPRECATED: This class method parses the IDP source code in the file or string.
This instance method returns the list of blocks whose names are given in a comma-separated string.
This instance methods executes the main() procedure block in the IDP source file.