{-# OPTIONS --safe #-} open import Prelude open import Data.Vec open import Signatures open import Cubical.Relation.Binary open import FinitenessConditions open import FreeMonad.PackagedTheory module FreeMonad.Modalities {β} (theory : FullTheory β) where open FullTheory theory open import FreeMonad.Quotiented theory open Signature π½ open import FreeMonad.Syntax π½ renaming (var to varβ) open import FreeMonad.Theory private variable xs ys zs : Syntax A β‘β : (A β Type p) β Syntax A β Type p β‘β P = interp (Ξ» { (O , xs) β β i β xs i }) P ββ : (A β Type p) β Syntax A β Type p ββ P = interp (Ξ» { (O , xs) β β i Γ xs i }) P mutual β‘ββ : (Syntax A β Type p) β Syntax A β Type p β‘ββ P xs = P xs Γ β‘βββ² P xs β‘βββ² : (Syntax A β Type p) β Syntax A β Type p β‘βββ² P (varβ x) = Poly-β€ β‘βββ² P (op (o , k)) = β i β β‘ββ P (k i) β‘β : (A β Type p) β Term A β Type _ β‘β P xs = β ys Γ [ ys ] β‘ xs Γ β‘β P ys β‘β : (Syntax A β Type p) β Term A β Type _ β‘β P t = β s Γ [ s ] β‘ t Γ β‘ββ P s ββ : (A β Type p) β Term A β Type _ ββ P xs = β ys Γ [ ys ] β‘ xs Γ ββ P ys