From ec6286ffab76eefffb098402ef21a0d9b30acd14 Mon Sep 17 00:00:00 2001 From: bakaq Date: Sat, 12 Oct 2024 16:58:38 -0300 Subject: [PATCH] Shrink MVP API surface --- src/machine/lib_machine.rs | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/src/machine/lib_machine.rs b/src/machine/lib_machine.rs index e05ed2a6..720cba26 100644 --- a/src/machine/lib_machine.rs +++ b/src/machine/lib_machine.rs @@ -41,23 +41,6 @@ pub enum LeafAnswer { }, } -impl LeafAnswer { - /// True if leaf answer failed. - /// - /// This gives [`false`] for exceptions. - pub fn failed(&self) -> bool { - matches!(self, LeafAnswer::False) - } - - /// True if leaf answer may have succeeded. - /// - /// When a leaf answer has residual goals the success is conditional on the satisfiability of - /// the contraints they represent. This gives [`false`] for exceptions. - pub fn maybe_succeeded(&self) -> bool { - matches!(self, LeafAnswer::True | LeafAnswer::LeafAnswer { .. }) - } -} - /// Represents a Prolog term. #[non_exhaustive] #[derive(Debug, Clone, PartialEq)] @@ -156,25 +139,6 @@ impl Term { } } -impl From for Term { - fn from(value: LeafAnswer) -> Self { - match value { - LeafAnswer::True => Term::atom("true"), - LeafAnswer::False => Term::atom("false"), - LeafAnswer::Exception(inner) => match inner.clone() { - Term::Compound(functor, args) if functor == "error" && args.len() == 2 => inner, - _ => Term::compound("throw", [inner]), - }, - LeafAnswer::LeafAnswer { - bindings: _, - residual_goals: _, - } => { - todo!() - } - } - } -} - /// This is an auxiliary function to turn a count into names of anonymous variables like _A, _B, /// _AB, etc... fn count_to_letter_code(mut count: usize) -> String { -- 2.54.0