API¶
Documentation of the metasp API.
Main module¶
metasp
¶
The metasp project.
MetaspExtension
¶
Bases: ReifyExtension
Metasp Extension for the reification process. It uses ASPEN to transform the input program and then reifies it with the help of the FormulaRegistery to keep track of the formulas and their types.
add_extension_encoding(ctl: Control) -> None
¶
Adds the extension encoding to the control object. Args: ctl (Control): The clingo control object to which the encoding will be added.
additional_symbols() -> Sequence[Symbol]
¶
Provides additional symbols to be added to the reified program. In this case, it provides the symbols for the formulas in the formula registery.
MetaspProcessor
¶
reify_and_extend(prg: str, constants: dict[str, str]) -> str
¶
Reify the input data with the given constants. The input program is expected to be first transformed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prg
|
str
|
The input data to be reified. |
required |
constants
|
dict[str, str]
|
The constants to be used in the reification. |
required |
Returns: str: The reified input data.
Printing functions¶
metasp.printing
¶
Module with all printing functions that will be available for the print_model Custom printing functions can be provided by adding the script in the configuration
pretty_printer(model: Model, system) -> None
¶
Print the model with color highlighting the internal symbols (those starting with &) in yellow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Model
|
The clingo model to be printed. |
required |
system
|
MetaSystem
|
The metasp system. |
required |
temporal_printer(model: Model, system) -> None
¶
Prints the model as in telingo, separating the states.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Model
|
The clingo model to be printed. |
required |
system
|
MetaSystem
|
The metasp system. |
required |