module Common.SecurityLabels where
open import Data.Maybe
open import Data.Bool renaming (Bool to πΉ; _β_ to _βα΅_)
open import Data.Unit using (β€; tt)
open import Data.Sum using (_β_; injβ; injβ)
open import Data.Product using (_Γ_; β; β-syntax) renaming (_,_ to β¨_,_β©)
open import Data.List using (List; []; _β·_)
open import Function using (case_of_)
open import Relation.Nullary using (Β¬_; Dec; yes; no)
open import Relation.Nullary.Negation using (contradiction)
open import Relation.Binary using (_β_)
open import Relation.Binary.PropositionalEquality
using (_β‘_; _β’_; refl; trans; sym; subst; cong; congβ)
open import Common.Utils
data StaticLabel : Set where
high : StaticLabel
low : StaticLabel
data Label : Set where
β : Label
l : StaticLabel β Label
data Concrete : Label β Set where
l : β {β} β Concrete (l β)
data Unk : Label β Set where
β : Unk β
concrete-or-unk : β g β Concrete g β Unk g
concrete-or-unk β = injβ β
concrete-or-unk (l β) = injβ l
infix 4 _=?_
infix 4 _==?_
_=?_ : β (ββ ββ : StaticLabel) β Dec (ββ β‘ ββ)
low =? low = yes refl
high =? high = yes refl
low =? high = no Ξ» ()
high =? low = no Ξ» ()
_==?_ : β (gβ gβ : Label) β Dec (gβ β‘ gβ)
β ==? β = yes refl
β ==? l β = no Ξ» ()
l β ==? β = no Ξ» ()
l ββ ==? l ββ with ββ =? ββ
... | yes refl = yes refl
... | no neq = no (Ξ» { refl β contradiction refl neq })
infix 5 _βΌ_
data _βΌ_ : StaticLabel β StaticLabel β Set where
lβΌl : low βΌ low
lβΌh : low βΌ high
hβΌh : high βΌ high
lowβΌ : β β β low βΌ β
lowβΌ low = lβΌl
lowβΌ high = lβΌh
_βΌhigh : β β β β βΌ high
low βΌhigh = lβΌh
high βΌhigh = hβΌh
βΌ-refl : β {β} β β βΌ β
βΌ-refl {high} = hβΌh
βΌ-refl {low} = lβΌl
βΌ-trans : β {ββ ββ ββ}
β ββ βΌ ββ β ββ βΌ ββ β ββ βΌ ββ
βΌ-trans lβΌl lβΌl = lβΌl
βΌ-trans lβΌl lβΌh = lβΌh
βΌ-trans lβΌh hβΌh = lβΌh
βΌ-trans hβΌh hβΌh = hβΌh
βΌ-antisym : β {ββ ββ}
β ββ βΌ ββ β ββ βΌ ββ β ββ β‘ ββ
βΌ-antisym lβΌl lβΌl = refl
βΌ-antisym hβΌh hβΌh = refl
β‘ββΌ : β {ββ ββ} β ββ β‘ ββ β ββ βΌ ββ
β‘ββΌ refl = βΌ-refl
infix 4 _βΌ?_
_βΌ?_ : β ββ ββ β Dec (ββ βΌ ββ)
low βΌ? low = yes lβΌl
low βΌ? high = yes lβΌh
high βΌ? high = yes hβΌh
high βΌ? low = no Ξ» ()
ββΌlowβββΌββ² : β {β ββ²} β β βΌ low β β βΌ ββ²
ββΌlowβββΌββ² {.low} {ββ²} lβΌl = lowβΌ ββ²
infix 5 _<:β_
data _<:β_ : Label β Label β Set where
<:-β : β <:β β
<:-l : β {ββ ββ} β ββ βΌ ββ β l ββ <:β l ββ
<:β-refl : β {g} β g <:β g
<:β-refl {β} = <:-β
<:β-refl {l β} = <:-l βΌ-refl
<:β-trans : β {gβ gβ gβ} β gβ <:β gβ β gβ <:β gβ β gβ <:β gβ
<:β-trans <:-β <:-β = <:-β
<:β-trans (<:-l βββΌββ) (<:-l βββΌββ) = <:-l (βΌ-trans βββΌββ βββΌββ)
<:β-antisym : β {gβ gβ}
β gβ <:β gβ β gβ <:β gβ β gβ β‘ gβ
<:β-antisym <:-β <:-β = refl
<:β-antisym (<:-l βββΌββ) (<:-l βββΌββ) = cong l (βΌ-antisym βββΌββ βββΌββ)
infix 5 _~β_
data _~β_ : Label β Label β Set where
β~ : β {g} β β ~β g
~β : β {g} β g ~β β
l~ : β {β} β l β ~β l β
~β-refl : β {g} β g ~β g
~β-refl {β} = β~
~β-refl {l _} = l~
~β-sym : β {gβ gβ} β gβ ~β gβ β gβ ~β gβ
~β-sym β~ = ~β
~β-sym ~β = β~
~β-sym l~ = l~
infix 5 _βΎ_
data _βΎ_ : Label β Label β Set where
βΎ-βr : β {g} β g βΎ β
βΎ-βl : β {g} β β βΎ g
βΎ-l : β {ββ ββ} β ββ βΌ ββ β l ββ βΎ l ββ
_βΎ?_ : β gβ gβ β Dec (gβ βΎ gβ)
β βΎ? β = yes βΎ-βr
β βΎ? l _ = yes βΎ-βl
l _ βΎ? β = yes βΎ-βr
l ββ βΎ? l ββ =
case ββ βΌ? ββ of Ξ» where
(yes βββΌββ) β yes (βΎ-l βββΌββ)
(no βββ ββ) β no Ξ» { (βΎ-l βββΌββ) β contradiction βββΌββ βββ ββ }
lowβΎ : β g β l low βΎ g
lowβΎ β = βΎ-βr
lowβΎ (l β) = βΎ-l (lowβΌ β)
_βΎhigh : β g β g βΎ l high
β βΎhigh = βΎ-βl
(l β) βΎhigh = βΎ-l (β βΌhigh)
βΎ-refl : β {g} β g βΎ g
βΎ-refl {β} = βΎ-βr
βΎ-refl {l x} = βΎ-l βΌ-refl
βΎ-antisym : β {gβ gβ}
β gβ βΎ gβ β gβ βΎ gβ β gβ ~β gβ
βΎ-antisym βΎ-βr _ = ~β
βΎ-antisym βΎ-βl _ = β~
βΎ-antisym (βΎ-l βββΌββ) (βΎ-l βββΌββ)
rewrite βΌ-antisym βββΌββ βββΌββ = ~β-refl
<:βββΎ : β {gβ gβ} β gβ <:β gβ β gβ βΎ gβ
<:βββΎ <:-β = βΎ-βl
<:βββΎ (<:-l βββΌββ) = βΎ-l βββΌββ
βΎ-prop : β {gβ gβ : Label}
β gβ βΎ gβ
β β[ g ] (gβ ~β g) Γ (g <:β gβ)
βΎ-prop {g} {β} βΎ-βr = β¨ β , ~β , <:-β β©
βΎ-prop {β} {g} βΎ-βl = β¨ g , β~ , <:β-refl β©
βΎ-prop {l ββ} {l ββ} (βΎ-l βββΌββ) =
β¨ l ββ , ~β-refl , <:-l βββΌββ β©
βΎ-propβ² : β {gβ gβ : Label}
β gβ βΎ gβ
β β[ g ] (gβ <:β g) Γ (g ~β gβ)
βΎ-propβ² {g} {β} βΎ-βr = β¨ g , <:β-refl , ~β β©
βΎ-propβ² {β} {g} βΎ-βl = β¨ β , <:-β , β~ β©
βΎ-propβ² {l ββ} {l ββ} (βΎ-l βββΌββ) =
β¨ l ββ , <:-l βββΌββ , ~β-refl β©
~βββΎ : β {gβ gβ} β gβ ~β gβ β gβ βΎ gβ Γ gβ βΎ gβ
~βββΎ β~ = β¨ βΎ-βl , βΎ-βr β©
~βββΎ ~β = β¨ βΎ-βr , βΎ-βl β©
~βββΎ (l~ {low}) = β¨ βΎ-l lβΌl , βΎ-l lβΌl β©
~βββΎ (l~ {high}) = β¨ βΎ-l hβΌh , βΎ-l hβΌh β©
_β_ : StaticLabel β StaticLabel β StaticLabel
low β low = low
_ β _ = high
_β_ : StaticLabel β StaticLabel β StaticLabel
high β high = high
_ β _ = low
β-assoc : β {ββ ββ ββ} β (ββ β ββ) β ββ β‘ ββ β (ββ β ββ)
β-assoc {high} = refl
β-assoc {low} {high} = refl
β-assoc {low} {low} {high} = refl
β-assoc {low} {low} {low} = refl
ββββ‘β : β {β} β β β β β‘ β
ββββ‘β {high} = refl
ββββ‘β {low} = refl
βββ[ββββ]β‘ββββ : β {β ββ} β ββ β (ββ β β) β‘ ββ β β
βββ[ββββ]β‘ββββ {β} {ββ}
rewrite sym (β-assoc {ββ} {ββ} {β})
rewrite (ββββ‘β {ββ}) = refl
ββhighβ‘high : β {β} β β β high β‘ high
ββhighβ‘high {low} = refl
ββhighβ‘high {high} = refl
ββlowβ‘β : β {β} β β β low β‘ β
ββlowβ‘β {low} = refl
ββlowβ‘β {high} = refl
join-βΌ : β {ββ ββ β}
β ββ β ββ βΌ β
β ββ βΌ β Γ ββ βΌ β
join-βΌ {high} {high} {high} _ = β¨ hβΌh , hβΌh β©
join-βΌ {high} {low} {high} _ = β¨ hβΌh , lβΌh β©
join-βΌ {low} {high} {high} _ = β¨ lβΌh , hβΌh β©
join-βΌ {low} {low} {high} _ = β¨ lβΌh , lβΌh β©
join-βΌ {low} {low} {low} _ = β¨ lβΌl , lβΌl β©
meet-βΌ : β {ββ ββ β}
β β βΌ ββ β ββ
β β βΌ ββ Γ β βΌ ββ
meet-βΌ {high} {high} {high} _ = β¨ hβΌh , hβΌh β©
meet-βΌ {high} {high} {low} _ = β¨ lβΌh , lβΌh β©
meet-βΌ {high} {low} {low} _ = β¨ lβΌh , lβΌl β©
meet-βΌ {low} {high} {low} _ = β¨ lβΌl , lβΌh β©
meet-βΌ {low} {low} {low} _ = β¨ lβΌl , lβΌl β©
join-βΌβ² : β {ββ βββ² ββ βββ²}
β ββ βΌ βββ² β ββ βΌ βββ² β (ββ β ββ) βΌ (βββ² β βββ²)
join-βΌβ² lβΌl lβΌl = lβΌl
join-βΌβ² lβΌl lβΌh = lβΌh
join-βΌβ² lβΌl hβΌh = hβΌh
join-βΌβ² lβΌh lβΌl = lβΌh
join-βΌβ² lβΌh lβΌh = lβΌh
join-βΌβ² lβΌh hβΌh = hβΌh
join-βΌβ² hβΌh _ = hβΌh
ββββββΌβ : β {β ββ ββ} β ββ βΌ β β ββ βΌ β β (ββ β ββ) βΌ β
ββββββΌβ {β} {ββ} {ββ} βββΌβ βββΌβ =
subst (Ξ» β‘ β _ βΌ β‘) (ββββ‘β {β}) (join-βΌβ² βββΌβ βββΌβ)
_βΜ_ : Label β Label β Label
l ββ βΜ l ββ = l (ββ β ββ)
_ βΜ β = β
β βΜ _ = β
_βΜ_ : Label β Label β Label
l ββ βΜ l ββ = l (ββ β ββ)
_ βΜ β = β
β βΜ _ = β
gβΜgβ‘g : β {g} β g βΜ g β‘ g
gβΜgβ‘g {β} = refl
gβΜgβ‘g {l β} = cong l ββββ‘β
gβΜββ‘β : β {g} β g βΜ β β‘ β
gβΜββ‘β {β} = refl
gβΜββ‘β {l β} = refl
gβΜlowβ‘g : β {g} β g βΜ l low β‘ g
gβΜlowβ‘g {β} = refl
gβΜlowβ‘g {l β} = cong l ββlowβ‘β
consis-join-~β : β {gβ gβ gβ gβ} β gβ ~β gβ β gβ ~β gβ β gβ βΜ gβ ~β gβ βΜ gβ
consis-join-~β {gβ = β} β~ _ = β~
consis-join-~β {gβ = l _} β~ _ = β~
consis-join-~β {gβ = β} ~β _ = ~β
consis-join-~β {gβ = l _} ~β _ = ~β
consis-join-~β l~ β~ = β~
consis-join-~β l~ ~β = ~β
consis-join-~β l~ l~ = l~
consis-join-βΎ : β {gβ gβ gβ gβ} β gβ βΎ gβ β gβ βΎ gβ β gβ βΜ gβ βΎ gβ βΜ gβ
consis-join-βΎ {gβ = β} βΎ-βr y = βΎ-βr
consis-join-βΎ {gβ = l _} βΎ-βr y = βΎ-βr
consis-join-βΎ {gβ = β} βΎ-βl y = βΎ-βl
consis-join-βΎ {gβ = l _} βΎ-βl y = βΎ-βl
consis-join-βΎ (βΎ-l _) βΎ-βr = βΎ-βr
consis-join-βΎ (βΎ-l _) βΎ-βl = βΎ-βl
consis-join-βΎ (βΎ-l βββΌββ) (βΎ-l βββΌββ) = βΎ-l (join-βΌβ² βββΌββ βββΌββ)
consis-join-βΎ-inv : β {gβ gβ g} β gβ βΜ gβ β‘ g β gβ βΎ g Γ gβ βΎ g
consis-join-βΎ-inv {g = β} eq = β¨ βΎ-βr , βΎ-βr β©
consis-join-βΎ-inv {l ββ} {l ββ} {l β} refl =
case join-βΌ {ββ} {ββ} {β} βΌ-refl of Ξ» where
β¨ βββΌβββββ , βββΌβββββ β© β β¨ βΎ-l βββΌβββββ , βΎ-l βββΌβββββ β©
consis-join-βΎ-inv {β} {l ββ} {l β} ()
consis-meet-βΎ-inv : β {gβ gβ g} β g β‘ gβ βΜ gβ β g βΎ gβ Γ g βΎ gβ
consis-meet-βΎ-inv {g = β} eq = β¨ βΎ-βl , βΎ-βl β©
consis-meet-βΎ-inv {l ββ} {l ββ} {l β} refl =
case meet-βΌ {ββ} {ββ} {β} βΌ-refl of Ξ» where
β¨ ββββββΌββ , ββββββΌββ β© β β¨ βΎ-l ββββββΌββ , βΎ-l ββββββΌββ β©
consis-meet-βΎ-inv {l ββ} {β} {l β} ()
consis-join-<:β : β {gβ gββ² gβ gββ²} β gβ <:β gββ² β gβ <:β gββ² β gβ βΜ gβ <:β gββ² βΜ gββ²
consis-join-<:β <:-β <:-β = <:-β
consis-join-<:β <:-β (<:-l x) = <:-β
consis-join-<:β (<:-l x) <:-β = <:-β
consis-join-<:β (<:-l βββΌβββ²) (<:-l βββΌβββ²) = <:-l (join-βΌβ² βββΌβββ² βββΌβββ²)
consis-join-<:β-inv : β {gβ gβ β} β gβ βΜ gβ <:β l β β (gβ <:β l β) Γ (gβ <:β l β)
consis-join-<:β-inv {β} {β} ()
consis-join-<:β-inv {l ββ} {l ββ} (<:-l ββββββΌβ) =
let β¨ βββΌβ , βββΌβ β© = join-βΌ ββββββΌβ in β¨ <:-l βββΌβ , <:-l βββΌβ β©
join-βΌ-relax : β {ββ ββ ββ ββ} β ββ β ββ βΌ ββ β ββ βΌ ββ β ββ β ββ βΌ ββ
join-βΌ-relax ββββββΌββ lβΌl = ββββββΌββ
join-βΌ-relax {high} ββββββΌββ lβΌh = ββββββΌββ
join-βΌ-relax {low} ββββββΌββ lβΌh = lowβΌ _
join-βΌ-relax ββββββΌββ hβΌh = ββββββΌββ
consis-join-<:β-relax : β {gβ gβ gβ gβ} β gβ βΜ gβ <:β gβ β gβ <:β gβ β gβ βΜ gβ <:β gβ
consis-join-<:β-relax {gβ} {.β} {gβ} {.β} gββgβ<:gβ <:-β rewrite gβΜββ‘β {gβ} = gββgβ<:gβ
consis-join-<:β-relax {β} {l ββ} {gβ} {l ββ} gββgβ<:gβ (<:-l βββΌββ) = gββgβ<:gβ
consis-join-<:β-relax {l ββ} {l ββ} {l ββ} {l ββ} (<:-l ββββββΌββ) (<:-l βββΌββ) =
<:-l (join-βΌ-relax ββββββΌββ βββΌββ)
βΎ-<: : β {gβ gβ g} β gβ βΎ gβ β gβ <:β g β gβ βΎ g
βΎ-<: {gβ = β} gββΎgβ <:-β = βΎ-βr
βΎ-<: {β} {l ββ} gββΎgβ gβ<:g = βΎ-βl
βΎ-<: {l ββ} {l ββ} {l β} (βΎ-l βββΌββ) (<:-l βββΌβ) = βΎ-l (βΌ-trans βββΌββ βββΌβ)
infix 5 _ββ_
_ββ_ : Label β Label β Maybe Label
l high ββ l high = just (l high)
l low ββ l low = just (l low)
β ββ g = just g
g ββ β = just g
_ ββ _ = nothing
grad-meet-~β : β {gβ gβ g}
β gβ ββ gβ β‘ just g
β gβ ~β g Γ gβ ~β g
grad-meet-~β {β} {β} {β} refl = β¨ β~ , β~ β©
grad-meet-~β {β} {l low} {l low} refl = β¨ β~ , l~ β©
grad-meet-~β {β} {l high} {l high} refl = β¨ β~ , l~ β©
grad-meet-~β {l high} {β} {l high} refl = β¨ l~ , β~ β©
grad-meet-~β {l high} {l high} {l high} refl = β¨ l~ , l~ β©
grad-meet-~β {l low} {β} {l low} refl = β¨ l~ , β~ β©
grad-meet-~β {l low} {l low} {l low} refl = β¨ l~ , l~ β©
infix 4 _ββ_
data _ββ_ : Label β Label β Set where
ββ : β {g} β β ββ g
lβl : β {β} β l β ββ l β
ββ-refl : β {g} β g ββ g
ββ-refl {β} = ββ
ββ-refl {l _} = lβl
_ββ?_ : β (gβ gβ : Label) β Dec (gβ ββ gβ)
β ββ? β = yes ββ
β ββ? l _ = yes ββ
l x ββ? β = no Ξ» ()
l ββ ββ? l ββ =
case ββ =? ββ of Ξ» where
(yes refl) β yes lβl
(no βββ’ββ) β no Ξ» { lβl β contradiction refl βββ’ββ }
consis-meet-ββ : β {gβ gββ² gβ gββ²}
β gβ ββ gββ² β gβ ββ gββ² β (gβ βΜ gβ) ββ (gββ² βΜ gββ²)
consis-meet-ββ ββ ββ = ββ
consis-meet-ββ ββ lβl = ββ
consis-meet-ββ lβl ββ = ββ
consis-meet-ββ lβl lβl = lβl
consis-join-ββ : β {gβ gββ² gβ gββ²}
β gβ ββ gββ² β gβ ββ gββ² β (gβ βΜ gβ) ββ (gββ² βΜ gββ²)
consis-join-ββ ββ ββ = ββ
consis-join-ββ ββ lβl = ββ
consis-join-ββ lβl ββ = ββ
consis-join-ββ lβl lβl = lβl
prec-join-ββ : β {gβ gβ gβ gββ² gββ² gββ²}
β gβ ββ gββ²
β gβ ββ gββ²
β gβ ββ gβ β‘ just gβ
β gββ² ββ gββ² β‘ just gββ²
β gβ ββ gββ²
prec-join-ββ ββ ββ refl eqβ² = ββ
prec-join-ββ {gββ² = β} ββ lβl refl refl = lβl
prec-join-ββ {gββ² = l low} ββ (lβl {low}) refl refl = lβl
prec-join-ββ {gββ² = l high} ββ (lβl {high}) refl refl = lβl
prec-join-ββ (lβl {low}) (ββ {l low}) refl refl = lβl
prec-join-ββ (lβl {low}) (ββ {β}) refl refl = lβl
prec-join-ββ (lβl {high}) (ββ {l high}) refl refl = lβl
prec-join-ββ (lβl {high}) (ββ {β}) refl refl = lβl
prec-join-ββ (lβl {high}) (lβl {high}) refl refl = lβl
prec-join-ββ (lβl {low}) (lβl {low}) refl refl = lβl
infix 4 _β:>β_
infix 4 _β<:β_
data _β:>β_ : Label β Label β Set where
ββ:> : β {g} β β β:>β g
β:>-l : β {ββ ββ} β ββ βΌ ββ β l ββ β:>β l ββ
data _β<:β_ : Label β Label β Set where
ββ<: : β {g} β β β<:β g
β:>-l : β {ββ ββ} β ββ βΌ ββ β l ββ β<:β l ββ
β:>β-prop-from : β {gβ gβ} β gβ β:>β gβ β β[ g ] (gβ ββ g) Γ (gβ <:β g)
β:>β-prop-from {gβ} {gβ} ββ:> = β¨ gβ , ββ , <:β-refl β©
β:>β-prop-from (β:>-l βββΌββ) = β¨ _ , ββ-refl , <:-l βββΌββ β©
β:>β-prop-to : β {gβ gβ} β β[ g ] (gβ ββ g) Γ (gβ <:β g) β gβ β:>β gβ
β:>β-prop-to β¨ gβ , ββ , <:β-refl β© = ββ:>
β:>β-prop-to β¨ _ , lβl , <:-l βββΌββ β© = β:>-l βββΌββ
β<:β-prop-from : β {gβ gβ} β gβ β<:β gβ β β[ g ] (gβ ββ g) Γ (g <:β gβ)
β<:β-prop-from {gβ} {gβ} ββ<: = β¨ gβ , ββ , <:β-refl β©
β<:β-prop-from (β:>-l βββΌββ) = β¨ _ , ββ-refl , <:-l βββΌββ β©
β<:β-prop-to : β {gβ gβ} β β[ g ] (gβ ββ g) Γ (g <:β gβ) β gβ β<:β gβ
β<:β-prop-to β¨ gβ , ββ , <:β-refl β© = ββ<:
β<:β-prop-to β¨ _ , lβl , <:-l βββΌββ β© = β:>-l βββΌββ
β:>β-prop : _β:>β_ β Ξ» gβ gβ β β[ g ] (gβ ββ g) Γ (gβ <:β g)
β:>β-prop = β¨ β:>β-prop-from , β:>β-prop-to β©
β<:β-prop : _β<:β_ β Ξ» gβ gβ β β[ g ] (gβ ββ g) Γ (g <:β gβ)
β<:β-prop = β¨ β<:β-prop-from , β<:β-prop-to β©
_β:>β?_ : β gβ gβ β Dec (gβ β:>β gβ)
β β:>β? β = yes ββ:>
β β:>β? l β = yes ββ:>
l β β:>β? β = no Ξ» ()
l ββ β:>β? l ββ =
case ββ βΌ? ββ of Ξ» where
(yes βββΌββ) β yes (β:>-l βββΌββ)
(no βββ ββ) β
no Ξ» { (β:>-l βββΌββ) β contradiction βββΌββ βββ ββ }
_β<:β?_ : β gβ gβ β Dec (gβ β<:β gβ)
β β<:β? β = yes ββ<:
β β<:β? l β = yes ββ<:
l β β<:β? β = no Ξ» ()
l ββ β<:β? l ββ =
case ββ βΌ? ββ of Ξ» where
(yes βββΌββ) β yes (β:>-l βββΌββ)
(no βββ ββ) β
no Ξ» { (β:>-l βββΌββ) β contradiction βββΌββ βββ ββ }
data Specific : Label β Set where
οΌ : β (β : StaticLabel) β Specific (l β)
data AllSpecific : List Label β Set where
as-nil : AllSpecific []
as-cons : β {g gs} β Specific g β AllSpecific gs β AllSpecific (g β· gs)
all-specific? : β (gs : List Label) β Dec (AllSpecific gs)
all-specific? [] = yes as-nil
all-specific? (β β· gs) = no (Ξ» { (as-cons () _) })
all-specific? (l β β· gs) with all-specific? gs
... | yes as = yes (as-cons (οΌ β) as)
... | no Β¬as = no (Ξ» { (as-cons _ as) β Β¬as as })
consis-join-not-all-specific : β {gβ gβ} β Β¬ (AllSpecific [ gβ , gβ ]) β gβ βΜ gβ β‘ β
consis-join-not-all-specific {β} {β} Β¬as = refl
consis-join-not-all-specific {β} {l x} Β¬as = refl
consis-join-not-all-specific {l x} {β} Β¬as = refl
consis-join-not-all-specific {l ββ} {l ββ} Β¬as =
contradiction (as-cons (οΌ ββ) (as-cons (οΌ ββ) as-nil)) Β¬as