.. index:: single: smt_output
.. _smt_output/0:

.. rst-class:: right

**object**

``smt_output``
==============

Whole-document S-expression tokenizing, parsing, and content-based response classification for Z3, cvc5, Bitwuzla, and Yices 2 plain-text output decoding.

| **Availability:** 
|    ``logtalk_load(smt(loader))``

| **Author:** Paulo Moura
| **Version:** 1:0:0
| **Date:** 2026-11-14

| **Compilation flags:**
|    ``static, context_switching_calls``


| **Uses:**
|    :ref:`list <list/0>`
|    :ref:`type <type/0>`

| **Remarks:**
|    (none)

| **Inherited public predicates:**
|    (none)

.. contents::
   :local:
   :backlinks: top

Public predicates
-----------------

.. index:: decode/7
.. _smt_output/0::decode/7:

``decode/7``
^^^^^^^^^^^^

Decodes captured stdout and process metadata into a list of collected ``smt_result(Status, Model, Properties)`` terms, one per check response, including objective responses when present.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``decode(Solver,Codes,RawStatus,NormalizedStatus,Diagnostics,SourceMap,Results)``
| **Mode and number of proofs:**
|    ``decode(+atom,+list(code),+term,+compound,+list(code),+list(compound),-list(compound))`` - ``one_or_error``

| **Exceptions:**
|    ``Solver`` is not a ground term:
|        ``instantiation_error``
|    ``Solver`` is neither a variable nor an atom:
|        ``type_error(atom,Solver)``
|    ``Codes`` is a partial list or a list with an element ``Element`` which is a variable:
|        ``instantiation_error``
|    ``Codes`` is neither a partial list nor a list of character codes:
|        ``type_error(codes,Codes)``
|    ``Codes`` contains an unrecognized character or an unbalanced parenthesis:
|        ``domain_error(smt_output,Field-Value)``
|    A model, unsat core, or get-value response appears before any status response:
|        ``domain_error(smt_output,Response-unexpected)``
|    The solver reported an ``(error ...)`` response:
|        ``smt_solver_reported_error(Message)``
|    The solver reported an unsupported command:
|        ``smt_solver_reported_error(unsupported)``
|    ``RawStatus`` is not a ground term:
|        ``instantiation_error``
|    ``NormalizedStatus`` is not a ground term:
|        ``instantiation_error``
|    ``NormalizedStatus`` is neither a variable nor one of ``exit(Code)``, ``unknown(Details)``, nor ``killed(Details)``:
|        ``domain_error(smt_process_status,NormalizedStatus)``
|    No response was parsed and the process did not exit cleanly:
|        ``domain_error(smt_process_status,NormalizedStatus)``
|    ``Diagnostics`` is a partial list or a list with an element ``Element`` which is a variable:
|        ``instantiation_error``
|    ``Diagnostics`` is neither a partial list nor a list of character codes:
|        ``type_error(codes,Diagnostics)``
|    ``SourceMap`` is a partial list or a list with an element ``Element`` which is a variable:
|        ``instantiation_error``
|    ``SourceMap`` is neither a variable nor a list:
|        ``type_error(list,SourceMap)``


------------

Protected predicates
--------------------

(no local declarations; see entity ancestors if any)

Private predicates
------------------

(no local declarations; see entity ancestors if any)

Operators
---------

(none)

