From 81664ccad02b3ce852eadf91e9cb4eee01ee6cd9 Mon Sep 17 00:00:00 2001 From: DualFroz Date: Mon, 24 Aug 2026 12:25:00 +0200 Subject: [PATCH] feat(cdcl): add solver statistics --- src/Sift/Stats.hs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/Sift/Stats.hs diff --git a/src/Sift/Stats.hs b/src/Sift/Stats.hs new file mode 100644 index 0000000..f99e56e --- /dev/null +++ b/src/Sift/Stats.hs @@ -0,0 +1,27 @@ +module Sift.Stats + ( Stats(..) + , emptyStats + , renderStats + ) where + +data Stats = Stats + { statsDecisions :: Int + , statsConflicts :: Int + , statsPropagations :: Int + , statsRestarts :: Int + , statsLearned :: Int + , statsRemoved :: Int + } deriving (Eq, Show) + +emptyStats :: Stats +emptyStats = Stats 0 0 0 0 0 0 + +renderStats :: Stats -> [String] +renderStats st = + [ "c decisions " ++ show (statsDecisions st) + , "c conflicts " ++ show (statsConflicts st) + , "c propagations " ++ show (statsPropagations st) + , "c restarts " ++ show (statsRestarts st) + , "c learned " ++ show (statsLearned st) + , "c removed " ++ show (statsRemoved st) + ]