execute_prolog
Submit Prolog facts and rules with a query to obtain reasoning results. Supports CLP(FD) constraints, negation-as-failure, and standard SWI-Prolog features.
Instructions
Execute Prolog code and return reasoning results.
Write Prolog facts and rules, then run a query against them. Supports CLP(FD) constraints, negation-as-failure, and all standard SWI-Prolog features.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prolog_code | Yes | Prolog code (facts and rules). | |
| query | Yes | Prolog query to execute (e.g. "mortal(X)"). | |
| rule_bases | No | Names of previously saved rule bases to include. Rules are prepended to ``prolog_code`` in the specified order. Use this for domain-specific rules (e.g. game mechanics, legal rules) that should be reused across queries. | |
| max_results | No | Maximum number of results (prevents infinite loops). | |
| trace | No | When True, include structured proof trees per solution in metadata.proof_trace. Adds meta-interpreter overhead; opt-in. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||