diff options
| author | Richard Qin <richard.qin.x@gmail.com> | 2026-04-04 04:53:55 +0800 |
|---|---|---|
| committer | Richard Qin <richard.qin.x@gmail.com> | 2026-04-04 04:53:55 +0800 |
| commit | 0d7c8177171be1d0c077e468ee743697dd8c6914 (patch) | |
| tree | 5de7e43a61f232c9bae918f23e8af8f9cdcb6e4c /include | |
| parent | ae88efa5d8e100c05dcba1f9a7bb9ff840b47d66 (diff) | |
| download | ratp-0d7c8177171be1d0c077e468ee743697dd8c6914.tar.gz ratp-0d7c8177171be1d0c077e468ee743697dd8c6914.tar.xz | |
feat: implement proof trace extraction and add proof trace test
Diffstat (limited to 'include')
| -rw-r--r-- | include/atp/proof/proof_trace.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/include/atp/proof/proof_trace.h b/include/atp/proof/proof_trace.h index cda6c5b..a80a327 100644 --- a/include/atp/proof/proof_trace.h +++ b/include/atp/proof/proof_trace.h @@ -16,14 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ - #pragma once /// @file proof_trace.h /// @brief Proof reconstruction from the empty clause back to axioms. -/// -/// This module depends only on ClauseStore (not Prover), so it can be -/// reused with any search strategy. #include "atp/core/clause.h" #include "atp/core/clause_store.h" @@ -40,15 +36,20 @@ struct ProofStep { InferenceRule rule; ClauseId parent1; ClauseId parent2; - std::string description; ///< Human-readable description }; /// Reconstruct the proof trace from the empty clause. -/// Walks parent pointers via ClauseStore, independent of search strategy. -std::vector<ProofStep> extractProof(const ClauseStore& store, ClauseId empty_clause_id, - const TermBank& bank); +/// Returns steps in topological order: axioms first, empty clause last. +std::vector<ProofStep> extractProof(const ClauseStore& store, ClauseId empty_clause_id); + +/// Convert a TermId back to a human-readable string. +std::string termToString(TermId id, const TermBank& bank); + +/// Convert a Clause to a human-readable string. +std::string clauseToString(const Clause& clause, const TermBank& bank); /// Format a proof as a human-readable string. -std::string formatProof(const std::vector<ProofStep>& proof, const TermBank& bank); +std::string formatProof(const std::vector<ProofStep>& proof, + const ClauseStore& store, const TermBank& bank); } // namespace atp |
