Starting tracer

This commit is contained in:
2026-02-09 10:56:15 +01:00
parent 694a84fb00
commit b80077f3a7
9 changed files with 110 additions and 176 deletions

View File

@ -1,4 +1,4 @@
use std::fmt::Display;
use std::{default, fmt::Display};
use log::info;
@ -25,9 +25,9 @@ impl Display for ProofType
pub trait Tracer
{
fn next_step(&mut self, proof_type: ProofType) -> Self;
fn milestone<T: Display>(&self, str: T);
fn explain<T: Display>(&self, str: T);
fn begin_proof<T: Display>(&self, proof_type: ProofType) -> Self;
fn print_step<T: Display>(&self, show: T);
fn end_proof(self);
}
pub struct SimpleTracer
@ -35,21 +35,29 @@ pub struct SimpleTracer
proof_type: ProofType,
}
impl SimpleTracer
{
pub fn new(proof_type: ProofType) -> Self
{
Self { proof_type }
}
}
impl Tracer for SimpleTracer
{
fn next_step(&mut self, proof_type: ProofType) -> Self
fn begin_proof<T: Display>(&self, proof_type: ProofType) -> Self
{
SimpleTracer { proof_type }
}
fn explain<T: Display>(&self, str: T)
fn print_step<T: Display>(&self, show: T)
{
let proof_str = format!("{}", self.proof_type);
info!(target: &proof_str, "{}", str);
let str = format!("{}", self.proof_type);
info!(target: &str, "{}", show);
}
fn milestone<T: Display>(&self, str: T)
fn end_proof(self)
{
self.explain(str);
todo!()
}
}