-- File by Andrea Vezzosi (https://github.com/Saizan/cubical-demo)

{-# OPTIONS --cubical #-}
module Primitives where

module Postulates where
  open import Agda.Primitive.Cubical public

  postulate
    Path' :  {} {A :     Set }  A     A     Set 
    PathP :  {} (A : I  Set )  A i0  A i1  Set 

  {-# BUILTIN PATH         Path'     #-}
  {-# BUILTIN PATHP        PathP     #-}

  infix 4 _≡_
  _≡_ :  {} {A : Set }  A  A  Set 
  _≡_ {A = A} = PathP  _  A)

  Path = _≡_

  primitive
    primPathApply  :  {} {A :     Set } {x y}  Path'   x y       I   A
    primPathPApply :  {} {A : I  Set } {x y}  PathP A x y  (i : I)  A i

  postulate
    Id :  {} {A : Set }  A  A  Set 

  {-# BUILTIN ID           Id       #-}
  {-# BUILTIN CONID        conid    #-}

  primitive
    primDepIMin : _
    primIdFace :  {} {A : Set } {x y : A}  Id x y  I
    primIdPath :  {} {A : Set } {x y : A}  Id x y  Path' x y

  primitive
    primIdJ :  { ℓ'} {A : Set } {x : A} (P :  y  Id x y  Set ℓ') 
                P x (conid i1  i  x))   {y} (p : Id x y)  P y p

  {-# BUILTIN SUB Sub #-}

  postulate
    inc :  {} {A : Set } {φ} (x : A)  Sub A φ  _  x)

  {-# BUILTIN SUBIN inc #-}

  primitive
    primSubOut :  {} {A : Set } {φ : I} {u : Partial A φ}  Sub _ φ u  A


open Postulates public renaming
  ( primPFrom1 to p[_]
  ; primIMin       to _∧_   ; primIMax       to _∨_  ; primINeg   to ~_
  ; isOneEmpty     to empty ; primIdJ        to J    ; primSubOut to ouc )


module Unsafe' (dummy : Set₁) = Postulates
unsafeComp = Unsafe'.primComp Set
unsafePOr  = Unsafe'.primPOr  Set