Adds operators
This commit is contained in:
@ -1,21 +1,17 @@
|
||||
use std::{default, fmt::Display};
|
||||
use std::fmt::Display;
|
||||
|
||||
use log::info;
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum ProofType
|
||||
{
|
||||
pub enum ProofType {
|
||||
Body,
|
||||
And,
|
||||
Predicate,
|
||||
}
|
||||
|
||||
impl Display for ProofType
|
||||
{
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result
|
||||
{
|
||||
match self
|
||||
{
|
||||
impl Display for ProofType {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
ProofType::Body => write!(f, "body_prover"),
|
||||
ProofType::And => write!(f, "and_prover"),
|
||||
ProofType::Predicate => write!(f, "predicate_prover"),
|
||||
@ -23,41 +19,33 @@ impl Display for ProofType
|
||||
}
|
||||
}
|
||||
|
||||
pub trait Tracer
|
||||
{
|
||||
pub trait Tracer {
|
||||
fn begin_proof(&self, proof_type: ProofType) -> Self;
|
||||
fn print_step<T: Display>(&self, show: T);
|
||||
fn end_proof(self);
|
||||
}
|
||||
|
||||
pub struct SimpleTracer
|
||||
{
|
||||
pub struct SimpleTracer {
|
||||
proof_type: ProofType,
|
||||
}
|
||||
|
||||
impl SimpleTracer
|
||||
{
|
||||
pub fn new(proof_type: ProofType) -> Self
|
||||
{
|
||||
impl SimpleTracer {
|
||||
pub fn new(proof_type: ProofType) -> Self {
|
||||
Self { proof_type }
|
||||
}
|
||||
}
|
||||
|
||||
impl Tracer for SimpleTracer
|
||||
{
|
||||
fn begin_proof(&self, proof_type: ProofType) -> Self
|
||||
{
|
||||
impl Tracer for SimpleTracer {
|
||||
fn begin_proof(&self, proof_type: ProofType) -> Self {
|
||||
SimpleTracer { proof_type }
|
||||
}
|
||||
|
||||
fn print_step<T: Display>(&self, show: T)
|
||||
{
|
||||
fn print_step<T: Display>(&self, show: T) {
|
||||
let str = format!("{}", self.proof_type);
|
||||
info!(target: &str, "{}", show);
|
||||
}
|
||||
|
||||
fn end_proof(self)
|
||||
{
|
||||
fn end_proof(self) {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
use log::debug;
|
||||
|
||||
use crate::ast::Predicate;
|
||||
use crate::prover::constraints::Constraints;
|
||||
|
||||
Reference in New Issue
Block a user