.. index:: single: sat_output
.. _sat_output/0:

.. rst-class:: right

**object**

``sat_output``
==============

Whole-document Kissat, CaDiCaL, Glucose, and Z3 plain-text output decoding.

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

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

| **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/8
.. _sat_output/0::decode/8:

``decode/8``
^^^^^^^^^^^^

Decodes captured stdout and process metadata into a collected ``sat_result(Status, Model, Properties)`` term, mapping reported literals back through an optional ``Variables`` table.

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

| **Template:**
|    ``decode(Solver,Codes,RawStatus,NormalizedStatus,Diagnostics,SourceMap,Variables,Result)``
| **Mode and number of proofs:**
|    ``decode(+atom,+list(code),+term,+compound,+list(code),+list(compound),+term,-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`` has no status line or an unsupported status label:
|        ``domain_error(sat_output,Field-Value)``
|    The witness line is missing its zero terminator:
|        ``domain_error(sat_output,witness_terminator_missing)``
|    A witness literal number has no entry in the variable table:
|        ``domain_error(sat_output,variable(Number))``
|    ``RawStatus`` is not a ground term:
|        ``instantiation_error``
|    ``NormalizedStatus`` is not a ground term:
|        ``instantiation_error``
|    ``NormalizedStatus`` is fatal or inconsistent with the decoded solver result:
|        ``domain_error(sat_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)``
|    ``Variables`` is not a ground term:
|        ``instantiation_error``
|    ``Variables`` is ground but neither ``none`` nor a list of pairs:
|        ``type_error(list(pair),Variables)``


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

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

(no local declarations; see entity ancestors if any)

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

(no local declarations; see entity ancestors if any)

Operators
---------

(none)

