{-# OPTIONS --rewriting #-}
module @0 Tests where
open import CoverageCheck
open import CoverageCheck.Data.Set as Set using (Set)
open import CoverageCheck.Data.Set.Rewriting using ()
open import Haskell.Data.List.NonEmpty using (_∷_)
pattern `unit = 'u' ∷ 'n' ∷ 'i' ∷ 't' ∷ []
pattern `list = 'l' ∷ 'i' ∷ 's' ∷ 't' ∷ []
pattern `nil = 'n' ∷ 'i' ∷ 'l' ∷ []
pattern `one = 'o' ∷ 'n' ∷ 'e' ∷ []
pattern `cons = 'c' ∷ 'o' ∷ 'n' ∷ 's' ∷ []
pattern ⟨unit⟩ = `unit ⟨ InHere ⟩
pattern ⟨list⟩ = `list ⟨ InThere InHere ⟩
pattern ⟨nil⟩ = `nil ⟨ InHere ⟩
pattern ⟨one⟩ = `one ⟨ InThere InHere ⟩
pattern ⟨cons⟩ = `cons ⟨ InThere (InThere InHere) ⟩
pattern unit = con ⟨unit⟩ []
pattern nil = con ⟨nil⟩ []
pattern one x = con ⟨one⟩ (x ∷ [])
pattern cons x xs = con ⟨cons⟩ (x ∷ xs ∷ [])
instance
globals : Globals
globals .dataScope = `unit ∷# `list ∷# []
globals .conScope ⟨unit⟩ = `unit ∷# []
globals .conScope ⟨list⟩ = `nil ∷# `one ∷# `cons ∷# []
unitDef : Dataty ⟨unit⟩
unitDef .dataCons = _
unitDef .isConScope = refl
unitDef .argsTy ⟨unit⟩ = []
listDef : Dataty ⟨list⟩
listDef .dataCons = _
listDef .isConScope = refl
listDef .argsTy ⟨nil⟩ = []
listDef .argsTy ⟨one⟩ = TyData ⟨unit⟩ ∷ []
listDef .argsTy ⟨cons⟩ = TyData ⟨unit⟩ ∷ TyData ⟨list⟩ ∷ []
sig : Signature
sig .dataDefs ⟨unit⟩ = unitDef
sig .dataDefs ⟨list⟩ = listDef
nonEmptyAxiom : {α : Ty} → Value α
nonEmptyAxiom {TyData ⟨unit⟩} = con ⟨unit⟩ []
nonEmptyAxiom {TyData ⟨list⟩} = con ⟨nil⟩ []
P : PatternMatrix (TyData ⟨list⟩ ∷ TyData ⟨list⟩ ∷ [])
P =
(nil ∷ — ∷ []) ∷
(— ∷ nil ∷ []) ∷ []
_ : decExhaustive P
≡ Left (
((cons — — ∷ cons — — ∷ []) ⟨ _ ⟩) ∷
((one — ∷ cons — — ∷ []) ⟨ _ ⟩) ∷
((cons — — ∷ one — ∷ []) ⟨ _ ⟩) ∷
((one — ∷ one — ∷ []) ⟨ _ ⟩) ∷ [])
_ = refl
_ : decAllNonRedundant P ≡ Right _
_ = refl
Q : PatternMatrix (TyData ⟨list⟩ ∷ TyData ⟨list⟩ ∷ [])
Q =
(nil ∷ — ∷ []) ∷
(— ∷ nil ∷ []) ∷
(one — ∷ — ∷ []) ∷
(— ∷ one — ∷ []) ∷
(cons — — ∷ — ∷ []) ∷
(— ∷ cons — — ∷ []) ∷ []
_ : decExhaustive Q ≡ Right (Erased (the (∀ vs → FirstMatch vs Q) _))
_ = refl
_ : decAllNonRedundant Q
≡ (Left
$ there
$ there
$ there
$ there
$ there
$ Erased
(the
(¬ Useful
( (nil ∷ — ∷ []) ∷
(— ∷ nil ∷ []) ∷
(one — ∷ — ∷ []) ∷
(— ∷ one — ∷ []) ∷
(cons — — ∷ — ∷ []) ∷ [])
(— ∷ cons — — ∷ []))
_)
∷ [])
_ = refl