cideSent :: DecideAtom t p => Sent (Atomic p t) a -> Dec (DecideS t a)
decideSent = \case
  Atom (A p as) -> decideAtom p as
  Neg p         -> case decideSent p of
    Proven  a -> Refuted "negation" $ \k -> k a
    Refuted _ j -> Proven j
  p :& q        -> case (decideSent p, decideSent q) of
    (Proven  a  ,Proven  b  ) -> Proven (a,b)
    (Refuted e j,_          ) -> Refuted e $ \(a,_) -> j a
    (_          ,Refuted e k) -> Refuted e $ \(_,b) -> k b
  p :| q        -> case (decideSent p, decideSent q) of
    (Refuted e1 j,Refuted e2 k) -> Refuted (e1 ++ "\n" ++ e2) $ \case
      Left  a -> j a
      Right b -> k b
    (Proven  a,_        ) -> Proven $ Left  a
    (_        ,Proven  b) -> Proven $ Right b
  p :-> q       -> case (decideSent p, decideSent q) of
    (Proven  a,Refuted e k) -> Refuted ("conditional: " ++ e) $ \case
      Left  j -> j a
      Right b -> k b
    (_        ,Proven  b) -> Proven  $ Right b
    (Refuted _ j,_        ) -> Proven  $ Left  j
  -- p :-> q       -> case (decideSent p, decideSent q) of
  --   (Proven  a,Refuted k) -> Refuted $ \l -> k $ l a
  --   (_        ,Proven  b) -> Proven  $ \_ -> b
  --   (Refuted j,_        ) -> Proven  $ absurd . j


decideSent :: DecideAtom t p => Sent (Atomic p t) a -> Dec (DecideS t a)
decideSent = \case
  Atom (A p as) -> decideAtom p as
  Neg p         -> case decideSent p of
    Proven  a -> Refuted "negation" $ \k -> k a
    Refuted _ j -> Proven j
  p :& q        -> case (decideSent p, decideSent q) of
    (Proven  a  ,Proven  b  ) -> Proven (a,b)
    (Refuted e j,_          ) -> Refuted e $ \(a,_) -> j a
    (_          ,Refuted e k) -> Refuted e $ \(_,b) -> k b
  p :| q        -> case (decideSent p, decideSent q) of
    (Refuted e1 j,Refuted e2 k) -> Refuted (e1 ++ "\n" ++ e2) $ \case
      Left  a -> j a
      Right b -> k b
    (Proven  a,_        ) -> Proven $ Left  a
    (_        ,Proven  b) -> Proven $ Right b
  p :-> q       -> case (decideSent p, decideSent q) of
    (Proven  a,Refuted e k) -> Refuted ("conditional: " ++ e) $ \case
      Left  j -> j a
      Right b -> k b
    (_        ,Proven  b) -> Proven  $ Right b
    (Refuted _ j,_        ) -> Proven  $ Left  j
  -- p :-> q       -> case (decideSent p, decideSent q) of
  --   (Proven  a,Refuted k) -> Refuted $ \l -> k $ l a
  --   (_        ,Proven  b) -> Proven  $ \_ -> b
  --   (Refuted j,_        ) -> Proven  $ absurd . j
decideSent = \case
  Atom (A p as) -> decideAtom p as
  Neg p         -> case decideSent p of
    Proven  a -> Refuted "negation" $ \k -> k a
    Refuted _ j -> Proven j
  p :& q        -> case (decideSent p, decideSent q) of
    (Proven  a  ,Proven  b  ) -> Proven (a,b)
    (Refuted e j,_          ) -> Refuted e $ \(a,_) -> j a
    (_          ,Refuted e k) -> Refuted e $ \(_,b) -> k b
  p :| q        -> case (decideSent p, decideSent q) of
    (Refuted e1 j,Refuted e2 k) -> Refuted (e1 ++ "\n" ++ e2) $ \case
      Left  a -> j a
      Right b -> k b
    (Proven  a,_        ) -> Proven $ Left  a
    (_        ,Proven  b) -> Proven $ Right b
  p :-> q       -> case (decideSent p, decideSent q) of
    (Proven  a,Refuted e k) -> Refuted ("conditional: " ++ e) $ \case
      Left  j -> j a
      Right b -> k b
    (_        ,Proven  b) -> Proven  $ Right b
    (Refuted _ j,_        ) -> Proven  $ Left  j
  -- p :-> q       -> case (decideSent p, decideSent q) of
  --   (Proven  a,Refuted k) -> Refuted $ \l -> k $ l a
  --   (_        ,Proven  b) -> Proven  $ \_ -> b
  --   (Refuted j,_        ) -> Proven  $ absurd . j