------------------------------------------------------------------------
-- Assumptions used to prove that the usage relation is decidable
------------------------------------------------------------------------

open import Graded.Modality
open import Graded.Usage.Restrictions

module Graded.Usage.Decidable.Assumptions
  {a} {M : Set a}
  {𝕄 : Modality M}
  (R : Usage-restrictions 𝕄)
  where

open Modality 𝕄
open Usage-restrictions R

open import Graded.Context 𝕄
open import Graded.Context.Properties 𝕄
open import Graded.Modality.Dedicated-nr 𝕄
open import Graded.Modality.Properties 𝕄 hiding (has-nr)

open import Tools.Nat using (Nat)
open import Tools.PropositionalEquality
open import Tools.Relation

private variable
  n : Nat

record Assumptions : Set a where
  infix 10 _β‰Ÿ_ _≀?_ _β‰€αΆœ?_
  field
    -- Equality is assumed to be decidable for M.
    _β‰Ÿ_ : Decidable (_≑_ {A = M})

    -- The Prodrec-allowed relation is assumed to be decidable.
    Prodrec-allowed? : βˆ€ m r p q β†’ Dec (Prodrec-allowed m r p q)

    -- The Unitrec-allowed relation is assumed to be decidable.
    Unitrec-allowed? : βˆ€ m p q β†’ Dec (Unitrec-allowed m p q)

    -- The Emptyrec-allowed relation is assumed to be decidable.
    Emptyrec-allowed? : βˆ€ m p β†’ Dec (Emptyrec-allowed m p)

    -- A dedicated nr function is assumed to exist.
    ⦃ has-nr ⦄ : Dedicated-nr

    -- The strong unit type is not allowed to be used as a sink.
    ⦃ no-sink ⦄ : Β¬StarΛ’-sink

  -- Inequality is decidable.

  _≀?_ : Decidable _≀_
  _≀?_ = ≑-decidable→≀-decidable _β‰Ÿ_

  -- Context inequality is decidable.

  _β‰€αΆœ?_ : Decidable (_β‰€αΆœ_ {n = n})
  _β‰€αΆœ?_ = β‰€αΆœ-decidable _≀?_