    {-# LANGUAGE NondecreasingIndentation #-}

    module Agda.TypeChecking.Rules.Builtin
      ( bindBuiltin
      , bindBuiltinNoDef
      , builtinKindOfName
      , bindPostulatedName
      , isUntypedBuiltin
      , bindUntypedBuiltin
      ) where

    import Prelude hiding (null)

    import Control.Monad
    import Control.Monad.Except

    import Data.List (find, sortBy)
    import Data.List.NonEmpty (NonEmpty(..))
    import Data.Function (on)

    import qualified Agda.Syntax.Abstract as A
    import Agda.Syntax.Common
    import Agda.Syntax.Internal
    import Agda.Syntax.Position
    import Agda.Syntax.Scope.Base

    import Agda.TypeChecking.Monad

    import qualified Agda.TypeChecking.CompiledClause as CC
    import Agda.TypeChecking.Conversion
    import Agda.TypeChecking.Constraints
    import Agda.TypeChecking.EtaContract
    import Agda.TypeChecking.Functions
    import Agda.TypeChecking.Irrelevance
    import Agda.TypeChecking.Names
    import Agda.TypeChecking.Pretty
    import Agda.TypeChecking.Primitive
    import Agda.TypeChecking.Positivity.Occurrence
    import Agda.TypeChecking.Reduce
    import Agda.TypeChecking.Substitute
    import Agda.TypeChecking.Telescope
    import Agda.TypeChecking.Rules.Term ( checkExpr , inferExpr )
    import Agda.TypeChecking.Warnings

    import {-# SOURCE #-} Agda.TypeChecking.Rules.Builtin.Coinduction
    import {-# SOURCE #-} Agda.TypeChecking.Rewriting

    import Agda.Utils.Functor
    import Agda.Utils.List
    import Agda.Utils.Maybe
    import Agda.Utils.Monad
    import Agda.Utils.Null
    import Agda.Utils.Size

    import Agda.Utils.Impossible

    ---------------------------------------------------------------------------
    -- * Checking builtin pragmas
    ---------------------------------------------------------------------------

    builtinPostulate :: TCM Type -> BuiltinDescriptor
    builtinPostulate :: TCM Type -> BuiltinDescriptor
    builtinPostulate = Relevance -> TCM Type -> BuiltinDescriptor
    BuiltinPostulate Relevance
    Relevant

    builtinPostulateC :: Cubical -> TCM Type -> BuiltinDescriptor
    builtinPostulateC :: Cubical -> TCM Type -> BuiltinDescriptor
    builtinPostulateC Cubical
    c TCM Type
    m =
      Relevance -> TCM Type -> BuiltinDescriptor
    BuiltinPostulate Relevance
    Relevant (TCM Type -> BuiltinDescriptor) -> TCM Type -> BuiltinDescriptor
    forall a b. (a -> b) -> a -> b
    $ Cubical -> [Char] -> TCM ()
    requireCubical Cubical
    c [Char]
    "" TCM () -> TCM Type -> TCM Type
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> TCM Type
    m

    findBuiltinInfo :: String -> Maybe BuiltinInfo
    findBuiltinInfo :: [Char] -> Maybe BuiltinInfo
    findBuiltinInfo [Char]
    b = (BuiltinInfo -> Bool) -> [BuiltinInfo] -> Maybe BuiltinInfo
    forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Maybe a
    find (([Char]
    b [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    ==) ([Char] -> Bool) -> (BuiltinInfo -> [Char]) -> BuiltinInfo -> Bool
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . BuiltinInfo -> [Char]
    builtinName) [BuiltinInfo]
    coreBuiltins

    coreBuiltins :: [BuiltinInfo]
    coreBuiltins :: [BuiltinInfo]
    coreBuiltins =
      [ ([Char]
    builtinList                             [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData (TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset) [[Char]
    builtinNil, [Char]
    builtinCons])
      , ([Char]
    builtinArg                              [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData (TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset) [[Char]
    builtinArgArg])
      , ([Char]
    builtinAbs                              [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData (TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset) [[Char]
    builtinAbsAbs])
      , ([Char]
    builtinArgInfo                          [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset [[Char]
    builtinArgArgInfo])
      , ([Char]
    builtinBool                             [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset [[Char]
    builtinTrue, [Char]
    builtinFalse])
      , ([Char]
    builtinNat                              [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset [[Char]
    builtinZero, [Char]
    builtinSuc])
      , ([Char]
    builtinMaybe                            [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData (TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset) [[Char]
    builtinNothing, [Char]
    builtinJust])
      , ([Char]
    builtinSigma                            [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData ([[Char]] -> NamesT (TCMT IO) Type -> TCM Type
    forall (m :: * -> *) a. [[Char]] -> NamesT m a -> m a
    runNamesT [] (NamesT (TCMT IO) Type -> TCM Type)
    -> NamesT (TCMT IO) Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $
                                                                  [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    hPi' [Char]
    "la" (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevel) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    a ->
                                                                  [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    hPi' [Char]
    "lb" (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevel) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    b ->
                                                                  [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    nPi' [Char]
    "A" (Sort -> Type
    sort (Sort -> Type) -> (Term -> Sort) -> Term -> Type
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Term -> Sort
    tmSort (Term -> Type) -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> NamesT (TCMT IO) Term
    a) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \NamesT (TCMT IO) Term
    bA ->
                                                                  [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    nPi' [Char]
    "B" (NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Type
    el' NamesT (TCMT IO) Term
    a NamesT (TCMT IO) Term
    bA NamesT (TCMT IO) Type
    -> NamesT (TCMT IO) Type -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> (Sort -> Type
    sort (Sort -> Type) -> (Term -> Sort) -> Term -> Type
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Term -> Sort
    tmSort (Term -> Type) -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> NamesT (TCMT IO) Term
    b)) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \NamesT (TCMT IO) Term
    bB ->
                                                                  ((Sort -> Type
    sort (Sort -> Type) -> (Term -> Sort) -> Term -> Type
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Term -> Sort
    tmSort) (Term -> Type) -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> (TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevelMax NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    a NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    b))
                                                                  )
                                                                 [[Char]
    "SIGMACON"])
      , ([Char]
    builtinUnit                             [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset [[Char]
    builtinUnitUnit])  -- actually record, but they are treated the same
      , ([Char]
    builtinAgdaLiteral                      [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset [[Char]
    builtinAgdaLitNat, [Char]
    builtinAgdaLitWord64, [Char]
    builtinAgdaLitFloat,
                                                                       [Char]
    builtinAgdaLitChar, [Char]
    builtinAgdaLitString,
                                                                       [Char]
    builtinAgdaLitQName, [Char]
    builtinAgdaLitMeta])
      , ([Char]
    builtinAgdaPattern                      [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset [[Char]
    builtinAgdaPatVar, [Char]
    builtinAgdaPatCon, [Char]
    builtinAgdaPatDot,
                                                                       [Char]
    builtinAgdaPatLit, [Char]
    builtinAgdaPatProj, [Char]
    builtinAgdaPatAbsurd])
      , ([Char]
    builtinAgdaPatVar                       [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tnat TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tpat))
      , ([Char]
    builtinAgdaPatCon                       [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tqname TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    tlist (TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    targ TCM Type
    tpat) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tpat))
      , ([Char]
    builtinAgdaPatDot                       [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tterm TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tpat))
      , ([Char]
    builtinAgdaPatLit                       [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tliteral TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tpat))
      , ([Char]
    builtinAgdaPatProj                      [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tqname TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tpat))
      , ([Char]
    builtinAgdaPatAbsurd                    [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tnat TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tpat))
      , ([Char]
    builtinLevel                            [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset)
      , ([Char]
    builtinWord64                           [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset)
      , ([Char]
    builtinInteger                          [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset [[Char]
    builtinIntegerPos, [Char]
    builtinIntegerNegSuc])
      , ([Char]
    builtinIntegerPos                       [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tnat TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tinteger))
      , ([Char]
    builtinIntegerNegSuc                    [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tnat TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tinteger))
      , ([Char]
    builtinFloat                            [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset)
      , ([Char]
    builtinChar                             [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset)
      , ([Char]
    builtinString                           [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset)
      , ([Char]
    builtinQName                            [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset)
      , ([Char]
    builtinAgdaMeta                         [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset)
      , ([Char]
    builtinIO                               [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate (TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset))
      , ([Char]
    builtinPath                             [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> Maybe (TCM Type) -> (Term -> Type -> TCM ()) -> BuiltinDescriptor
    BuiltinUnknown
                                                                 (TCM Type -> Maybe (TCM Type)
    forall a. a -> Maybe a
    Just (TCM Type -> Maybe (TCM Type)) -> TCM Type -> Maybe (TCM Type)
    forall a b. (a -> b) -> a -> b
    $ Cubical -> [Char] -> TCM ()
    requireCubical Cubical
    CErased [Char]
    "" TCM () -> TCM Type -> TCM Type
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >>
                                                                 [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "a" (TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevel) (
                                                                  [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" (Type -> TCM Type
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Type -> TCM Type) -> Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ Sort -> Type
    sort (Sort -> Type) -> Sort -> Type
    forall a b. (a -> b) -> a -> b
    $ Int -> Sort
    varSort Int
    0) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $
                                                                  (Sort -> Term -> Type
    forall t a. Sort' t -> a -> Type'' t a
    El (Int -> Sort
    varSort Int
    1) (Term -> Type) -> TCMT IO Term -> TCM Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    -->
                                                                  (Sort -> Term -> Type
    forall t a. Sort' t -> a -> Type'' t a
    El (Int -> Sort
    varSort Int
    1) (Term -> Type) -> TCMT IO Term -> TCM Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    -->
                                                                  Type -> TCM Type
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Sort -> Type
    sort (Sort -> Type) -> Sort -> Type
    forall a b. (a -> b) -> a -> b
    $ Int -> Sort
    varSort Int
    1)))
                                                                 Term -> Type -> TCM ()
    verifyPath)
      , ([Char]
    builtinPathP                            [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> Cubical -> TCM Type -> BuiltinDescriptor
    builtinPostulateC Cubical
    CErased ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "a" (TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevel) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $
                                                                  [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    nPi [Char]
    "A" (TCM Type
    tinterval TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Type -> TCM Type
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Sort -> Type
    sort (Sort -> Type) -> Sort -> Type
    forall a b. (a -> b) -> a -> b
    $ Int -> Sort
    varSort Int
    0)) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $
                                                                  (Sort -> Term -> Type
    forall t a. Sort' t -> a -> Type'' t a
    El (Int -> Sort
    varSort Int
    1) (Term -> Type) -> TCMT IO Term -> TCM Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0 TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primIZero) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    -->
                                                                  (Sort -> Term -> Type
    forall t a. Sort' t -> a -> Type'' t a
    El (Int -> Sort
    varSort Int
    1) (Term -> Type) -> TCMT IO Term -> TCM Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0 TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primIOne) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    -->
                                                                  Type -> TCM Type
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Sort -> Type
    sort (Sort -> Type) -> Sort -> Type
    forall a b. (a -> b) -> a -> b
    $ Int -> Sort
    varSort Int
    1)))
      , ([Char]
    builtinInterval                         [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData (Cubical -> [Char] -> TCM ()
    requireCubical Cubical
    CErased [Char]
    "" TCM () -> TCM Type -> TCM Type
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >>
                                                                  (Type -> TCM Type
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Type -> TCM Type) -> Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ Level -> Type
    ssort (Level -> Type) -> Level -> Type
    forall a b. (a -> b) -> a -> b
    $ Integer -> Level
    ClosedLevel Integer
    0)) [[Char]
    builtinIZero,[Char]
    builtinIOne])
      , ([Char]
    builtinSub                              [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> Cubical -> TCM Type -> BuiltinDescriptor
    builtinPostulateC Cubical
    CErased ([[Char]] -> NamesT (TCMT IO) Type -> TCM Type
    forall (m :: * -> *) a. [[Char]] -> NamesT m a -> m a
    runNamesT [] (NamesT (TCMT IO) Type -> TCM Type)
    -> NamesT (TCMT IO) Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    hPi' [Char]
    "a" (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevel) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    a ->
                                                                       [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    nPi' [Char]
    "A" (NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Type
    el' (TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevelSuc NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    a) (Sort -> Term
    Sort (Sort -> Term) -> (Term -> Sort) -> Term -> Term
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Term -> Sort
    tmSort (Term -> Term) -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> NamesT (TCMT IO) Term
    a)) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    bA ->
                                                                       [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    nPi' [Char]
    "φ" (TCM Type -> NamesT (TCMT IO) Type
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCM Type
    tinterval) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    phi ->
                                                                       NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Type
    el's NamesT (TCMT IO) Term
    a (TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primPartial NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    a NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    phi NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    bA) NamesT (TCMT IO) Type
    -> NamesT (TCMT IO) Type -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> (Level -> Type
    ssort (Level -> Type) -> (Term -> Level) -> Term -> Type
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Term -> Level
    forall t. t -> Level' t
    atomicLevel (Term -> Type) -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> NamesT (TCMT IO) Term
    a)
                                                                      ))
      , ([Char]
    builtinSubIn                            [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> Cubical -> TCM Type -> BuiltinDescriptor
    builtinPostulateC Cubical
    CErased ([[Char]] -> NamesT (TCMT IO) Type -> TCM Type
    forall (m :: * -> *) a. [[Char]] -> NamesT m a -> m a
    runNamesT [] (NamesT (TCMT IO) Type -> TCM Type)
    -> NamesT (TCMT IO) Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $
                                                                       [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    hPi' [Char]
    "a" (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevel) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    a ->
                                                                       [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    hPi' [Char]
    "A" (NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Type
    el' (TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevelSuc NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    a) (Sort -> Term
    Sort (Sort -> Term) -> (Term -> Sort) -> Term -> Term
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Term -> Sort
    tmSort (Term -> Term) -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> NamesT (TCMT IO) Term
    a)) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    bA ->
                                                                       [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    hPi' [Char]
    "φ" (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    elSSet (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primInterval) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    phi ->
                                                                       [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    nPi' [Char]
    "x" (NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Type
    el' NamesT (TCMT IO) Term
    a NamesT (TCMT IO) Term
    bA) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    x ->
                                                                       NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Type
    el's NamesT (TCMT IO) Term
    a (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primSub NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    a NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    bA NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    phi NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> [Char]
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term)
    -> NamesT (TCMT IO) Term
    forall (m :: * -> *).
    MonadFail m =>
    [Char] -> (NamesT m Term -> NamesT m Term) -> NamesT m Term
    lam [Char]
    "o" (\ NamesT (TCMT IO) Term
    _ -> NamesT (TCMT IO) Term
    x)))
      , ([Char]
    builtinIZero                            [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons TCM Type
    tinterval)
      , ([Char]
    builtinIOne                             [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons TCM Type
    tinterval)
      , ([Char]
    builtinPartial                          [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> [Char] -> (Term -> TCM ()) -> BuiltinDescriptor
    BuiltinPrim [Char]
    "primPartial" (TCM () -> Term -> TCM ()
    forall a b. a -> b -> a
    const (TCM () -> Term -> TCM ()) -> TCM () -> Term -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ () -> TCM ()
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()))
      , ([Char]
    builtinPartialP                         [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> [Char] -> (Term -> TCM ()) -> BuiltinDescriptor
    BuiltinPrim [Char]
    "primPartialP" (TCM () -> Term -> TCM ()
    forall a b. a -> b -> a
    const (TCM () -> Term -> TCM ()) -> TCM () -> Term -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ () -> TCM ()
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()))
      , ([Char]
    builtinIsOne                            [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> Cubical -> TCM Type -> BuiltinDescriptor
    builtinPostulateC Cubical
    CErased (TCM Type
    tinterval TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Type -> TCM Type
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Level -> Type
    ssort (Level -> Type) -> Level -> Type
    forall a b. (a -> b) -> a -> b
    $ Integer -> Level
    ClosedLevel Integer
    0)))
      , ([Char]
    builtinItIsOne                          [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> Cubical -> TCM Type -> BuiltinDescriptor
    builtinPostulateC Cubical
    CErased (TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    elSSet (TCMT IO Term -> TCM Type) -> TCMT IO Term -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primIsOne TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primIOne))
      , ([Char]
    builtinIsOne1                           [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> Cubical -> TCM Type -> BuiltinDescriptor
    builtinPostulateC Cubical
    CErased ([[Char]] -> NamesT (TCMT IO) Type -> TCM Type
    forall (m :: * -> *) a. [[Char]] -> NamesT m a -> m a
    runNamesT [] (NamesT (TCMT IO) Type -> TCM Type)
    -> NamesT (TCMT IO) Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $
                                                                       [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    nPi' [Char]
    "i" (TCM Type -> NamesT (TCMT IO) Type
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCM Type
    tinterval) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    i ->
                                                                       [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    nPi' [Char]
    "j" (TCM Type -> NamesT (TCMT IO) Type
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCM Type
    tinterval) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    j ->
                                                                       [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    nPi' [Char]
    "i1" (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    elSSet (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primIsOne NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    i) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    i1 ->
                                                                       (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    elSSet (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primIsOne NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> (TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primIMax NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    i NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    j))))
      , ([Char]
    builtinIsOne2                           [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> Cubical -> TCM Type -> BuiltinDescriptor
    builtinPostulateC Cubical
    CErased ([[Char]] -> NamesT (TCMT IO) Type -> TCM Type
    forall (m :: * -> *) a. [[Char]] -> NamesT m a -> m a
    runNamesT [] (NamesT (TCMT IO) Type -> TCM Type)
    -> NamesT (TCMT IO) Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $
                                                                       [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    nPi' [Char]
    "i" (TCM Type -> NamesT (TCMT IO) Type
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCM Type
    tinterval) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    i ->
                                                                       [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    nPi' [Char]
    "j" (TCM Type -> NamesT (TCMT IO) Type
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCM Type
    tinterval) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    j ->
                                                                       [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    nPi' [Char]
    "j1" (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    elSSet (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primIsOne NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    j) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    j1 ->
                                                                       (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    elSSet (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primIsOne NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> (TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primIMax NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    i NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    j))))
      , ([Char]
    builtinIsOneEmpty                       [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> Cubical -> TCM Type -> BuiltinDescriptor
    builtinPostulateC Cubical
    CErased ([[Char]] -> NamesT (TCMT IO) Type -> TCM Type
    forall (m :: * -> *) a. [[Char]] -> NamesT m a -> m a
    runNamesT [] (NamesT (TCMT IO) Type -> TCM Type)
    -> NamesT (TCMT IO) Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $
                                                                       [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    hPi' [Char]
    "l" (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevel) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    l ->
                                                                       [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    hPi' [Char]
    "A" ([Char]
    -> NamesT (TCMT IO) Term
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadAddContext m, HasBuiltins m, MonadDebug m) =>
    [Char]
    -> NamesT m Term
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    pPi' [Char]
    "o" (TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primIZero) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    _ ->
                                                                                      NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Type
    el' (TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevelSuc NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    l) (Sort -> Term
    Sort (Sort -> Term) -> (Term -> Sort) -> Term -> Term
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Term -> Sort
    tmSort (Term -> Term) -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> NamesT (TCMT IO) Term
    l)) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    bA ->
                                                                       [Char]
    -> NamesT (TCMT IO) Term
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadAddContext m, HasBuiltins m, MonadDebug m) =>
    [Char]
    -> NamesT m Term
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    pPi' [Char]
    "o" (TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primIZero) (\ NamesT (TCMT IO) Term
    o ->
                                                                            NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Type
    el' NamesT (TCMT IO) Term
    l (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ ArgInfo
    -> NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term
    forall (m :: * -> *).
    Applicative m =>
    ArgInfo -> m Term -> m Term -> m Term
    gApply' (Relevance -> ArgInfo -> ArgInfo
    forall a. LensRelevance a => Relevance -> a -> a
    setRelevance Relevance
    Irrelevant ArgInfo
    defaultArgInfo) NamesT (TCMT IO) Term
    bA NamesT (TCMT IO) Term
    o)))

      , ([Char]
    builtinId                               [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> Cubical -> TCM Type -> BuiltinDescriptor
    builtinPostulateC Cubical
    CErased ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "a" (TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevel) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $
                                                                  [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" (Type -> TCM Type
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Type -> TCM Type) -> Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ Sort -> Type
    sort (Sort -> Type) -> Sort -> Type
    forall a b. (a -> b) -> a -> b
    $ Int -> Sort
    varSort Int
    0) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $
                                                                  (Sort -> Term -> Type
    forall t a. Sort' t -> a -> Type'' t a
    El (Int -> Sort
    varSort Int
    1) (Term -> Type) -> TCMT IO Term -> TCM Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    -->
                                                                  (Sort -> Term -> Type
    forall t a. Sort' t -> a -> Type'' t a
    El (Int -> Sort
    varSort Int
    1) (Term -> Type) -> TCMT IO Term -> TCM Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    -->
                                                                  Type -> TCM Type
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Sort -> Type
    sort (Sort -> Type) -> Sort -> Type
    forall a b. (a -> b) -> a -> b
    $ Int -> Sort
    varSort Int
    1)))
      , ([Char]
    builtinConId                            [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> Cubical -> TCM Type -> BuiltinDescriptor
    builtinPostulateC Cubical
    CErased ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "a" (TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevel) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $
                                                               [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" (Type -> TCM Type
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Type -> TCM Type) -> Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ Sort -> Type
    sort (Sort -> Type) -> Sort -> Type
    forall a b. (a -> b) -> a -> b
    $ Int -> Sort
    varSort Int
    0) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $
                                                               [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "x" (Sort -> Term -> Type
    forall t a. Sort' t -> a -> Type'' t a
    El (Int -> Sort
    varSort Int
    1) (Term -> Type) -> TCMT IO Term -> TCM Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $
                                                               [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "y" (Sort -> Term -> Type
    forall t a. Sort' t -> a -> Type'' t a
    El (Int -> Sort
    varSort Int
    2) (Term -> Type) -> TCMT IO Term -> TCM Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    1) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $
                                                               TCM Type
    tinterval TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    -->
                                                               (Sort -> Term -> Type
    forall t a. Sort' t -> a -> Type'' t a
    El (Int -> Sort
    varSort Int
    3) (Term -> Type) -> TCMT IO Term -> TCM Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primPath TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    3 TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    2 TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    1 TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    -->
                                                               (Sort -> Term -> Type
    forall t a. Sort' t -> a -> Type'' t a
    El (Int -> Sort
    varSort Int
    3) (Term -> Type) -> TCMT IO Term -> TCM Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primId TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    3 TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    2 TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    1 TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0)))
      , ([Char]
    builtinEquiv                            [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> Maybe (TCM Type) -> (Term -> Type -> TCM ()) -> BuiltinDescriptor
    BuiltinUnknown (TCM Type -> Maybe (TCM Type)
    forall a. a -> Maybe a
    Just (TCM Type -> Maybe (TCM Type)) -> TCM Type -> Maybe (TCM Type)
    forall a b. (a -> b) -> a -> b
    $ Cubical -> [Char] -> TCM ()
    requireCubical Cubical
    CFull [Char]
    "" TCM () -> TCM Type -> TCM Type
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> [[Char]] -> NamesT (TCMT IO) Type -> TCM Type
    forall (m :: * -> *) a. [[Char]] -> NamesT m a -> m a
    runNamesT [] (
                                                                        [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    hPi' [Char]
    "l" (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevel) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    a ->
                                                                        [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    hPi' [Char]
    "l'" (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevel) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    b ->
                                                                        [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    nPi' [Char]
    "A" (Sort -> Type
    sort (Sort -> Type) -> (Term -> Sort) -> Term -> Type
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Term -> Sort
    tmSort (Term -> Type) -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> NamesT (TCMT IO) Term
    a) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \NamesT (TCMT IO) Term
    bA ->
                                                                        [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    nPi' [Char]
    "B" (Sort -> Type
    sort (Sort -> Type) -> (Term -> Sort) -> Term -> Type
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Term -> Sort
    tmSort (Term -> Type) -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> NamesT (TCMT IO) Term
    b) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \NamesT (TCMT IO) Term
    bB ->
                                                                        ((Sort -> Type
    sort (Sort -> Type) -> (Term -> Sort) -> Term -> Type
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Term -> Sort
    tmSort) (Term -> Type) -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> (TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevelMax NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    a NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    b))
                                                                      ))
                                                                       ((Type -> TCM ()) -> Term -> Type -> TCM ()
    forall a b. a -> b -> a
    const ((Type -> TCM ()) -> Term -> Type -> TCM ())
    -> (Type -> TCM ()) -> Term -> Type -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ TCM () -> Type -> TCM ()
    forall a b. a -> b -> a
    const (TCM () -> Type -> TCM ()) -> TCM () -> Type -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ () -> TCM ()
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()))
      , ([Char]
    builtinEquivFun                         [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> Maybe (TCM Type) -> (Term -> Type -> TCM ()) -> BuiltinDescriptor
    BuiltinUnknown (TCM Type -> Maybe (TCM Type)
    forall a. a -> Maybe a
    Just (TCM Type -> Maybe (TCM Type)) -> TCM Type -> Maybe (TCM Type)
    forall a b. (a -> b) -> a -> b
    $ Cubical -> [Char] -> TCM ()
    requireCubical Cubical
    CFull [Char]
    "" TCM () -> TCM Type -> TCM Type
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> [[Char]] -> NamesT (TCMT IO) Type -> TCM Type
    forall (m :: * -> *) a. [[Char]] -> NamesT m a -> m a
    runNamesT [] (
                                                                     [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    hPi' [Char]
    "l" (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevel) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    a ->
                                                                     [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    hPi' [Char]
    "l'" (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevel) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    b ->
                                                                     [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    hPi' [Char]
    "A" (Sort -> Type
    sort (Sort -> Type) -> (Term -> Sort) -> Term -> Type
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Term -> Sort
    tmSort (Term -> Type) -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> NamesT (TCMT IO) Term
    a) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \NamesT (TCMT IO) Term
    bA ->
                                                                     [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    hPi' [Char]
    "B" (Sort -> Type
    sort (Sort -> Type) -> (Term -> Sort) -> Term -> Type
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Term -> Sort
    tmSort (Term -> Type) -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> NamesT (TCMT IO) Term
    b) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \NamesT (TCMT IO) Term
    bB ->
                                                                     NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Type
    el' (TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevelMax NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    a NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    b) (TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primEquiv NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    a NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    b NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    bA NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    bB) NamesT (TCMT IO) Type
    -> NamesT (TCMT IO) Type -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    -->
                                                                     (NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Type
    el' NamesT (TCMT IO) Term
    a NamesT (TCMT IO) Term
    bA NamesT (TCMT IO) Type
    -> NamesT (TCMT IO) Type -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Type
    el' NamesT (TCMT IO) Term
    b NamesT (TCMT IO) Term
    bB)
                                                                   ))
                                                                    ((Type -> TCM ()) -> Term -> Type -> TCM ()
    forall a b. a -> b -> a
    const ((Type -> TCM ()) -> Term -> Type -> TCM ())
    -> (Type -> TCM ()) -> Term -> Type -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ TCM () -> Type -> TCM ()
    forall a b. a -> b -> a
    const (TCM () -> Type -> TCM ()) -> TCM () -> Type -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ () -> TCM ()
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()))
      , ([Char]
    builtinEquivProof                       [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> Maybe (TCM Type) -> (Term -> Type -> TCM ()) -> BuiltinDescriptor
    BuiltinUnknown (TCM Type -> Maybe (TCM Type)
    forall a. a -> Maybe a
    Just (TCM Type -> Maybe (TCM Type)) -> TCM Type -> Maybe (TCM Type)
    forall a b. (a -> b) -> a -> b
    $ Cubical -> [Char] -> TCM ()
    requireCubical Cubical
    CFull [Char]
    "" TCM () -> TCM Type -> TCM Type
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> [[Char]] -> NamesT (TCMT IO) Type -> TCM Type
    forall (m :: * -> *) a. [[Char]] -> NamesT m a -> m a
    runNamesT [] (
                                                                   [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    hPi' [Char]
    "l" (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevel) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    la ->
                                                                   [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    hPi' [Char]
    "l'" (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevel) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    lb ->
                                                                   [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    nPi' [Char]
    "A" (Sort -> Type
    sort (Sort -> Type) -> (Term -> Sort) -> Term -> Type
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Term -> Sort
    tmSort (Term -> Type) -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> NamesT (TCMT IO) Term
    la) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    bA ->
                                                                   [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    nPi' [Char]
    "B" (Sort -> Type
    sort (Sort -> Type) -> (Term -> Sort) -> Term -> Type
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Term -> Sort
    tmSort (Term -> Type) -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> NamesT (TCMT IO) Term
    lb) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    bB ->
                                                                   [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    nPi' [Char]
    "e" (NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Type
    el' (TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevelMax NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    la NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    lb)
                                                                                 (TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primEquiv NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    la NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    lb NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    bA NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    bB)) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    e -> do
                                                                   [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    nPi' [Char]
    "b" (NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Type
    el' NamesT (TCMT IO) Term
    lb NamesT (TCMT IO) Term
    bB) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    b -> do
                                                                    let f :: NamesT (TCMT IO) Term
    f = TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primEquivFun NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    la NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    lb NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    bA NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    bB NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    e
                                                                        fiber :: NamesT (TCMT IO) Type
    fiber = NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Type
    el' (TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevelMax NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    la NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    lb)
                                                                                    (TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primSigma NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    la NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    lb
                                                                                      NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    bA
                                                                                      NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> [Char]
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term)
    -> NamesT (TCMT IO) Term
    forall (m :: * -> *).
    MonadFail m =>
    [Char] -> (NamesT m Term -> NamesT m Term) -> NamesT m Term
    lam [Char]
    "a" (\ NamesT (TCMT IO) Term
    a ->
                                                                                             TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primPath NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    lb NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    bB NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> (NamesT (TCMT IO) Term
    f NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    a) NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    b))
                                                                    [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    nPi' [Char]
    "φ" (TCM Type -> NamesT (TCMT IO) Type
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCM Type
    tinterval) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    phi ->
                                                                      [Char]
    -> NamesT (TCMT IO) Term
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadAddContext m, HasBuiltins m, MonadDebug m) =>
    [Char]
    -> NamesT m Term
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    pPi' [Char]
    "o" NamesT (TCMT IO) Term
    phi (\ NamesT (TCMT IO) Term
    o -> NamesT (TCMT IO) Type
    fiber) NamesT (TCMT IO) Type
    -> NamesT (TCMT IO) Type -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> NamesT (TCMT IO) Type
    fiber
                                                                 ))
                                                                  ((Type -> TCM ()) -> Term -> Type -> TCM ()
    forall a b. a -> b -> a
    const ((Type -> TCM ()) -> Term -> Type -> TCM ())
    -> (Type -> TCM ()) -> Term -> Type -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ TCM () -> Type -> TCM ()
    forall a b. a -> b -> a
    const (TCM () -> Type -> TCM ()) -> TCM () -> Type -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ () -> TCM ()
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()))
      , ([Char]
    builtinTranspProof                       [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> Maybe (TCM Type) -> (Term -> Type -> TCM ()) -> BuiltinDescriptor
    BuiltinUnknown (TCM Type -> Maybe (TCM Type)
    forall a. a -> Maybe a
    Just (TCM Type -> Maybe (TCM Type)) -> TCM Type -> Maybe (TCM Type)
    forall a b. (a -> b) -> a -> b
    $ Cubical -> [Char] -> TCM ()
    requireCubical Cubical
    CErased [Char]
    "" TCM () -> TCM Type -> TCM Type
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> [[Char]] -> NamesT (TCMT IO) Type -> TCM Type
    forall (m :: * -> *) a. [[Char]] -> NamesT m a -> m a
    runNamesT [] (
                                                                   [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    hPi' [Char]
    "l" (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevel) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    la -> do
                                                                   [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    nPi' [Char]
    "e" (TCM Type -> NamesT (TCMT IO) Type
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCM Type
    tinterval NamesT (TCMT IO) Type
    -> NamesT (TCMT IO) Type -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> (Sort -> Type
    sort (Sort -> Type) -> (Term -> Sort) -> Term -> Type
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Term -> Sort
    tmSort (Term -> Type) -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> NamesT (TCMT IO) Term
    la)) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    e -> do
                                                                   let lb :: NamesT (TCMT IO) Term
    lb = NamesT (TCMT IO) Term
    la; bA :: NamesT (TCMT IO) Term
    bA = NamesT (TCMT IO) Term
    e NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primIZero; bB :: NamesT (TCMT IO) Term
    bB = NamesT (TCMT IO) Term
    e NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primIOne
                                                                   [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    nPi' [Char]
    "φ" (TCM Type -> NamesT (TCMT IO) Type
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCM Type
    tinterval) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    phi -> do
                                                                   [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    nPi' [Char]
    "a" ([Char]
    -> NamesT (TCMT IO) Term
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadAddContext m, HasBuiltins m, MonadDebug m) =>
    [Char]
    -> NamesT m Term
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    pPi' [Char]
    "o" NamesT (TCMT IO) Term
    phi (\ NamesT (TCMT IO) Term
    _ -> NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Type
    el' NamesT (TCMT IO) Term
    la NamesT (TCMT IO) Term
    bA)) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    a -> do
                                                                   let f :: NamesT (TCMT IO) Term
    f = TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primTrans NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> [Char]
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term)
    -> NamesT (TCMT IO) Term
    forall (m :: * -> *).
    MonadFail m =>
    [Char] -> (NamesT m Term -> NamesT m Term) -> NamesT m Term
    lam [Char]
    "i" (\ NamesT (TCMT IO) Term
    _ -> NamesT (TCMT IO) Term
    la) NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    e NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primIZero
                                                                       z :: NamesT (TCMT IO) Term
    z = [Char]
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term)
    -> NamesT (TCMT IO) Term
    forall (m :: * -> *).
    MonadFail m =>
    [Char] -> (NamesT m Term -> NamesT m Term) -> NamesT m Term
    ilam [Char]
    "o" ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term)
     -> NamesT (TCMT IO) Term)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term)
    -> NamesT (TCMT IO) Term
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    o -> NamesT (TCMT IO) Term
    f NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> (NamesT (TCMT IO) Term
    a NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    o)
                                                                   [Char]
    -> NamesT (TCMT IO) Type
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall (m :: * -> *).
    (MonadFail m, MonadAddContext m, MonadDebug m) =>
    [Char]
    -> NamesT m Type
    -> (NamesT m Term -> NamesT m Type)
    -> NamesT m Type
    nPi' [Char]
    "b" (NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Type
    el's NamesT (TCMT IO) Term
    lb (TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primSub NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    lb NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    bB NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    phi NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    z)) ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
     -> NamesT (TCMT IO) Type)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type)
    -> NamesT (TCMT IO) Type
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    b' -> do
                                                                   let b :: NamesT (TCMT IO) Term
    b = TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primSubOut NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    lb NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    bB NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    phi NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    z NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    b'
                                                                       fiber :: NamesT (TCMT IO) Type
    fiber = NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Type
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Type
    el' NamesT (TCMT IO) Term
    la
                                                                                   (TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primSigma NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    la NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    lb
                                                                                      NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    bA
                                                                                      NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> [Char]
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term)
    -> NamesT (TCMT IO) Term
    forall (m :: * -> *).
    MonadFail m =>
    [Char] -> (NamesT m Term -> NamesT m Term) -> NamesT m Term
    lam [Char]
    "a" (\ NamesT (TCMT IO) Term
    a ->
                                                                                             TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primPath NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    lb NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    bB NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> (NamesT (TCMT IO) Term
    f NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    a) NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> NamesT (TCMT IO) Term
    b))
                                                                   NamesT (TCMT IO) Type
    fiber
                                                                 ))
                                                                  ((Type -> TCM ()) -> Term -> Type -> TCM ()
    forall a b. a -> b -> a
    const ((Type -> TCM ()) -> Term -> Type -> TCM ())
    -> (Type -> TCM ()) -> Term -> Type -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ TCM () -> Type -> TCM ()
    forall a b. a -> b -> a
    const (TCM () -> Type -> TCM ()) -> TCM () -> Type -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ () -> TCM ()
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()))
      , ([Char]
    builtinAgdaSort                         [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset
                                                       [ [Char]
    builtinAgdaSortSet, [Char]
    builtinAgdaSortLit
                                                       , [Char]
    builtinAgdaSortProp, [Char]
    builtinAgdaSortPropLit
                                                       , [Char]
    builtinAgdaSortInf, [Char]
    builtinAgdaSortUnsupported])
      , ([Char]
    builtinAgdaTerm                         [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset
                                                       [ [Char]
    builtinAgdaTermVar, [Char]
    builtinAgdaTermLam, [Char]
    builtinAgdaTermExtLam
                                                       , [Char]
    builtinAgdaTermDef, [Char]
    builtinAgdaTermCon
                                                       , [Char]
    builtinAgdaTermPi, [Char]
    builtinAgdaTermSort
                                                       , [Char]
    builtinAgdaTermLit, [Char]
    builtinAgdaTermMeta
                                                       , [Char]
    builtinAgdaTermUnsupported])
      , [Char]
    builtinAgdaErrorPart                     [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset [ [Char]
    builtinAgdaErrorPartString, [Char]
    builtinAgdaErrorPartTerm, [Char]
    builtinAgdaErrorPartName ]
      , [Char]
    builtinAgdaErrorPartString               [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tstring TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    terrorpart)
      , [Char]
    builtinAgdaErrorPartTerm                 [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tterm TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    terrorpart)
      , [Char]
    builtinAgdaErrorPartName                 [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tqname TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    terrorpart)
      -- Andreas, 2017-01-12, issue #2386: special handling of builtinEquality
      -- , (builtinEquality                         |-> BuiltinData (hPi "a" (el primLevel) $
      --                                                             hPi "A" (return $ sort $ varSort 0) $
      --                                                             (El (varSort 1) <$> varM 0) -->
      --                                                             (El (varSort 1) <$> varM 0) -->
      --                                                             return (sort $ varSort 1))
      --                                                            [builtinRefl])
      , ([Char]
    builtinHiding                           [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset [[Char]
    builtinHidden, [Char]
    builtinInstance, [Char]
    builtinVisible])
        -- Relevance
      , ([Char]
    builtinRelevance                        [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset [[Char]
    builtinRelevant, [Char]
    builtinIrrelevant])
      , ([Char]
    builtinRelevant                         [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons TCM Type
    trelevance)
      , ([Char]
    builtinIrrelevant                       [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons TCM Type
    trelevance)
        -- Quantity
      , ([Char]
    builtinQuantity                         [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset [[Char]
    builtinQuantity0, [Char]
    builtinQuantityω])
      , ([Char]
    builtinQuantity0                        [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons TCM Type
    tquantity)
      , ([Char]
    builtinQuantityω                        [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons TCM Type
    tquantity)
        -- Modality
      , ([Char]
    builtinModality                         [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset [[Char]
    builtinModalityConstructor])
      , ([Char]
    builtinModalityConstructor              [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    trelevance TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tquantity TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tmodality))
        -- Associativity
      , [Char]
    builtinAssoc                             [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset [[Char]
    builtinAssocLeft, [Char]
    builtinAssocRight, [Char]
    builtinAssocNon]
      , [Char]
    builtinAssocLeft                         [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons TCM Type
    tassoc
      , [Char]
    builtinAssocRight                        [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons TCM Type
    tassoc
      , [Char]
    builtinAssocNon                          [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons TCM Type
    tassoc
        -- Precedence
      , [Char]
    builtinPrecedence                        [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset [[Char]
    builtinPrecRelated, [Char]
    builtinPrecUnrelated]
      , [Char]
    builtinPrecRelated                       [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tfloat TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tprec)
      , [Char]
    builtinPrecUnrelated                     [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons TCM Type
    tprec
        -- Fixity
      , [Char]
    builtinFixity                            [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset [[Char]
    builtinFixityFixity]
      , [Char]
    builtinFixityFixity                      [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tassoc TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tprec TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tfixity)
      -- Andreas, 2017-01-12, issue #2386: special handling of builtinEquality
      -- , (builtinRefl                             |-> BuiltinDataCons (hPi "a" (el primLevel) $
      --                                                                 hPi "A" (return $ sort $ varSort 0) $
      --                                                                 hPi "x" (El (varSort 1) <$> varM 0) $
      --                                                                 El (varSort 2) <$> primEquality <#> varM 2 <#> varM 1 <@> varM 0 <@> varM 0))
      , ([Char]
    builtinRewrite                          [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> Maybe (TCM Type) -> (Term -> Type -> TCM ()) -> BuiltinDescriptor
    BuiltinUnknown Maybe (TCM Type)
    forall a. Maybe a
    Nothing Term -> Type -> TCM ()
    verifyBuiltinRewrite)
      , ([Char]
    builtinNil                              [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset (TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (TCMT IO Term -> TCMT IO Term
    list TCMT IO Term
    v0))))
      , ([Char]
    builtinCons                             [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset (TCM Type
    tv0 TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (TCMT IO Term -> TCMT IO Term
    list TCMT IO Term
    v0) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (TCMT IO Term -> TCMT IO Term
    list TCMT IO Term
    v0))))
      , ([Char]
    builtinNothing                          [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset (TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (TCMT IO Term -> TCMT IO Term
    tMaybe TCMT IO Term
    v0))))
      , ([Char]
    builtinJust                             [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset (TCM Type
    tv0 TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (TCMT IO Term -> TCMT IO Term
    tMaybe TCMT IO Term
    v0))))
      , ([Char]
    builtinZero                             [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons TCM Type
    tnat)
      , ([Char]
    builtinSuc                              [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tnat TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tnat))
      , ([Char]
    builtinTrue                             [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons TCM Type
    tbool)
      , ([Char]
    builtinFalse                            [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons TCM Type
    tbool)
      , ([Char]
    builtinArgArg                           [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset (TCM Type
    targinfo TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tv0 TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    targ TCM Type
    tv0)))
      , ([Char]
    builtinAbsAbs                           [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset (TCM Type
    tstring  TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tv0 TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type -> TCM Type
    forall {m :: * -> *} {t}.
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m (Type'' t Term) -> m Type
    tabs TCM Type
    tv0)))
      , ([Char]
    builtinArgArgInfo                       [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    thiding TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tmodality TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    targinfo))
      , ([Char]
    builtinAgdaTermVar                      [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tnat TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    targs TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tterm))
      , ([Char]
    builtinAgdaTermLam                      [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    thiding TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type -> TCM Type
    forall {m :: * -> *} {t}.
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m (Type'' t Term) -> m Type
    tabs TCM Type
    tterm TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tterm))
      , ([Char]
    builtinAgdaTermExtLam                   [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    tlist TCM Type
    tclause TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    targs TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tterm))
      , ([Char]
    builtinAgdaTermDef                      [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tqname TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    targs TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tterm))
      , ([Char]
    builtinAgdaTermCon                      [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tqname TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    targs TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tterm))
      , ([Char]
    builtinAgdaTermPi                       [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    targ TCM Type
    ttype TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type -> TCM Type
    forall {m :: * -> *} {t}.
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m (Type'' t Term) -> m Type
    tabs TCM Type
    ttype TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tterm))
      , ([Char]
    builtinAgdaTermSort                     [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tsort TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tterm))
      , ([Char]
    builtinAgdaTermLit                      [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tliteral TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tterm))
      , ([Char]
    builtinAgdaTermMeta                     [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tmeta TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    targs TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tterm))
      , ([Char]
    builtinAgdaTermUnsupported              [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons TCM Type
    tterm)
      , ([Char]
    builtinAgdaLitNat                       [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tnat TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tliteral))
      , ([Char]
    builtinAgdaLitWord64                    [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tword64 TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tliteral))
      , ([Char]
    builtinAgdaLitFloat                     [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tfloat TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tliteral))
      , ([Char]
    builtinAgdaLitChar                      [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tchar TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tliteral))
      , ([Char]
    builtinAgdaLitString                    [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tstring TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tliteral))
      , ([Char]
    builtinAgdaLitQName                     [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tqname TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tliteral))
      , ([Char]
    builtinAgdaLitMeta                      [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tmeta TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tliteral))
      , ([Char]
    builtinHidden                           [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons TCM Type
    thiding)
      , ([Char]
    builtinInstance                         [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons TCM Type
    thiding)
      , ([Char]
    builtinVisible                          [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons TCM Type
    thiding)
      , ([Char]
    builtinSizeUniv                         [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tSizeUniv) -- SizeUniv : SizeUniv
    -- See comment on tSizeUniv: the following does not work currently.
    --  , (builtinSizeUniv                          |-> builtinPostulate tSetOmega) -- SizeUniv : Setω
      , ([Char]
    builtinSize                             [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tSizeUniv)
      , ([Char]
    builtinSizeLt                           [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate (TCM Type
    tsize TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    ..--> TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tSizeUniv))
      , ([Char]
    builtinSizeSuc                          [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate (TCM Type
    tsize TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tsize))
      , ([Char]
    builtinSizeInf                          [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate TCM Type
    tsize)
      -- postulate max : {i : Size} -> Size< i -> Size< i -> Size< i
      , ([Char]
    builtinSizeMax                          [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate (TCM Type
    tsize TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tsize TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tsize))
         -- (hPi "i" tsize $ let a = el $ primSizeLt <@> v0 in (a --> a --> a)))
      , ([Char]
    builtinAgdaSortSet                      [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tterm TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tsort))
      , ([Char]
    builtinAgdaSortLit                      [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tnat TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tsort))
      , ([Char]
    builtinAgdaSortProp                     [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tterm TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tsort))
      , ([Char]
    builtinAgdaSortPropLit                  [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tnat TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tsort))
      , ([Char]
    builtinAgdaSortInf                      [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tnat TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tsort))
      , ([Char]
    builtinAgdaSortUnsupported              [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons TCM Type
    tsort)
      , ([Char]
    builtinNatPlus                          [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> [Char] -> (Term -> TCM ()) -> BuiltinDescriptor
    BuiltinPrim [Char]
    "primNatPlus" Term -> TCM ()
    verifyPlus)
      , ([Char]
    builtinNatMinus                         [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> [Char] -> (Term -> TCM ()) -> BuiltinDescriptor
    BuiltinPrim [Char]
    "primNatMinus" Term -> TCM ()
    verifyMinus)
      , ([Char]
    builtinNatTimes                         [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> [Char] -> (Term -> TCM ()) -> BuiltinDescriptor
    BuiltinPrim [Char]
    "primNatTimes" Term -> TCM ()
    verifyTimes)
      , ([Char]
    builtinNatDivSucAux                     [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> [Char] -> (Term -> TCM ()) -> BuiltinDescriptor
    BuiltinPrim [Char]
    "primNatDivSucAux" Term -> TCM ()
    verifyDivSucAux)
      , ([Char]
    builtinNatModSucAux                     [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> [Char] -> (Term -> TCM ()) -> BuiltinDescriptor
    BuiltinPrim [Char]
    "primNatModSucAux" Term -> TCM ()
    verifyModSucAux)
      , ([Char]
    builtinNatEquals                        [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> [Char] -> (Term -> TCM ()) -> BuiltinDescriptor
    BuiltinPrim [Char]
    "primNatEquality" Term -> TCM ()
    verifyEquals)
      , ([Char]
    builtinNatLess                          [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> [Char] -> (Term -> TCM ()) -> BuiltinDescriptor
    BuiltinPrim [Char]
    "primNatLess" Term -> TCM ()
    verifyLess)
      , ([Char]
    builtinLevelZero                        [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> [Char] -> (Term -> TCM ()) -> BuiltinDescriptor
    BuiltinPrim [Char]
    "primLevelZero" (TCM () -> Term -> TCM ()
    forall a b. a -> b -> a
    const (TCM () -> Term -> TCM ()) -> TCM () -> Term -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ () -> TCM ()
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()))
      , ([Char]
    builtinLevelSuc                         [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> [Char] -> (Term -> TCM ()) -> BuiltinDescriptor
    BuiltinPrim [Char]
    "primLevelSuc" (TCM () -> Term -> TCM ()
    forall a b. a -> b -> a
    const (TCM () -> Term -> TCM ()) -> TCM () -> Term -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ () -> TCM ()
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()))
      , ([Char]
    builtinLevelMax                         [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> [Char] -> (Term -> TCM ()) -> BuiltinDescriptor
    BuiltinPrim [Char]
    "primLevelMax" Term -> TCM ()
    forall {m :: * -> *} {p}. Monad m => p -> m ()
    verifyMax)
      , ([Char]
    builtinSet                              [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> [Char] -> BuiltinDescriptor
    BuiltinSort [Char]
    "primSet")
      , ([Char]
    builtinProp                             [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> [Char] -> BuiltinDescriptor
    BuiltinSort [Char]
    "primProp")
      , ([Char]
    builtinSetOmega                         [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> [Char] -> BuiltinDescriptor
    BuiltinSort [Char]
    "primSetOmega")
      , ([Char]
    builtinSSetOmega                        [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> [Char] -> BuiltinDescriptor
    BuiltinSort [Char]
    "primStrictSetOmega")
      , ([Char]
    builtinStrictSet                        [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> [Char] -> BuiltinDescriptor
    BuiltinSort [Char]
    "primStrictSet")
      , ([Char]
    builtinAgdaClause                       [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset [[Char]
    builtinAgdaClauseClause, [Char]
    builtinAgdaClauseAbsurd])
      , ([Char]
    builtinAgdaClauseClause                 [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    ttelescope TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    tlist (TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    targ TCM Type
    tpat) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tterm TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tclause))
      , ([Char]
    builtinAgdaClauseAbsurd                 [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    ttelescope TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    tlist (TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    targ TCM Type
    tpat) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tclause))
      , ([Char]
    builtinAgdaDefinition                   [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> [[Char]] -> BuiltinDescriptor
    BuiltinData TCM Type
    forall (m :: * -> *). Applicative m => m Type
    tset [[Char]
    builtinAgdaDefinitionFunDef
                                                                      ,[Char]
    builtinAgdaDefinitionDataDef
                                                                      ,[Char]
    builtinAgdaDefinitionDataConstructor
                                                                      ,[Char]
    builtinAgdaDefinitionRecordDef
                                                                      ,[Char]
    builtinAgdaDefinitionPostulate
                                                                      ,[Char]
    builtinAgdaDefinitionPrimitive])
      , ([Char]
    builtinAgdaDefinitionFunDef             [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    tlist TCM Type
    tclause TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tdefn))
      , ([Char]
    builtinAgdaDefinitionDataDef            [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tnat TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    tlist TCM Type
    tqname TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tdefn))
      , ([Char]
    builtinAgdaDefinitionDataConstructor    [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tqname TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tdefn))
      , ([Char]
    builtinAgdaDefinitionRecordDef          [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons (TCM Type
    tqname TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    tlist (TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    targ TCM Type
    tqname) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tdefn))
      , ([Char]
    builtinAgdaDefinitionPostulate          [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons TCM Type
    tdefn)
      , ([Char]
    builtinAgdaDefinitionPrimitive          [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    BuiltinDataCons TCM Type
    tdefn)
      , [Char]
    builtinAgdaTCM                           [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "a" TCM Type
    tlevel (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ Int -> TCM Type
    forall {m :: * -> *}. Monad m => Int -> m Type
    tsetL Int
    0 TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Int -> TCM Type
    forall {m :: * -> *}. Monad m => Int -> m Type
    tsetL Int
    0)
      , [Char]
    builtinAgdaTCMReturn                     [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "a" TCM Type
    tlevel  (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $
                                                                       [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" (Int -> TCM Type
    forall {m :: * -> *}. Monad m => Int -> m Type
    tsetL Int
    0) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $
                                                                       Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *} {a}.
    Functor f =>
    Int -> f a -> f (Type'' Term a)
    elV Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0))
      , [Char]
    builtinAgdaTCMBind                       [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "a" TCM Type
    tlevel  (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "b" TCM Type
    tlevel (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $
                                                                       [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" (Int -> TCM Type
    forall {m :: * -> *}. Monad m => Int -> m Type
    tsetL Int
    1) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "B" (Int -> TCM Type
    forall {m :: * -> *}. Monad m => Int -> m Type
    tsetL Int
    1) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $
                                                                       Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    3 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    1) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> (Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *} {a}.
    Functor f =>
    Int -> f a -> f (Type'' Term a)
    elV Int
    3 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    1) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    2 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0)) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    2 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0))
      , [Char]
    builtinAgdaTCMUnify                      [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate (TCM Type
    tterm TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tterm TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCMT IO Term -> TCM Type
    forall {m :: * -> *}.
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term -> m Type
    tTCM_ TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primUnit)
      , [Char]
    builtinAgdaTCMTypeError                  [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "a" TCM Type
    tlevel (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" (Int -> TCM Type
    forall {m :: * -> *}. Monad m => Int -> m Type
    tsetL Int
    0) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    tlist TCM Type
    terrorpart TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0))
      , [Char]
    builtinAgdaTCMInferType                  [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate (TCM Type
    tterm TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCMT IO Term -> TCM Type
    forall {m :: * -> *}.
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term -> m Type
    tTCM_ TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primAgdaTerm)
      , [Char]
    builtinAgdaTCMCheckType                  [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate (TCM Type
    tterm TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    ttype TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCMT IO Term -> TCM Type
    forall {m :: * -> *}.
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term -> m Type
    tTCM_ TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primAgdaTerm)
      , [Char]
    builtinAgdaTCMNormalise                  [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate (TCM Type
    tterm TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCMT IO Term -> TCM Type
    forall {m :: * -> *}.
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term -> m Type
    tTCM_ TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primAgdaTerm)
      , [Char]
    builtinAgdaTCMReduce                     [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate (TCM Type
    tterm TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCMT IO Term -> TCM Type
    forall {m :: * -> *}.
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term -> m Type
    tTCM_ TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primAgdaTerm)
      , [Char]
    builtinAgdaTCMCatchError                 [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "a" TCM Type
    tlevel (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" (Int -> TCM Type
    forall {m :: * -> *}. Monad m => Int -> m Type
    tsetL Int
    0) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $
                                                                       Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0))
      , [Char]
    builtinAgdaTCMGetContext                 [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate (TCMT IO Term -> TCM Type
    forall {m :: * -> *}.
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term -> m Type
    tTCM_ (Type -> Term
    forall t a. Type'' t a -> a
    unEl (Type -> Term) -> TCM Type -> TCMT IO Term
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    tlist (TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    targ TCM Type
    ttype)))
      , [Char]
    builtinAgdaTCMExtendContext              [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "a" TCM Type
    tlevel (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" (Int -> TCM Type
    forall {m :: * -> *}. Monad m => Int -> m Type
    tsetL Int
    0) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $
                                                                       TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    targ TCM Type
    ttype TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0))
      , [Char]
    builtinAgdaTCMInContext                  [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "a" TCM Type
    tlevel (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" (Int -> TCM Type
    forall {m :: * -> *}. Monad m => Int -> m Type
    tsetL Int
    0) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $
                                                                       TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    tlist (TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    targ TCM Type
    ttype) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0))
      , [Char]
    builtinAgdaTCMFreshName                  [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate (TCM Type
    tstring TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCMT IO Term -> TCM Type
    forall {m :: * -> *}.
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term -> m Type
    tTCM_ TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primQName)
      , [Char]
    builtinAgdaTCMDeclareDef                 [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate (TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    targ TCM Type
    tqname TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    ttype TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCMT IO Term -> TCM Type
    forall {m :: * -> *}.
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term -> m Type
    tTCM_ TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primUnit)
      , [Char]
    builtinAgdaTCMDeclarePostulate           [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate (TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    targ TCM Type
    tqname TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    ttype TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCMT IO Term -> TCM Type
    forall {m :: * -> *}.
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term -> m Type
    tTCM_ TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primUnit)
      , [Char]
    builtinAgdaTCMDefineFun                  [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate (TCM Type
    tqname TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    tlist TCM Type
    tclause TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCMT IO Term -> TCM Type
    forall {m :: * -> *}.
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term -> m Type
    tTCM_ TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primUnit)
      , [Char]
    builtinAgdaTCMGetType                    [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate (TCM Type
    tqname TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCMT IO Term -> TCM Type
    forall {m :: * -> *}.
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term -> m Type
    tTCM_ TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primAgdaTerm)
      , [Char]
    builtinAgdaTCMGetDefinition              [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate (TCM Type
    tqname TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCMT IO Term -> TCM Type
    forall {m :: * -> *}.
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term -> m Type
    tTCM_ TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primAgdaDefinition)
      , [Char]
    builtinAgdaTCMQuoteTerm                  [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "a" TCM Type
    tlevel (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" (Int -> TCM Type
    forall {m :: * -> *}. Monad m => Int -> m Type
    tsetL Int
    0) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *} {a}.
    Functor f =>
    Int -> f a -> f (Type'' Term a)
    elV Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCMT IO Term -> TCM Type
    forall {m :: * -> *}.
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term -> m Type
    tTCM_ TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primAgdaTerm)
      , [Char]
    builtinAgdaTCMUnquoteTerm                [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "a" TCM Type
    tlevel (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" (Int -> TCM Type
    forall {m :: * -> *}. Monad m => Int -> m Type
    tsetL Int
    0) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ TCM Type
    tterm TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0))
      , [Char]
    builtinAgdaTCMQuoteOmegaTerm             [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" TCM Type
    tsetOmega (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ (TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    elInf (TCMT IO Term -> TCM Type) -> TCMT IO Term -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCMT IO Term -> TCM Type
    forall {m :: * -> *}.
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term -> m Type
    tTCM_ TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primAgdaTerm)
      , [Char]
    builtinAgdaTCMBlockOnMeta                [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "a" TCM Type
    tlevel (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" (Int -> TCM Type
    forall {m :: * -> *}. Monad m => Int -> m Type
    tsetL Int
    0) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ TCM Type
    tmeta TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0))
      , [Char]
    builtinAgdaTCMCommit                     [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate (TCMT IO Term -> TCM Type
    forall {m :: * -> *}.
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term -> m Type
    tTCM_ TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primUnit)
      , [Char]
    builtinAgdaTCMIsMacro                    [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate (TCM Type
    tqname TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCMT IO Term -> TCM Type
    forall {m :: * -> *}.
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term -> m Type
    tTCM_ TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primBool)
      , [Char]
    builtinAgdaTCMWithNormalisation          [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "a" TCM Type
    tlevel (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" (Int -> TCM Type
    forall {m :: * -> *}. Monad m => Int -> m Type
    tsetL Int
    0) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ TCM Type
    tbool TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0))
      , [Char]
    builtinAgdaTCMWithReconsParams           [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "a" TCM Type
    tlevel (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" (Int -> TCM Type
    forall {m :: * -> *}. Monad m => Int -> m Type
    tsetL Int
    0) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0))
      , [Char]
    builtinAgdaTCMDebugPrint                 [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate (TCM Type
    tstring TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tnat TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    tlist TCM Type
    terrorpart TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCMT IO Term -> TCM Type
    forall {m :: * -> *}.
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term -> m Type
    tTCM_ TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primUnit)
      , [Char]
    builtinAgdaTCMOnlyReduceDefs             [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "a" TCM Type
    tlevel (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" (Int -> TCM Type
    forall {m :: * -> *}. Monad m => Int -> m Type
    tsetL Int
    0) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    tlist TCM Type
    tqname TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0))
      , [Char]
    builtinAgdaTCMDontReduceDefs             [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "a" TCM Type
    tlevel (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" (Int -> TCM Type
    forall {m :: * -> *}. Monad m => Int -> m Type
    tsetL Int
    0) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    tlist TCM Type
    tqname TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0))

      , [Char]
    builtinAgdaTCMNoConstraints              [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "a" TCM Type
    tlevel (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" (Int -> TCM Type
    forall {m :: * -> *}. Monad m => Int -> m Type
    tsetL Int
    0) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0))
      , [Char]
    builtinAgdaTCMRunSpeculative             [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate ([Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "a" TCM Type
    tlevel (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ [Char] -> TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *).
    (MonadAddContext m, MonadDebug m) =>
    [Char] -> m Type -> m Type -> m Type
    hPi [Char]
    "A" (Int -> TCM Type
    forall {m :: * -> *}. Monad m => Int -> m Type
    tsetL Int
    0) (TCM Type -> TCM Type) -> TCM Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $
                                                                       Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primSigma TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    1 TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevelZero TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0 TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> (ArgInfo -> Abs Term -> Term
    Lam ArgInfo
    defaultArgInfo (Abs Term -> Term) -> (Term -> Abs Term) -> Term -> Term
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . [Char] -> Term -> Abs Term
    forall a. [Char] -> a -> Abs a
    Abs [Char]
    "_" (Term -> Term) -> TCMT IO Term -> TCMT IO Term
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primBool)) TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> Int -> TCMT IO Term -> TCM Type
    forall {f :: * -> *}.
    (HasBuiltins f, MonadError TCErr f, MonadTCEnv f, ReadTCState f) =>
    Int -> f Term -> f Type
    tTCM Int
    1 (Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0))
      , [Char]
    builtinAgdaTCMExec                       [Char] -> BuiltinDescriptor -> BuiltinInfo
    |-> TCM Type -> BuiltinDescriptor
    builtinPostulate (TCM Type
    tstring TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    tlist TCM Type
    tstring TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    --> TCM Type
    tstring TCM Type -> TCM Type -> TCM Type
    forall (m :: * -> *). Applicative m => m Type -> m Type -> m Type
    -->
                                                                       TCMT IO Term -> TCM Type
    forall {m :: * -> *}.
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term -> m Type
    tTCM_ (TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primSigma TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevelZero TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevelZero TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primNat TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@>
                                                                              (ArgInfo -> Abs Term -> Term
    Lam ArgInfo
    defaultArgInfo (Abs Term -> Term) -> (Term -> Abs Term) -> Term -> Term
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . [Char] -> Term -> Abs Term
    forall a. [Char] -> a -> Abs a
    Abs [Char]
    "_" (Term -> Term) -> TCMT IO Term -> TCMT IO Term
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> (TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primSigma TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevelZero TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevelZero TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primString TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@>
                                                                               (ArgInfo -> Abs Term -> Term
    Lam ArgInfo
    defaultArgInfo (Abs Term -> Term) -> (Term -> Abs Term) -> Term -> Term
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . [Char] -> Term -> Abs Term
    forall a. [Char] -> a -> Abs a
    Abs [Char]
    "_" (Term -> Term) -> TCMT IO Term -> TCMT IO Term
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primString)))))
      ]
      where
            |-> :: [Char] -> BuiltinDescriptor -> BuiltinInfo
    (|->) = [Char] -> BuiltinDescriptor -> BuiltinInfo
    BuiltinInfo

            v0 :: TCM Term
            v0 :: TCMT IO Term
    v0 = Int -> TCMT IO Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    0

            tv0 :: TCM Type
            tv0 :: TCM Type
    tv0 = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    v0

            arg :: TCM Term -> TCM Term
            arg :: TCMT IO Term -> TCMT IO Term
    arg TCMT IO Term
    t = TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primArg TCMT IO Term -> TCMT IO Term -> TCMT IO Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> TCMT IO Term
    t

            elV :: Int -> f a -> f (Type'' Term a)
    elV Int
    x f a
    a = Sort -> a -> Type'' Term a
    forall t a. Sort' t -> a -> Type'' t a
    El (Int -> Sort
    varSort Int
    x) (a -> Type'' Term a) -> f a -> f (Type'' Term a)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> f a
    a

            tsetL :: Int -> m Type
    tsetL Int
    l    = Type -> m Type
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Type -> m Type) -> Type -> m Type
    forall a b. (a -> b) -> a -> b
    $ Sort -> Type
    sort (Int -> Sort
    varSort Int
    l)
            tsetOmega :: TCM Type
    tsetOmega  = Type -> TCM Type
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Type -> TCM Type) -> Type -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ Sort -> Type
    sort (Sort -> Type) -> Sort -> Type
    forall a b. (a -> b) -> a -> b
    $ IsFibrant -> Integer -> Sort
    forall t. IsFibrant -> Integer -> Sort' t
    Inf IsFibrant
    IsFibrant Integer
    0
            tlevel :: TCM Type
    tlevel     = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevel
            tlist :: TCMT IO (Type'' t Term) -> TCM Type
    tlist TCMT IO (Type'' t Term)
    x    = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (TCMT IO Term -> TCM Type) -> TCMT IO Term -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ TCMT IO Term -> TCMT IO Term
    list ((Type'' t Term -> Term) -> TCMT IO (Type'' t Term) -> TCMT IO Term
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap Type'' t Term -> Term
    forall t a. Type'' t a -> a
    unEl TCMT IO (Type'' t Term)
    x)
            tmaybe :: TCMT IO (Type'' t Term) -> TCM Type
    tmaybe TCMT IO (Type'' t Term)
    x   = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (TCMT IO Term -> TCM Type) -> TCMT IO Term -> TCM Type
    forall a b. (a -> b) -> a -> b
    $ TCMT IO Term -> TCMT IO Term
    tMaybe ((Type'' t Term -> Term) -> TCMT IO (Type'' t Term) -> TCMT IO Term
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap Type'' t Term -> Term
    forall t a. Type'' t a -> a
    unEl TCMT IO (Type'' t Term)
    x)
            tpair :: m Term
    -> m Term -> m (Type'' t Term) -> m (Type'' t Term) -> m Type
    tpair m Term
    lx m Term
    ly m (Type'' t Term)
    x m (Type'' t Term)
    y = m Term -> m Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (m Term -> m Type) -> m Term -> m Type
    forall a b. (a -> b) -> a -> b
    $ m Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primSigma
                                m Term -> m Term -> m Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> m Term
    lx
                                m Term -> m Term -> m Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> m Term
    ly
                                m Term -> m Term -> m Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> (Type'' t Term -> Term) -> m (Type'' t Term) -> m Term
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap Type'' t Term -> Term
    forall t a. Type'' t a -> a
    unEl m (Type'' t Term)
    x
                                m Term -> m Term -> m Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> (ArgInfo -> Abs Term -> Term
    Lam ArgInfo
    defaultArgInfo (Abs Term -> Term) -> (Term -> Abs Term) -> Term -> Term
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . [Char] -> Term -> Abs Term
    forall a. [Char] -> a -> Abs a
    NoAbs [Char]
    "_" (Term -> Term) -> m Term -> m Term
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> (Type'' t Term -> Term) -> m (Type'' t Term) -> m Term
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap Type'' t Term -> Term
    forall t a. Type'' t a -> a
    unEl m (Type'' t Term)
    y)
            targ :: TCMT IO (Type'' t Term) -> TCM Type
    targ TCMT IO (Type'' t Term)
    x     = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (TCMT IO Term -> TCMT IO Term
    arg ((Type'' t Term -> Term) -> TCMT IO (Type'' t Term) -> TCMT IO Term
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap Type'' t Term -> Term
    forall t a. Type'' t a -> a
    unEl TCMT IO (Type'' t Term)
    x))
            tabs :: m (Type'' t Term) -> m Type
    tabs m (Type'' t Term)
    x     = m Term -> m Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (m Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primAbs m Term -> m Term -> m Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> (Type'' t Term -> Term) -> m (Type'' t Term) -> m Term
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap Type'' t Term -> Term
    forall t a. Type'' t a -> a
    unEl m (Type'' t Term)
    x)
            targs :: TCM Type
    targs      = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (TCMT IO Term -> TCMT IO Term
    list (TCMT IO Term -> TCMT IO Term
    arg TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primAgdaTerm))
            tterm :: TCM Type
    tterm      = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primAgdaTerm
            terrorpart :: TCM Type
    terrorpart = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primAgdaErrorPart
            tnat :: TCM Type
    tnat       = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primNat
            tword64 :: TCM Type
    tword64    = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primWord64
            tinteger :: TCM Type
    tinteger   = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primInteger
            tfloat :: TCM Type
    tfloat     = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primFloat
            tchar :: TCM Type
    tchar      = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primChar
            tstring :: TCM Type
    tstring    = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primString
            tqname :: TCM Type
    tqname     = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primQName
            tmeta :: TCM Type
    tmeta      = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primAgdaMeta
            tsize :: TCM Type
    tsize      = Sort -> Term -> Type
    forall t a. Sort' t -> a -> Type'' t a
    El Sort
    sSizeUniv (Term -> Type) -> TCMT IO Term -> TCM Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primSize
            tbool :: TCM Type
    tbool      = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primBool
            thiding :: TCM Type
    thiding    = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primHiding
            trelevance :: TCM Type
    trelevance = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primRelevance
            tquantity :: TCM Type
    tquantity  = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primQuantity
            tmodality :: TCM Type
    tmodality  = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primModality
            tassoc :: TCM Type
    tassoc     = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primAssoc
            tprec :: TCM Type
    tprec      = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primPrecedence
            tfixity :: TCM Type
    tfixity    = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primFixity
    --        tcolors    = el (list primAgdaTerm) -- TODO guilhem
            targinfo :: TCM Type
    targinfo   = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primArgInfo
            ttype :: TCM Type
    ttype      = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primAgdaTerm
            tsort :: TCM Type
    tsort      = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primAgdaSort
            tdefn :: TCM Type
    tdefn      = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primAgdaDefinition
            tliteral :: TCM Type
    tliteral   = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primAgdaLiteral
            tpat :: TCM Type
    tpat       = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primAgdaPattern
            tclause :: TCM Type
    tclause    = TCMT IO Term -> TCM Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primAgdaClause
            ttelescope :: TCM Type
    ttelescope = TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    tlist (TCMT IO Term -> TCMT IO Term -> TCM Type -> TCM Type -> TCM Type
    forall {m :: * -> *} {t} {t}.
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    -> m Term -> m (Type'' t Term) -> m (Type'' t Term) -> m Type
    tpair TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevelZero TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevelZero TCM Type
    tstring (TCM Type -> TCM Type
    forall {t}. TCMT IO (Type'' t Term) -> TCM Type
    targ TCM Type
    ttype))
            tTCM :: Int -> f Term -> f Type
    tTCM Int
    l f Term
    a   = Int -> f Term -> f Type
    forall {f :: * -> *} {a}.
    Functor f =>
    Int -> f a -> f (Type'' Term a)
    elV Int
    l (f Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primAgdaTCM f Term -> f Term -> f Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> Int -> f Term
    forall (m :: * -> *). Applicative m => Int -> m Term
    varM Int
    l f Term -> f Term -> f Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> f Term
    a)
            tTCM_ :: m Term -> m Type
    tTCM_ m Term
    a    = m Term -> m Type
    forall (m :: * -> *). Functor m => m Term -> m Type
    el (m Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primAgdaTCM m Term -> m Term -> m Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> m Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primLevelZero m Term -> m Term -> m Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> m Term
    a)
            tinterval :: TCM Type
    tinterval  = Sort -> Term -> Type
    forall t a. Sort' t -> a -> Type'' t a
    El (Level -> Sort
    forall t. Level' t -> Sort' t
    SSet (Level -> Sort) -> Level -> Sort
    forall a b. (a -> b) -> a -> b
    $ Integer -> Level
    ClosedLevel Integer
    0) (Term -> Type) -> TCMT IO Term -> TCM Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primInterval

            verifyPlus :: Term -> TCM ()
    verifyPlus Term
    plus =
                [[Char]]
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM ())
    -> TCM ()
    forall {a}.
    [[Char]]
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM a)
    -> TCM a
    verify [[Char]
    "n",[Char]
    "m"] (((Term -> Term -> Term)
      -> Term
      -> (Term -> Term)
      -> (Term -> Term -> TCM ())
      -> (Term -> Term -> TCM ())
      -> ([TCM ()] -> TCM ())
      -> TCM ())
     -> TCM ())
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM ())
    -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ \Term -> Term -> Term
    (@@) Term
    zero Term -> Term
    suc Term -> Term -> TCM ()
    (==) Term -> Term -> TCM ()
    (===) [TCM ()] -> TCM ()
    choice -> do
                    let m :: Term
    m = Int -> Term
    var Int
    0
                        n :: Term
    n = Int -> Term
    var Int
    1
                        Term
    x + :: Term -> Term -> Term
    + Term
    y = Term
    plus Term -> Term -> Term
    @@ Term
    x Term -> Term -> Term
    @@ Term
    y

                    -- We allow recursion on any argument
                    [TCM ()] -> TCM ()
    choice
                        [ do Term
    n Term -> Term -> Term
    + Term
    zero  Term -> Term -> TCM ()
    == Term
    n
                             Term
    n Term -> Term -> Term
    + Term -> Term
    suc Term
    m Term -> Term -> TCM ()
    == Term -> Term
    suc (Term
    n Term -> Term -> Term
    + Term
    m)
                        , do Term -> Term
    suc Term
    n Term -> Term -> Term
    + Term
    m Term -> Term -> TCM ()
    == Term -> Term
    suc (Term
    n Term -> Term -> Term
    + Term
    m)
                             Term
    zero  Term -> Term -> Term
    + Term
    m Term -> Term -> TCM ()
    == Term
    m
                        ]

            verifyMinus :: Term -> TCM ()
    verifyMinus Term
    minus =
                [[Char]]
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM ())
    -> TCM ()
    forall {a}.
    [[Char]]
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM a)
    -> TCM a
    verify [[Char]
    "n",[Char]
    "m"] (((Term -> Term -> Term)
      -> Term
      -> (Term -> Term)
      -> (Term -> Term -> TCM ())
      -> (Term -> Term -> TCM ())
      -> ([TCM ()] -> TCM ())
      -> TCM ())
     -> TCM ())
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM ())
    -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ \Term -> Term -> Term
    (@@) Term
    zero Term -> Term
    suc Term -> Term -> TCM ()
    (==) Term -> Term -> TCM ()
    (===) [TCM ()] -> TCM ()
    choice -> do
                    let m :: Term
    m = Int -> Term
    var Int
    0
                        n :: Term
    n = Int -> Term
    var Int
    1
                        Term
    x - :: Term -> Term -> Term
    - Term
    y = Term
    minus Term -> Term -> Term
    @@ Term
    x Term -> Term -> Term
    @@ Term
    y

                    -- We allow recursion on any argument
                    Term
    zero  Term -> Term -> Term
    - Term
    zero  Term -> Term -> TCM ()
    == Term
    zero
                    Term
    zero  Term -> Term -> Term
    - Term -> Term
    suc Term
    m Term -> Term -> TCM ()
    == Term
    zero
                    Term -> Term
    suc Term
    n Term -> Term -> Term
    - Term
    zero  Term -> Term -> TCM ()
    == Term -> Term
    suc Term
    n
                    Term -> Term
    suc Term
    n Term -> Term -> Term
    - Term -> Term
    suc Term
    m Term -> Term -> TCM ()
    == (Term
    n Term -> Term -> Term
    - Term
    m)

            verifyTimes :: Term -> TCM ()
    verifyTimes Term
    times = do
                Term
    plus <- TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primNatPlus
                [[Char]]
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM ())
    -> TCM ()
    forall {a}.
    [[Char]]
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM a)
    -> TCM a
    verify [[Char]
    "n",[Char]
    "m"] (((Term -> Term -> Term)
      -> Term
      -> (Term -> Term)
      -> (Term -> Term -> TCM ())
      -> (Term -> Term -> TCM ())
      -> ([TCM ()] -> TCM ())
      -> TCM ())
     -> TCM ())
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM ())
    -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ \Term -> Term -> Term
    (@@) Term
    zero Term -> Term
    suc Term -> Term -> TCM ()
    (==) Term -> Term -> TCM ()
    (===) [TCM ()] -> TCM ()
    choice -> do
                    let m :: Term
    m = Int -> Term
    var Int
    0
                        n :: Term
    n = Int -> Term
    var Int
    1
                        Term
    x + :: Term -> Term -> Term
    + Term
    y = Term
    plus  Term -> Term -> Term
    @@ Term
    x Term -> Term -> Term
    @@ Term
    y
                        Term
    x * :: Term -> Term -> Term
    * Term
    y = Term
    times Term -> Term -> Term
    @@ Term
    x Term -> Term -> Term
    @@ Term
    y

                    [TCM ()] -> TCM ()
    choice
                        [ do Term
    n Term -> Term -> Term
    * Term
    zero Term -> Term -> TCM ()
    == Term
    zero
                             [TCM ()] -> TCM ()
    choice [ (Term
    n Term -> Term -> Term
    * Term -> Term
    suc Term
    m) Term -> Term -> TCM ()
    == (Term
    n Term -> Term -> Term
    + (Term
    n Term -> Term -> Term
    * Term
    m))
                                    , (Term
    n Term -> Term -> Term
    * Term -> Term
    suc Term
    m) Term -> Term -> TCM ()
    == ((Term
    n Term -> Term -> Term
    * Term
    m) Term -> Term -> Term
    + Term
    n)
                                    ]
                        , do Term
    zero Term -> Term -> Term
    * Term
    n Term -> Term -> TCM ()
    == Term
    zero
                             [TCM ()] -> TCM ()
    choice [ (Term -> Term
    suc Term
    n Term -> Term -> Term
    * Term
    m) Term -> Term -> TCM ()
    == (Term
    m Term -> Term -> Term
    + (Term
    n Term -> Term -> Term
    * Term
    m))
                                    , (Term -> Term
    suc Term
    n Term -> Term -> Term
    * Term
    m) Term -> Term -> TCM ()
    == ((Term
    n Term -> Term -> Term
    * Term
    m) Term -> Term -> Term
    + Term
    m)
                                    ]
                        ]

            verifyDivSucAux :: Term -> TCM ()
    verifyDivSucAux Term
    dsAux =
                [[Char]]
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM ())
    -> TCM ()
    forall {a}.
    [[Char]]
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM a)
    -> TCM a
    verify [[Char]
    "k",[Char]
    "m",[Char]
    "n",[Char]
    "j"] (((Term -> Term -> Term)
      -> Term
      -> (Term -> Term)
      -> (Term -> Term -> TCM ())
      -> (Term -> Term -> TCM ())
      -> ([TCM ()] -> TCM ())
      -> TCM ())
     -> TCM ())
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM ())
    -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ \Term -> Term -> Term
    (@@) Term
    zero Term -> Term
    suc Term -> Term -> TCM ()
    (==) Term -> Term -> TCM ()
    (===) [TCM ()] -> TCM ()
    choice -> do
                    let aux :: Term -> Term -> Term -> Term -> Term
    aux Term
    k Term
    m Term
    n Term
    j = Term
    dsAux Term -> Term -> Term
    @@ Term
    k Term -> Term -> Term
    @@ Term
    m Term -> Term -> Term
    @@ Term
    n Term -> Term -> Term
    @@ Term
    j
                        k :: Term
    k           = Int -> Term
    var Int
    0
                        m :: Term
    m           = Int -> Term
    var Int
    1
                        n :: Term
    n           = Int -> Term
    var Int
    2
                        j :: Term
    j           = Int -> Term
    var Int
    3

                    Term -> Term -> Term -> Term -> Term
    aux Term
    k Term
    m Term
    zero    Term
    j       Term -> Term -> TCM ()
    == Term
    k
                    Term -> Term -> Term -> Term -> Term
    aux Term
    k Term
    m (Term -> Term
    suc Term
    n) Term
    zero    Term -> Term -> TCM ()
    == Term -> Term -> Term -> Term -> Term
    aux (Term -> Term
    suc Term
    k) Term
    m Term
    n Term
    m
                    Term -> Term -> Term -> Term -> Term
    aux Term
    k Term
    m (Term -> Term
    suc Term
    n) (Term -> Term
    suc Term
    j) Term -> Term -> TCM ()
    == Term -> Term -> Term -> Term -> Term
    aux Term
    k Term
    m Term
    n Term
    j

            verifyModSucAux :: Term -> TCM ()
    verifyModSucAux Term
    dsAux =
                [[Char]]
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM ())
    -> TCM ()
    forall {a}.
    [[Char]]
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM a)
    -> TCM a
    verify [[Char]
    "k",[Char]
    "m",[Char]
    "n",[Char]
    "j"] (((Term -> Term -> Term)
      -> Term
      -> (Term -> Term)
      -> (Term -> Term -> TCM ())
      -> (Term -> Term -> TCM ())
      -> ([TCM ()] -> TCM ())
      -> TCM ())
     -> TCM ())
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM ())
    -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ \Term -> Term -> Term
    (@@) Term
    zero Term -> Term
    suc Term -> Term -> TCM ()
    (==) Term -> Term -> TCM ()
    (===) [TCM ()] -> TCM ()
    choice -> do
                    let aux :: Term -> Term -> Term -> Term -> Term
    aux Term
    k Term
    m Term
    n Term
    j = Term
    dsAux Term -> Term -> Term
    @@ Term
    k Term -> Term -> Term
    @@ Term
    m Term -> Term -> Term
    @@ Term
    n Term -> Term -> Term
    @@ Term
    j
                        k :: Term
    k           = Int -> Term
    var Int
    0
                        m :: Term
    m           = Int -> Term
    var Int
    1
                        n :: Term
    n           = Int -> Term
    var Int
    2
                        j :: Term
    j           = Int -> Term
    var Int
    3

                    Term -> Term -> Term -> Term -> Term
    aux Term
    k Term
    m Term
    zero    Term
    j       Term -> Term -> TCM ()
    == Term
    k
                    Term -> Term -> Term -> Term -> Term
    aux Term
    k Term
    m (Term -> Term
    suc Term
    n) Term
    zero    Term -> Term -> TCM ()
    == Term -> Term -> Term -> Term -> Term
    aux Term
    zero Term
    m Term
    n Term
    m
                    Term -> Term -> Term -> Term -> Term
    aux Term
    k Term
    m (Term -> Term
    suc Term
    n) (Term -> Term
    suc Term
    j) Term -> Term -> TCM ()
    == Term -> Term -> Term -> Term -> Term
    aux (Term -> Term
    suc Term
    k) Term
    m Term
    n Term
    j

            verifyEquals :: Term -> TCM ()
    verifyEquals Term
    eq =
                [[Char]]
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM ())
    -> TCM ()
    forall {a}.
    [[Char]]
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM a)
    -> TCM a
    verify [[Char]
    "n",[Char]
    "m"] (((Term -> Term -> Term)
      -> Term
      -> (Term -> Term)
      -> (Term -> Term -> TCM ())
      -> (Term -> Term -> TCM ())
      -> ([TCM ()] -> TCM ())
      -> TCM ())
     -> TCM ())
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM ())
    -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ \Term -> Term -> Term
    (@@) Term
    zero Term -> Term
    suc Term -> Term -> TCM ()
    (==) Term -> Term -> TCM ()
    (===) [TCM ()] -> TCM ()
    choice -> do
                Term
    true  <- TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primTrue
                Term
    false <- TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primFalse
                let Term
    x == :: Term -> Term -> Term
    == Term
    y = Term
    eq Term -> Term -> Term
    @@ Term
    x Term -> Term -> Term
    @@ Term
    y
                    m :: Term
    m      = Int -> Term
    var Int
    0
                    n :: Term
    n      = Int -> Term
    var Int
    1
                (Term
    zero  Term -> Term -> Term
    == Term
    zero ) Term -> Term -> TCM ()
    === Term
    true
                (Term -> Term
    suc Term
    n Term -> Term -> Term
    == Term -> Term
    suc Term
    m) Term -> Term -> TCM ()
    === (Term
    n Term -> Term -> Term
    == Term
    m)
                (Term -> Term
    suc Term
    n Term -> Term -> Term
    == Term
    zero ) Term -> Term -> TCM ()
    === Term
    false
                (Term
    zero  Term -> Term -> Term
    == Term -> Term
    suc Term
    n) Term -> Term -> TCM ()
    === Term
    false

            verifyLess :: Term -> TCM ()
    verifyLess Term
    leq =
                [[Char]]
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM ())
    -> TCM ()
    forall {a}.
    [[Char]]
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM a)
    -> TCM a
    verify [[Char]
    "n",[Char]
    "m"] (((Term -> Term -> Term)
      -> Term
      -> (Term -> Term)
      -> (Term -> Term -> TCM ())
      -> (Term -> Term -> TCM ())
      -> ([TCM ()] -> TCM ())
      -> TCM ())
     -> TCM ())
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM ())
    -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ \Term -> Term -> Term
    (@@) Term
    zero Term -> Term
    suc Term -> Term -> TCM ()
    (==) Term -> Term -> TCM ()
    (===) [TCM ()] -> TCM ()
    choice -> do
                Term
    true  <- TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primTrue
                Term
    false <- TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primFalse
                let Term
    x < :: Term -> Term -> Term
    < Term
    y = Term
    leq Term -> Term -> Term
    @@ Term
    x Term -> Term -> Term
    @@ Term
    y
                    m :: Term
    m     = Int -> Term
    var Int
    0
                    n :: Term
    n     = Int -> Term
    var Int
    1
                (Term
    n     Term -> Term -> Term
    < Term
    zero)  Term -> Term -> TCM ()
    === Term
    false
                (Term -> Term
    suc Term
    n Term -> Term -> Term
    < Term -> Term
    suc Term
    m) Term -> Term -> TCM ()
    === (Term
    n Term -> Term -> Term
    < Term
    m)
                (Term
    zero  Term -> Term -> Term
    < Term -> Term
    suc Term
    m) Term -> Term -> TCM ()
    === Term
    true

            verifyMax :: p -> m ()
    verifyMax p
    maxV = () -> m ()
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()  -- TODO: make max a postulate

            verify :: [[Char]]
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM a)
    -> TCM a
    verify [[Char]]
    xs = TCMT IO Term
    -> TCMT IO Term
    -> TCMT IO Term
    -> [[Char]]
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM a)
    -> TCM a
    forall a.
    TCMT IO Term
    -> TCMT IO Term
    -> TCMT IO Term
    -> [[Char]]
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM a)
    -> TCM a
    verify' TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primNat TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primZero TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primSuc [[Char]]
    xs

            verify' ::  TCM Term -> TCM Term -> TCM Term ->
                        [String] -> ( (Term -> Term -> Term) -> Term -> (Term -> Term) ->
                                    (Term -> Term -> TCM ()) ->
                                    (Term -> Term -> TCM ()) ->
                                    ([TCM ()] -> TCM ()) -> TCM a) -> TCM a
            verify' :: forall a.
    TCMT IO Term
    -> TCMT IO Term
    -> TCMT IO Term
    -> [[Char]]
    -> ((Term -> Term -> Term)
        -> Term
        -> (Term -> Term)
        -> (Term -> Term -> TCM ())
        -> (Term -> Term -> TCM ())
        -> ([TCM ()] -> TCM ())
        -> TCM a)
    -> TCM a
    verify' TCMT IO Term
    pNat TCMT IO Term
    pZero TCMT IO Term
    pSuc [[Char]]
    xs (Term -> Term -> Term)
    -> Term
    -> (Term -> Term)
    -> (Term -> Term -> TCM ())
    -> (Term -> Term -> TCM ())
    -> ([TCM ()] -> TCM ())
    -> TCM a
    f = do
                Type
    nat  <- Sort -> Term -> Type
    forall t a. Sort' t -> a -> Type'' t a
    El (Integer -> Sort
    mkType Integer
    0) (Term -> Type) -> TCMT IO Term -> TCM Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> TCMT IO Term
    pNat
                Term
    zero <- TCMT IO Term
    pZero
                Term
    s    <- TCMT IO Term
    pSuc
                let Term
    x == :: Term -> Term -> TCM ()
    == Term
    y  = TCM () -> TCM ()
    forall (m :: * -> *) a.
    (MonadConstraint m, MonadWarning m, MonadError TCErr m,
     MonadFresh ProblemId m) =>
    m a -> m a
    noConstraints (TCM () -> TCM ()) -> TCM () -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ Type -> Term -> Term -> TCM ()
    forall (m :: * -> *).
    MonadConversion m =>
    Type -> Term -> Term -> m ()
    equalTerm Type
    nat Term
    x Term
    y
                    -- Andreas: 2013-10-21 I put primBool here on the inside
                    -- since some Nat-builtins do not require Bool-builtins
                    Term
    x === :: Term -> Term -> m ()
    === Term
    y = do Type
    bool <- Sort -> Term -> Type
    forall t a. Sort' t -> a -> Type'' t a
    El (Integer -> Sort
    mkType Integer
    0) (Term -> Type) -> m Term -> m Type
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> m Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primBool
                                 m () -> m ()
    forall (m :: * -> *) a.
    (MonadConstraint m, MonadWarning m, MonadError TCErr m,
     MonadFresh ProblemId m) =>
    m a -> m a
    noConstraints (m () -> m ()) -> m () -> m ()
    forall a b. (a -> b) -> a -> b
    $ Type -> Term -> Term -> m ()
    forall (m :: * -> *).
    MonadConversion m =>
    Type -> Term -> Term -> m ()
    equalTerm Type
    bool Term
    x Term
    y
                    suc :: Term -> Term
    suc Term
    n  = Term
    s Term -> Term -> Term
    forall t. Apply t => t -> Term -> t
    `apply1` Term
    n
                    choice :: [TCMT IO a] -> TCMT IO a
    choice = (TCMT IO a -> TCMT IO a -> TCMT IO a) -> [TCMT IO a] -> TCMT IO a
    forall (t :: * -> *) a. Foldable t => (a -> a -> a) -> t a -> a
    foldr1 (\TCMT IO a
    x TCMT IO a
    y -> TCMT IO a
    x TCMT IO a -> (TCErr -> TCMT IO a) -> TCMT IO a
    forall e (m :: * -> *) a.
    MonadError e m =>
    m a -> (e -> m a) -> m a
    `catchError` \TCErr
    _ -> TCMT IO a
    y)
                [Name]
    xs <- ([Char] -> TCMT IO Name) -> [[Char]] -> TCMT IO [Name]
    forall (t :: * -> *) (m :: * -> *) a b.
    (Traversable t, Monad m) =>
    (a -> m b) -> t a -> m (t b)
    mapM [Char] -> TCMT IO Name
    forall a (m :: * -> *).
    (FreshName a, MonadFresh NameId m) =>
    a -> m Name
    freshName_ [[Char]]
    xs
                ([Name], Dom Type) -> TCM a -> TCM a
    forall b (m :: * -> *) a.
    (AddContext b, MonadAddContext m) =>
    b -> m a -> m a
    addContext ([Name]
    xs, Arg Type -> Dom Type
    forall a. Arg a -> Dom a
    domFromArg (Arg Type -> Dom Type) -> Arg Type -> Dom Type
    forall a b. (a -> b) -> a -> b
    $ Type -> Arg Type
    forall a. a -> Arg a
    defaultArg Type
    nat) (TCM a -> TCM a) -> TCM a -> TCM a
    forall a b. (a -> b) -> a -> b
    $ (Term -> Term -> Term)
    -> Term
    -> (Term -> Term)
    -> (Term -> Term -> TCM ())
    -> (Term -> Term -> TCM ())
    -> ([TCM ()] -> TCM ())
    -> TCM a
    f Term -> Term -> Term
    forall t. Apply t => t -> Term -> t
    apply1 Term
    zero Term -> Term
    suc Term -> Term -> TCM ()
    (==) Term -> Term -> TCM ()
    forall {m :: * -> *}.
    (MonadWarning m, MonadMetaSolver m, MonadStatistics m,
     MonadFresh ProblemId m, MonadFresh Int m) =>
    Term -> Term -> m ()
    (===) [TCM ()] -> TCM ()
    forall {a}. [TCMT IO a] -> TCMT IO a
    choice

            verifyPath :: Term -> Type -> TCM ()
            verifyPath :: Term -> Type -> TCM ()
    verifyPath Term
    path Type
    t = do
              let hlam :: [Char] -> (NamesT m Term -> NamesT m Term) -> NamesT m Term
    hlam [Char]
    n NamesT m Term -> NamesT m Term
    t = ArgInfo
    -> [Char] -> (NamesT m Term -> NamesT m Term) -> NamesT m Term
    forall (m :: * -> *).
    MonadFail m =>
    ArgInfo
    -> [Char] -> (NamesT m Term -> NamesT m Term) -> NamesT m Term
    glam (Hiding -> ArgInfo -> ArgInfo
    forall a. LensHiding a => Hiding -> a -> a
    setHiding Hiding
    Hidden ArgInfo
    defaultArgInfo) [Char]
    n NamesT m Term -> NamesT m Term
    t
              TCM () -> TCM ()
    forall (m :: * -> *) a.
    (MonadConstraint m, MonadWarning m, MonadError TCErr m,
     MonadFresh ProblemId m) =>
    m a -> m a
    noConstraints (TCM () -> TCM ()) -> TCM () -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ Type -> Term -> Term -> TCM ()
    forall (m :: * -> *).
    MonadConversion m =>
    Type -> Term -> Term -> m ()
    equalTerm Type
    t Term
    path (Term -> TCM ()) -> TCMT IO Term -> TCM ()
    forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
    =<< [[Char]] -> NamesT (TCMT IO) Term -> TCMT IO Term
    forall (m :: * -> *) a. [[Char]] -> NamesT m a -> m a
    runNamesT [] (
                [Char]
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term)
    -> NamesT (TCMT IO) Term
    forall (m :: * -> *).
    MonadFail m =>
    [Char] -> (NamesT m Term -> NamesT m Term) -> NamesT m Term
    hlam [Char]
    "l" ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term)
     -> NamesT (TCMT IO) Term)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term)
    -> NamesT (TCMT IO) Term
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    l -> [Char]
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term)
    -> NamesT (TCMT IO) Term
    forall (m :: * -> *).
    MonadFail m =>
    [Char] -> (NamesT m Term -> NamesT m Term) -> NamesT m Term
    hlam [Char]
    "A" ((NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term)
     -> NamesT (TCMT IO) Term)
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term)
    -> NamesT (TCMT IO) Term
    forall a b. (a -> b) -> a -> b
    $ \ NamesT (TCMT IO) Term
    bA -> TCMT IO Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *) a. Monad m => m a -> NamesT m a
    cl TCMT IO Term
    forall (m :: * -> *).
    (HasBuiltins m, MonadError TCErr m, MonadTCEnv m, ReadTCState m) =>
    m Term
    primPathP NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <#> NamesT (TCMT IO) Term
    l NamesT (TCMT IO) Term
    -> NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term
    forall (m :: * -> *). Applicative m => m Term -> m Term -> m Term
    <@> [Char]
    -> (NamesT (TCMT IO) Term -> NamesT (TCMT IO) Term)
    -> NamesT (TCMT IO) Term
    forall (m :: * -> *).
    MonadFail m =>
    [Char] -> (NamesT m Term -> NamesT m Term) -> NamesT m Term
    lam [Char]
    "i" (\ NamesT (TCMT IO) Term
    _ -> NamesT (TCMT IO) Term
    bA))

    -- | Checks that builtin with name @b : String@ of type @t : Term@
    --   is a data type or inductive record with @n : Int@ constructors.
    --   Returns the name of the data/record type.
    inductiveCheck :: String -> Int -> Term -> TCM (QName, Definition)
    inductiveCheck :: [Char] -> Int -> Term -> TCM (QName, Definition)
    inductiveCheck [Char]
    b Int
    n Term
    t = do
      TCMT IO (Maybe QName)
    -> TCM (QName, Definition)
    -> (QName -> TCM (QName, Definition))
    -> TCM (QName, Definition)
    forall (m :: * -> *) a b.
    Monad m =>
    m (Maybe a) -> m b -> (a -> m b) -> m b
    caseMaybeM (Term -> TCMT IO (Maybe QName)
    headSymbol Term
    t) TCM (QName, Definition)
    no ((QName -> TCM (QName, Definition)) -> TCM (QName, Definition))
    -> (QName -> TCM (QName, Definition)) -> TCM (QName, Definition)
    forall a b. (a -> b) -> a -> b
    $ \QName
    q -> do
          Definition
    def <- QName -> TCMT IO Definition
    forall (m :: * -> *). HasConstInfo m => QName -> m Definition
    getConstInfo QName
    q
          let yes :: TCM (QName, Definition)
    yes = (QName, Definition) -> TCM (QName, Definition)
    forall (m :: * -> *) a. Monad m => a -> m a
    return (QName
    q, Definition
    def)
          case Definition -> Defn
    theDef Definition
    def of
            Datatype { dataCons :: Defn -> [QName]
    dataCons = [QName]
    cs }
              | [QName] -> Int
    forall (t :: * -> *) a. Foldable t => t a -> Int
    length [QName]
    cs Int -> Int -> Bool
    forall a. Eq a => a -> a -> Bool
    == Int
    n -> TCM (QName, Definition)
    yes
              | Bool
    otherwise      -> TCM (QName, Definition)
    no
            Record { recInduction :: Defn -> Maybe Induction
    recInduction = Maybe Induction
    ind } | Int
    n Int -> Int -> Bool
    forall a. Eq a => a -> a -> Bool
    == Int
    1 Bool -> Bool -> Bool
    && Maybe Induction
    ind Maybe Induction -> Maybe Induction -> Bool
    forall a. Eq a => a -> a -> Bool
    /= Induction -> Maybe Induction
    forall a. a -> Maybe a
    Just Induction
    CoInductive -> TCM (QName, Definition)
    yes
            Defn
    _ -> TCM (QName, Definition)
    no
      where
      headSymbol :: Term -> TCM (Maybe QName)
      headSymbol :: Term -> TCMT IO (Maybe QName)
    headSymbol Term
    t = Term -> TCMT IO Term
    forall a (m :: * -> *). (Reduce a, MonadReduce m) => a -> m a
    reduce Term
    t TCMT IO Term
    -> (Term -> TCMT IO (Maybe QName)) -> TCMT IO (Maybe QName)
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= \case
        Def QName
    q Elims
    _ -> Maybe QName -> TCMT IO (Maybe QName)
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Maybe QName -> TCMT IO (Maybe QName))
    -> Maybe QName -> TCMT IO (Maybe QName)
    forall a b. (a -> b) -> a -> b
    $ QName -> Maybe QName
    forall a. a -> Maybe a
    Just QName
    q
        Lam ArgInfo
    _ Abs Term
    b -> Term -> TCMT IO (Maybe QName)
    headSymbol (Term -> TCMT IO (Maybe QName)) -> Term -> TCMT IO (Maybe QName)
    forall a b. (a -> b) -> a -> b
    $ Abs Term -> SubstArg Term -> Term
    forall a. Subst a => Abs a -> SubstArg a -> a
    lazyAbsApp Abs Term
    b SubstArg Term
    HasCallStack => Term
    __DUMMY_TERM__
        Term
    _       -> Maybe QName -> TCMT IO (Maybe QName)
    forall (m :: * -> *) a. Monad m => a -> m a
    return Maybe QName
    forall a. Maybe a
    Nothing

      no :: TCM (QName, Definition)
    no
        | Int
    n Int -> Int -> Bool
    forall a. Eq a => a -> a -> Bool
    == Int
    1 = TypeError -> TCM (QName, Definition)
    forall (m :: * -> *) a.
    (HasCallStack, MonadTCError m) =>
    TypeError -> m a
    typeError (TypeError -> TCM (QName, Definition))
    -> TypeError -> TCM (QName, Definition)
    forall a b. (a -> b) -> a -> b
    $ [Char] -> TypeError
    GenericError ([Char] -> TypeError) -> [Char] -> TypeError
    forall a b. (a -> b) -> a -> b
    $ [[Char]] -> [Char]
    unwords
            [ [Char]
    "The builtin", [Char]
    b
            , [Char]
    "must be a datatype with a single constructor"
            , [Char]
    "or an (inductive) record type"
            ]
        | Bool
    otherwise = TypeError -> TCM (QName, Definition)
    forall (m :: * -> *) a.
    (HasCallStack, MonadTCError m) =>
    TypeError -> m a
    typeError (TypeError -> TCM (QName, Definition))
    -> TypeError -> TCM (QName, Definition)
    forall a b. (a -> b) -> a -> b
    $ [Char] -> TypeError
    GenericError ([Char] -> TypeError) -> [Char] -> TypeError
    forall a b. (a -> b) -> a -> b
    $ [[Char]] -> [Char]
    unwords
            [ [Char]
    "The builtin", [Char]
    b
            , [Char]
    "must be a datatype with", Int -> [Char]
    forall a. Show a => a -> [Char]
    show Int
    n
            , [Char]
    "constructors"
            ]

    -- | @bindPostulatedName builtin q m@ checks that @q@ is a postulated
    -- name, and binds the builtin @builtin@ to the term @m q def@,
    -- where @def@ is the current 'Definition' of @q@.

    bindPostulatedName ::
      String -> ResolvedName -> (QName -> Definition -> TCM Term) -> TCM ()
    bindPostulatedName :: [Char]
    -> ResolvedName -> (QName -> Definition -> TCMT IO Term) -> TCM ()
    bindPostulatedName [Char]
    builtin ResolvedName
    x QName -> Definition -> TCMT IO Term
    m = do
      QName
    q   <- ResolvedName -> TCMT IO QName
    getName ResolvedName
    x
      Definition
    def <- QName -> TCMT IO Definition
    forall (m :: * -> *). HasConstInfo m => QName -> m Definition
    getConstInfo QName
    q
      case Definition -> Defn
    theDef Definition
    def of
        Axiom {} -> [Char] -> Term -> TCM ()
    bindBuiltinName [Char]
    builtin (Term -> TCM ()) -> TCMT IO Term -> TCM ()
    forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
    =<< QName -> Definition -> TCMT IO Term
    m QName
    q Definition
    def
        Defn
    _        -> TCM ()
    forall (m :: * -> *) a. MonadTCError m => m a
    err
      where
      err :: forall m a. MonadTCError m => m a
      err :: forall (m :: * -> *) a. MonadTCError m => m a
    err = TypeError -> m a
    forall (m :: * -> *) a.
    (HasCallStack, MonadTCError m) =>
    TypeError -> m a
    typeError (TypeError -> m a) -> TypeError -> m a
    forall a b. (a -> b) -> a -> b
    $ [Char] -> TypeError
    GenericError ([Char] -> TypeError) -> [Char] -> TypeError
    forall a b. (a -> b) -> a -> b
    $
              [Char]
    "The argument to BUILTIN " [Char] -> [Char] -> [Char]
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    builtin [Char] -> [Char] -> [Char]
    forall a. [a] -> [a] -> [a]
    ++
              [Char]
    " must be a postulated name"
      getName :: ResolvedName -> TCMT IO QName
    getName = \case
        DefinedName Access
    _ AbstractName
    d Suffix
    NoSuffix -> QName -> TCMT IO QName
    forall (m :: * -> *) a. Monad m => a -> m a
    return (QName -> TCMT IO QName) -> QName -> TCMT IO QName
    forall a b. (a -> b) -> a -> b
    $ AbstractName -> QName
    anameName AbstractName
    d
        ResolvedName
    _ -> TCMT IO QName
    forall (m :: * -> *) a. MonadTCError m => m a
    err

    addHaskellPragma :: QName -> String -> TCM ()
    addHaskellPragma :: QName -> [Char] -> TCM ()
    addHaskellPragma = [Char] -> QName -> [Char] -> TCM ()
    addPragma [Char]
    ghcBackendName

    bindAndSetHaskellCode :: String -> String -> Term -> TCM ()
    bindAndSetHaskellCode :: [Char] -> [Char] -> Term -> TCM ()
    bindAndSetHaskellCode [Char]
    b [Char]
    hs Term
    t = do
      QName
    d <- QName -> Maybe QName -> QName
    forall a. a -> Maybe a -> a
    fromMaybe QName
    forall a. HasCallStack => a
    __IMPOSSIBLE__ (Maybe QName -> QName) -> TCMT IO (Maybe QName) -> TCMT IO QName
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Term -> TCMT IO (Maybe QName)
    getDef Term
    t
      [Char] -> Term -> TCM ()
    bindBuiltinName [Char]
    b Term
    t
      QName -> [Char] -> TCM ()
    addHaskellPragma QName
    d [Char]
    hs

    bindBuiltinBool :: Term -> TCM ()
    bindBuiltinBool :: Term -> TCM ()
    bindBuiltinBool = [Char] -> [Char] -> Term -> TCM ()
    bindAndSetHaskellCode [Char]
    builtinBool [Char]
    "= type Bool"

    -- | Check that we're not trying to bind true and false to the same
    -- constructor.
    checkBuiltinBool :: TCM ()
    checkBuiltinBool :: TCM ()
    checkBuiltinBool = do
      Maybe Term
    true  <- [Char] -> TCMT IO (Maybe Term)
    forall (m :: * -> *). HasBuiltins m => [Char] -> m (Maybe Term)
    getBuiltin' [Char]
    builtinTrue
      Maybe Term
    false <- [Char] -> TCMT IO (Maybe Term)
    forall (m :: * -> *). HasBuiltins m => [Char] -> m (Maybe Term)
    getBuiltin' [Char]
    builtinFalse
      Bool -> TCM () -> TCM ()
    forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
    when (Maybe Term
    true Maybe Term -> Maybe Term -> Bool
    forall a. Eq a => a -> a -> Bool
    == Maybe Term
    false) (TCM () -> TCM ()) -> TCM () -> TCM ()
    forall a b. (a -> b) -> a -> b
    $
        [Char] -> TCM ()
    forall (m :: * -> *) a.
    (HasCallStack, MonadTCError m) =>
    [Char] -> m a
    genericError [Char]
    "Cannot bind TRUE and FALSE to the same constructor"

    bindBuiltinInt :: Term -> TCM ()
    bindBuiltinInt :: Term -> TCM ()
    bindBuiltinInt = [Char] -> [Char] -> Term -> TCM ()
    bindAndSetHaskellCode [Char]
    builtinInteger [Char]
    "= type Integer"

    bindBuiltinNat :: Term -> TCM ()
    bindBuiltinNat :: Term -> TCM ()
    bindBuiltinNat Term
    t = do
      [Char] -> Term -> TCM ()
    bindBuiltinData [Char]
    builtinNat Term
    t
      QName
    name <- QName -> Maybe QName -> QName
    forall a. a -> Maybe a -> a
    fromMaybe QName
    forall a. HasCallStack => a
    __IMPOSSIBLE__ (Maybe QName -> QName) -> TCMT IO (Maybe QName) -> TCMT IO QName
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Term -> TCMT IO (Maybe QName)
    getDef Term
    t
      QName -> [Char] -> TCM ()
    addHaskellPragma QName
    name [Char]
    "= type Integer"

    -- | Only use for datatypes with distinct arities of constructors.
    --   Binds the constructors together with the datatype.
    bindBuiltinData :: String -> Term -> TCM ()
    bindBuiltinData :: [Char] -> Term -> TCM ()
    bindBuiltinData [Char]
    s Term
    t = do
      [Char] -> Term -> TCM ()
    bindBuiltinName [Char]
    s Term
    t
      QName
    name <- QName -> Maybe QName -> QName
    forall a. a -> Maybe a -> a
    fromMaybe QName
    forall a. HasCallStack => a
    __IMPOSSIBLE__ (Maybe QName -> QName) -> TCMT IO (Maybe QName) -> TCMT IO QName
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Term -> TCMT IO (Maybe QName)
    getDef Term
    t
      Datatype{ dataCons :: Defn -> [QName]
    dataCons = [QName]
    cs } <- Definition -> Defn
    theDef (Definition -> Defn) -> TCMT IO Definition -> TCMT IO Defn
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> QName -> TCMT IO Definition
    forall (m :: * -> *). HasConstInfo m => QName -> m Definition
    getConstInfo QName
    name
      let getArity :: QName -> m Int
    getArity QName
    c = do
            Constructor{ conArity :: Defn -> Int
    conArity = Int
    a } <- Definition -> Defn
    theDef (Definition -> Defn) -> m Definition -> m Defn
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> QName -> m Definition
    forall (m :: * -> *). HasConstInfo m => QName -> m Definition
    getConstInfo QName
    c
            Int -> m Int
    forall (m :: * -> *) a. Monad m => a -> m a
    return Int
    a
          getBuiltinArity :: BuiltinDescriptor -> TCMT IO Int
    getBuiltinArity (BuiltinDataCons TCM Type
    t) = Type -> Int
    arity (Type -> Int) -> TCM Type -> TCMT IO Int
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> TCM Type
    t
          getBuiltinArity BuiltinDescriptor
    _ = TCMT IO Int
    forall a. HasCallStack => a
    __IMPOSSIBLE__
          sortByM :: (a -> f b) -> [a] -> f [a]
    sortByM a -> f b
    f [a]
    xs = ((a, b) -> a) -> [(a, b)] -> [a]
    forall a b. (a -> b) -> [a] -> [b]
    map (a, b) -> a
    forall a b. (a, b) -> a
    fst ([(a, b)] -> [a]) -> ([b] -> [(a, b)]) -> [b] -> [a]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ((a, b) -> (a, b) -> Ordering) -> [(a, b)] -> [(a, b)]
    forall a. (a -> a -> Ordering) -> [a] -> [a]
    sortBy (b -> b -> Ordering
    forall a. Ord a => a -> a -> Ordering
    compare (b -> b -> Ordering)
    -> ((a, b) -> b) -> (a, b) -> (a, b) -> Ordering
    forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
    `on` (a, b) -> b
    forall a b. (a, b) -> b
    snd) ([(a, b)] -> [(a, b)]) -> ([b] -> [(a, b)]) -> [b] -> [(a, b)]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . [a] -> [b] -> [(a, b)]
    forall a b. [a] -> [b] -> [(a, b)]
    zip [a]
    xs ([b] -> [a]) -> f [b] -> f [a]
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> (a -> f b) -> [a] -> f [b]
    forall (t :: * -> *) (m :: * -> *) a b.
    (Traversable t, Monad m) =>
    (a -> m b) -> t a -> m (t b)
    mapM a -> f b
    f [a]
    xs
      -- Order constructurs by arity
      [QName]
    cs <- (QName -> TCMT IO Int) -> [QName] -> TCMT IO [QName]
    forall {f :: * -> *} {b} {a}.
    (Ord b, Monad f) =>
    (a -> f b) -> [a] -> f [a]
    sortByM QName -> TCMT IO Int
    forall {m :: * -> *}. HasConstInfo m => QName -> m Int
    getArity [QName]
    cs
      -- Do the same for the builtins
      let bcis :: [BuiltinInfo]
    bcis = [BuiltinInfo] -> Maybe [BuiltinInfo] -> [BuiltinInfo]
    forall a. a -> Maybe a -> a
    fromMaybe [BuiltinInfo]
    forall a. HasCallStack => a
    __IMPOSSIBLE__ (Maybe [BuiltinInfo] -> [BuiltinInfo])
    -> Maybe [BuiltinInfo] -> [BuiltinInfo]
    forall a b. (a -> b) -> a -> b
    $ do
            BuiltinData TCM Type
    _ [[Char]]
    bcs <- BuiltinInfo -> BuiltinDescriptor
    builtinDesc (BuiltinInfo -> BuiltinDescriptor)
    -> Maybe BuiltinInfo -> Maybe BuiltinDescriptor
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> [Char] -> Maybe BuiltinInfo
    findBuiltinInfo [Char]
    s
            ([Char] -> Maybe BuiltinInfo) -> [[Char]] -> Maybe [BuiltinInfo]
    forall (t :: * -> *) (m :: * -> *) a b.
    (Traversable t, Monad m) =>
    (a -> m b) -> t a -> m (t b)
    mapM [Char] -> Maybe BuiltinInfo
    findBuiltinInfo [[Char]]
    bcs
      [BuiltinInfo]
    bcis <- (BuiltinInfo -> TCMT IO Int)
    -> [BuiltinInfo] -> TCMT IO [BuiltinInfo]
    forall {f :: * -> *} {b} {a}.
    (Ord b, Monad f) =>
    (a -> f b) -> [a] -> f [a]
    sortByM (BuiltinDescriptor -> TCMT IO Int
    getBuiltinArity (BuiltinDescriptor -> TCMT IO Int)
    -> (BuiltinInfo -> BuiltinDescriptor) -> BuiltinInfo -> TCMT IO Int
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . BuiltinInfo -> BuiltinDescriptor
    builtinDesc) [BuiltinInfo]
    bcis
      Bool -> TCM () -> TCM ()
    forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
    unless ([QName] -> Int
    forall (t :: * -> *) a. Foldable t => t a -> Int
    length [QName]
    cs Int -> Int -> Bool
    forall a. Eq a => a -> a -> Bool
    == [BuiltinInfo] -> Int
    forall (t :: * -> *) a. Foldable t => t a -> Int
    length [BuiltinInfo]
    bcis) TCM ()
    forall a. HasCallStack => a
    __IMPOSSIBLE__  -- we already checked this
      (QName -> BuiltinInfo -> TCM ())
    -> [QName] -> [BuiltinInfo] -> TCM ()
    forall (m :: * -> *) a b c.
    Applicative m =>
    (a -> b -> m c) -> [a] -> [b] -> m ()
    zipWithM_ (\ QName
    c BuiltinInfo
    bci -> BuiltinInfo -> Expr -> TCM ()
    bindBuiltinInfo BuiltinInfo
    bci (AmbiguousQName -> Expr
    A.Con (AmbiguousQName -> Expr) -> AmbiguousQName -> Expr
    forall a b. (a -> b) -> a -> b
    $ QName -> AmbiguousQName
    unambiguous (QName -> AmbiguousQName) -> QName -> AmbiguousQName
    forall a b. (a -> b) -> a -> b
    $ Range -> QName -> QName
    forall a. SetRange a => Range -> a -> a
    setRange (QName -> Range
    forall a. HasRange a => a -> Range
    getRange QName
    name) QName
    c)) [QName]
    cs [BuiltinInfo]
    bcis

    bindBuiltinUnit :: Term -> TCM ()
    bindBuiltinUnit :: Term -> TCM ()
    bindBuiltinUnit Term
    t = do
      QName
    unit <- QName -> Maybe QName -> QName
    forall a. a -> Maybe a -> a
    fromMaybe QName
    forall a. HasCallStack => a
    __IMPOSSIBLE__ (Maybe QName -> QName) -> TCMT IO (Maybe QName) -> TCMT IO QName
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Term -> TCMT IO (Maybe QName)
    getDef Term
    t
      Defn
    def <- Definition -> Defn
    theDef (Definition -> Defn) -> TCMT IO Definition -> TCMT IO Defn
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> QName -> TCMT IO Definition
    forall (m :: * -> *). HasConstInfo m => QName -> m Definition
    getConstInfo QName
    unit
      case Defn
    def of
        Record { recFields :: Defn -> [Dom QName]
    recFields = [], recConHead :: Defn -> ConHead
    recConHead = ConHead
    con } -> do
          [Char] -> Term -> TCM ()
    bindBuiltinName [Char]
    builtinUnit Term
    t
          [Char] -> Term -> TCM ()
    bindBuiltinName [Char]
    builtinUnitUnit (ConHead -> ConInfo -> Elims -> Term
    Con ConHead
    con ConInfo
    ConOSystem [])
        Defn
    _ -> [Char] -> TCM ()
    forall (m :: * -> *) a.
    (HasCallStack, MonadTCError m) =>
    [Char] -> m a
    genericError [Char]
    "Builtin UNIT must be a singleton record type"

    bindBuiltinSigma :: Term -> TCM ()
    bindBuiltinSigma :: Term -> TCM ()
    bindBuiltinSigma Term
    t = do
      QName
    sigma <- QName -> Maybe QName -> QName
    forall a. a -> Maybe a -> a
    fromMaybe QName
    forall a. HasCallStack => a
    __IMPOSSIBLE__ (Maybe QName -> QName) -> TCMT IO (Maybe QName) -> TCMT IO QName
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Term -> TCMT IO (Maybe QName)
    getDef Term
    t
      Defn
    def <- Definition -> Defn
    theDef (Definition -> Defn) -> TCMT IO Definition -> TCMT IO Defn
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> QName -> TCMT IO Definition
    forall (m :: * -> *). HasConstInfo m => QName -> m Definition
    getConstInfo QName
    sigma
      case Defn
    def of
        Record { recFields :: Defn -> [Dom QName]
    recFields = [Dom QName
    fst,Dom QName
    snd], recConHead :: Defn -> ConHead
    recConHead = ConHead
    con } -> do
          [Char] -> Term -> TCM ()
    bindBuiltinName [Char]
    builtinSigma Term
    t
        Defn
    _ -> [Char] -> TCM ()
    forall (m :: * -> *) a.
    (HasCallStack, MonadTCError m) =>
    [Char] -> m a
    genericError [Char]
    "Builtin SIGMA must be a record type with two fields"

    -- | Bind BUILTIN EQUALITY and BUILTIN REFL.
    bindBuiltinEquality :: ResolvedName -> TCM ()
    bindBuiltinEquality :: ResolvedName -> TCM ()
    bindBuiltinEquality ResolvedName
    x = do
      (Term
    v, Type
    _t) <- Expr -> TCM (Term, Type)
    inferExpr (ResolvedName -> Expr
    forall a. NameToExpr a => a -> Expr
    A.nameToExpr ResolvedName
    x)

      -- Equality needs to be a data type with 1 constructor
      (QName
    eq, Definition
    def) <- [Char] -> Int -> Term -> TCM (QName, Definition)
    inductiveCheck [Char]
    builtinEquality Int
    1 Term
    v

      -- Check that the type is the type of a polymorphic relation, i.e.,
      -- Γ → (A : Set _) → A → A → Set _
      TelV Tele (Dom Type)
    eqTel Type
    eqCore <- Type -> TCMT IO (TelV Type)
    forall (m :: * -> *).
    (MonadReduce m, MonadAddContext m) =>
    Type -> m (TelV Type)
    telView (Type -> TCMT IO (TelV Type)) -> Type -> TCMT IO (TelV Type)
    forall a b. (a -> b) -> a -> b
    $ Definition -> Type
    defType Definition
    def
      let no :: TCMT IO a
    no = [Char] -> TCMT IO a
    forall (m :: * -> *) a.
    (HasCallStack, MonadTCError m) =>
    [Char] -> m a
    genericError [Char]
    "The type of BUILTIN EQUALITY must be a polymorphic relation"

      -- The target is a sort since eq is a data type.
      Bool -> TCM () -> TCM ()
    forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
    unless (Maybe Sort -> Bool
    forall a. Maybe a -> Bool
    isJust (Maybe Sort -> Bool) -> Maybe Sort -> Bool
    forall a b. (a -> b) -> a -> b
    $ Term -> Maybe Sort
    isSort (Term -> Maybe Sort) -> Term -> Maybe Sort
    forall a b. (a -> b) -> a -> b
    $ Type -> Term
    forall t a. Type'' t a -> a
    unEl Type
    eqCore) TCM ()
    forall a. HasCallStack => a
    __IMPOSSIBLE__

      -- The types of the last two arguments must be the third-last argument
      Bool -> TCM () -> TCM ()
    forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
    unless (Tele (Dom Type) -> Int
    forall a. Sized a => a -> Int
    size Tele (Dom Type)
    eqTel Int -> Int -> Bool
    forall a. Ord a => a -> a -> Bool
    >= Int
    3) TCM ()
    forall {a}. TCMT IO a
    no
      let (Dom ([Char], Type)
    a, Dom ([Char], Type)
    b) = (Dom ([Char], Type), Dom ([Char], Type))
    -> Maybe (Dom ([Char], Type), Dom ([Char], Type))
    -> (Dom ([Char], Type), Dom ([Char], Type))
    forall a. a -> Maybe a -> a
    fromMaybe (Dom ([Char], Type), Dom ([Char], Type))
    forall a. HasCallStack => a
    __IMPOSSIBLE__ (Maybe (Dom ([Char], Type), Dom ([Char], Type))
     -> (Dom ([Char], Type), Dom ([Char], Type)))
    -> Maybe (Dom ([Char], Type), Dom ([Char], Type))
    -> (Dom ([Char], Type), Dom ([Char], Type))
    forall a b. (a -> b) -> a -> b
    $ [Dom ([Char], Type)]
    -> Maybe (Dom ([Char], Type), Dom ([Char], Type))
    forall a. [a] -> Maybe (a, a)
    last2 ([Dom ([Char], Type)]
     -> Maybe (Dom ([Char], Type), Dom ([Char], Type)))
    -> [Dom ([Char], Type)]
    -> Maybe (Dom ([Char], Type), Dom ([Char], Type))
    forall a b. (a -> b) -> a -> b
    $ Tele (Dom Type) -> [Dom ([Char], Type)]
    forall t. Tele (Dom t) -> [Dom ([Char], t)]
    telToList Tele (Dom Type)
    eqTel
      [Term
    a,Term
    b] <- [Term] -> TCMT IO [Term]
    forall a (m :: * -> *). (Reduce a, MonadReduce m) => a -> m a
    reduce ([Term] -> TCMT IO [Term]) -> [Term] -> TCMT IO [Term]
    forall a b. (a -> b) -> a -> b
    $ (Dom ([Char], Type) -> Term) -> [Dom ([Char], Type)] -> [Term]
    forall a b. (a -> b) -> [a] -> [b]
    map (Type -> Term
    forall t a. Type'' t a -> a
    unEl (Type -> Term)
    -> (Dom ([Char], Type) -> Type) -> Dom ([Char], Type) -> Term
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ([Char], Type) -> Type
    forall a b. (a, b) -> b
    snd (([Char], Type) -> Type)
    -> (Dom ([Char], Type) -> ([Char], Type))
    -> Dom ([Char], Type)
    -> Type
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Dom ([Char], Type) -> ([Char], Type)
    forall t e. Dom' t e -> e
    unDom) [Dom ([Char], Type)
    a,Dom ([Char], Type)
    b]
      Bool -> TCM () -> TCM ()
    forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
    unless (Term -> Maybe Int
    forall a. DeBruijn a => a -> Maybe Int
    deBruijnView Term
    a Maybe Int -> Maybe Int -> Bool
    forall a. Eq a => a -> a -> Bool
    == Int -> Maybe Int
    forall a. a -> Maybe a
    Just Int
    0) TCM ()
    forall {a}. TCMT IO a
    no
      Bool -> TCM () -> TCM ()
    forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
    unless (Term -> Maybe Int
    forall a. DeBruijn a => a -> Maybe Int
    deBruijnView Term
    b Maybe Int -> Maybe Int -> Bool
    forall a. Eq a => a -> a -> Bool
    == Int -> Maybe Int
    forall a. a -> Maybe a
    Just Int
    1) TCM ()
    forall {a}. TCMT IO a
    no

      -- Get the single constructor.
      case Definition -> Defn
    theDef Definition
    def of
        Datatype { dataCons :: Defn -> [QName]
    dataCons = [QName
    c] } -> do
          [Char] -> Term -> TCM ()
    bindBuiltinName [Char]
    builtinEquality Term
    v

          -- Check type of REFL.  It has to be of the form
          -- pars → (x : A) → Eq ... x x

          -- Check the arguments
          Definition
    cdef <- QName -> TCMT IO Definition
    forall (m :: * -> *). HasConstInfo m => QName -> m Definition
    getConstInfo QName
    c
          TelV Tele (Dom Type)
    conTel Type
    conCore <- Type -> TCMT IO (TelV Type)
    forall (m :: * -> *).
    (MonadReduce m, MonadAddContext m) =>
    Type -> m (TelV Type)
    telView (Type -> TCMT IO (TelV Type)) -> Type -> TCMT IO (TelV Type)
    forall a b. (a -> b) -> a -> b
    $ Definition -> Type
    defType Definition
    cdef
          [Term]
    ts <- [Term] -> TCMT IO [Term]
    forall a (m :: * -> *). (Reduce a, MonadReduce m) => a -> m a
    reduce ([Term] -> TCMT IO [Term]) -> [Term] -> TCMT IO [Term]
    forall a b. (a -> b) -> a -> b
    $ (Dom ([Char], Type) -> Term) -> [Dom ([Char], Type)] -> [Term]
    forall a b. (a -> b) -> [a] -> [b]
    map (Type -> Term
    forall t a. Type'' t a -> a
    unEl (Type -> Term)
    -> (Dom ([Char], Type) -> Type) -> Dom ([Char], Type) -> Term
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ([Char], Type) -> Type
    forall a b. (a, b) -> b
    snd (([Char], Type) -> Type)
    -> (Dom ([Char], Type) -> ([Char], Type))
    -> Dom ([Char], Type)
    -> Type
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Dom ([Char], Type) -> ([Char], Type)
    forall t e. Dom' t e -> e
    unDom) ([Dom ([Char], Type)] -> [Term]) -> [Dom ([Char], Type)] -> [Term]
    forall a b. (a -> b) -> a -> b
    $ Int -> [Dom ([Char], Type)] -> [Dom ([Char], Type)]
    forall a. Int -> [a] -> [a]
    drop (Defn -> Int
    conPars (Defn -> Int) -> Defn -> Int
    forall a b. (a -> b) -> a -> b
    $ Definition -> Defn
    theDef Definition
    cdef) ([Dom ([Char], Type)] -> [Dom ([Char], Type)])
    -> [Dom ([Char], Type)] -> [Dom ([Char], Type)]
    forall a b. (a -> b) -> a -> b
    $ Tele (Dom Type) -> [Dom ([Char], Type)]
    forall t. Tele (Dom t) -> [Dom ([Char], t)]
    telToList Tele (Dom Type)
    conTel
          -- After dropping the parameters, there should be maximally one argument.
          Bool -> TCM () -> TCM ()
    forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
    unless ([Term] -> Int
    forall (t :: * -> *) a. Foldable t => t a -> Int
    length [Term]
    ts Int -> Int -> Bool
    forall a. Ord a => a -> a -> Bool
    <= Int
    1) TCM ()
    forall {a}. TCMT IO a
    wrongRefl
          Bool -> TCM () -> TCM ()
    forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
    unless ((Term -> Bool) -> [Term] -> Bool
    forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
    all ((Int -> Maybe Int
    forall a. a -> Maybe a
    Just Int
    0 Maybe Int -> Maybe Int -> Bool
    forall a. Eq a => a -> a -> Bool
    ==) (Maybe Int -> Bool) -> (Term -> Maybe Int) -> Term -> Bool
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Term -> Maybe Int
    forall a. DeBruijn a => a -> Maybe Int
    deBruijnView) [Term]
    ts) TCM ()
    forall {a}. TCMT IO a
    wrongRefl

          -- Check the target
          case Type -> Term
    forall t a. Type'' t a -> a
    unEl Type
    conCore of
            Def QName
    _ Elims
    es -> do
              let vs :: [Term]
    vs = (Arg Term -> Term) -> [Arg Term] -> [Term]
    forall a b. (a -> b) -> [a] -> [b]
    map Arg Term -> Term
    forall e. Arg e -> e
    unArg ([Arg Term] -> [Term]) -> [Arg Term] -> [Term]
    forall a b. (a -> b) -> a -> b
    $ [Arg Term] -> Maybe [Arg Term] -> [Arg Term]
    forall a. a -> Maybe a -> a
    fromMaybe [Arg Term]
    forall a. HasCallStack => a
    __IMPOSSIBLE__ (Maybe [Arg Term] -> [Arg Term]) -> Maybe [Arg Term] -> [Arg Term]
    forall a b. (a -> b) -> a -> b
    $ Elims -> Maybe [Arg Term]
    forall a. [Elim' a] -> Maybe [Arg a]
    allApplyElims Elims
    es
              (Term
    a,Term
    b) <- (Term, Term) -> TCMT IO (Term, Term)
    forall a (m :: * -> *). (Reduce a, MonadReduce m) => a -> m a
    reduce ((Term, Term) -> TCMT IO (Term, Term))
    -> (Term, Term) -> TCMT IO (Term, Term)
    forall a b. (a -> b) -> a -> b
    $ (Term, Term) -> Maybe (Term, Term) -> (Term, Term)
    forall a. a -> Maybe a -> a
    fromMaybe (Term, Term)
    forall a. HasCallStack => a
    __IMPOSSIBLE__ (Maybe (Term, Term) -> (Term, Term))
    -> Maybe (Term, Term) -> (Term, Term)
    forall a b. (a -> b) -> a -> b
    $ [Term] -> Maybe (Term, Term)
    forall a. [a] -> Maybe (a, a)
    last2 [Term]
    vs
              Bool -> TCM () -> TCM ()
    forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
    unless (Term -> Maybe Int
    forall a. DeBruijn a => a -> Maybe Int
    deBruijnView Term
    a Maybe Int -> Maybe Int -> Bool
    forall a. Eq a => a -> a -> Bool
    == Int -> Maybe Int
    forall a. a -> Maybe a
    Just Int
    0) TCM ()
    forall {a}. TCMT IO a
    wrongRefl
              Bool -> TCM () -> TCM ()
    forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
    unless (Term -> Maybe Int
    forall a. DeBruijn a => a -> Maybe Int
    deBruijnView Term
    b Maybe Int -> Maybe Int -> Bool
    forall a. Eq a => a -> a -> Bool
    == Int -> Maybe Int
    forall a. a -> Maybe a
    Just Int
    0) TCM ()
    forall {a}. TCMT IO a
    wrongRefl
              [Char] -> Term -> TCM ()
    bindBuiltinName [Char]
    builtinRefl (ConHead -> ConInfo -> Elims -> Term
    Con (QName -> DataOrRecord -> Induction -> [Arg QName] -> ConHead
    ConHead QName
    c DataOrRecord
    IsData Induction
    Inductive []) ConInfo
    ConOSystem [])
            Term
    _ -> TCM ()
    forall a. HasCallStack => a
    __IMPOSSIBLE__
        Defn
    _ -> [Char] -> TCM ()
    forall (m :: * -> *) a.
    (HasCallStack, MonadTCError m) =>
    [Char] -> m a
    genericError [Char]
    "Builtin EQUALITY must be a data type with a single constructor"
      where
      wrongRefl :: TCMT IO a
    wrongRefl = [Char] -> TCMT IO a
    forall (m :: * -> *) a.
    (HasCallStack, MonadTCError m) =>
    [Char] -> m a
    genericError [Char]
    "Wrong type of constructor of BUILTIN EQUALITY"

    bindBuiltinInfo :: BuiltinInfo -> A.Expr -> TCM ()
    bindBuiltinInfo :: BuiltinInfo -> Expr -> TCM ()
    bindBuiltinInfo (BuiltinInfo [Char]
    s BuiltinDescriptor
    d) Expr
    e = do
        case BuiltinDescriptor
    d of
          BuiltinData TCM Type
    t [[Char]]
    cs -> do
            Term
    v <- Expr -> Type -> TCMT IO Term
    checkExpr Expr
    e (Type -> TCMT IO Term) -> TCM Type -> TCMT IO Term
    forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
    =<< TCM Type
    t
            Bool -> TCM () -> TCM ()
    forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
    unless ([Char]
    s [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinUnit) (TCM () -> TCM ()) -> TCM () -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ do
              TCM (QName, Definition) -> TCM ()
    forall (f :: * -> *) a. Functor f => f a -> f ()
    void (TCM (QName, Definition) -> TCM ())
    -> TCM (QName, Definition) -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ [Char] -> Int -> Term -> TCM (QName, Definition)
    inductiveCheck [Char]
    s ([[Char]] -> Int
    forall (t :: * -> *) a. Foldable t => t a -> Int
    length [[Char]]
    cs) Term
    v
            if | [Char]
    s [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinEquality -> TCM ()
    forall a. HasCallStack => a
    __IMPOSSIBLE__ -- bindBuiltinEquality v
               | [Char]
    s [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinBool     -> Term -> TCM ()
    bindBuiltinBool     Term
    v
               | [Char]
    s [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinNat      -> Term -> TCM ()
    bindBuiltinNat      Term
    v
               | [Char]
    s [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinInteger  -> Term -> TCM ()
    bindBuiltinInt      Term
    v
               | [Char]
    s [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinUnit     -> Term -> TCM ()
    bindBuiltinUnit     Term
    v
               | [Char]
    s [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinSigma    -> Term -> TCM ()
    bindBuiltinSigma    Term
    v
               | [Char]
    s [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinList     -> [Char] -> Term -> TCM ()
    bindBuiltinData [Char]
    s   Term
    v
               | [Char]
    s [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinMaybe    -> [Char] -> Term -> TCM ()
    bindBuiltinData [Char]
    s   Term
    v
               | Bool
    otherwise            -> [Char] -> Term -> TCM ()
    bindBuiltinName [Char]
    s   Term
    v

          BuiltinDataCons TCM Type
    t -> do

            let name :: Term -> Term
    name (Lam ArgInfo
    h Abs Term
    b)  = Term -> Term
    name (Abs Term -> Term
    forall a. Subst a => Abs a -> a
    absBody Abs Term
    b)
                name (Con ConHead
    c ConInfo
    ci Elims
    _) = ConHead -> ConInfo -> Elims -> Term
    Con ConHead
    c ConInfo
    ci []
                name Term
    _          = Term
    forall a. HasCallStack => a
    __IMPOSSIBLE__

            Term
    v0 <- Expr -> Type -> TCMT IO Term
    checkExpr Expr
    e (Type -> TCMT IO Term) -> TCM Type -> TCMT IO Term
    forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
    =<< TCM Type
    t

            case Expr
    e of
              A.Con{} -> () -> TCM ()
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()
              Expr
    _       -> TypeError -> TCM ()
    forall (m :: * -> *) a.
    (HasCallStack, MonadTCError m) =>
    TypeError -> m a
    typeError (TypeError -> TCM ()) -> TypeError -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ [Char] -> Expr -> TypeError
    BuiltinMustBeConstructor [Char]
    s Expr
    e

            let v :: Term
    v@(Con ConHead
    h ConInfo
    _ []) = Term -> Term
    name Term
    v0

            [Char] -> Term -> TCM ()
    bindBuiltinName [Char]
    s Term
    v

            Bool -> TCM () -> TCM ()
    forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
    when ([Char]
    s [Char] -> [[Char]] -> Bool
    forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
    `elem` [[Char]
    builtinFalse, [Char]
    builtinTrue]) TCM ()
    checkBuiltinBool

          BuiltinPrim [Char]
    pfname Term -> TCM ()
    axioms -> do
            case Expr
    e of
              A.Def QName
    qx -> do

                PrimImpl Type
    t PrimFun
    pf <- [Char] -> TCM PrimitiveImpl
    lookupPrimitiveFunction [Char]
    pfname
                Term
    v <- Expr -> Type -> TCMT IO Term
    checkExpr Expr
    e Type
    t

                Term -> TCM ()
    axioms Term
    v

                Definition
    info <- QName -> TCMT IO Definition
    forall (m :: * -> *). HasConstInfo m => QName -> m Definition
    getConstInfo QName
    qx
                let cls :: [Clause]
    cls = Definition -> [Clause]
    defClauses Definition
    info
                    a :: IsAbstract
    a   = Definition -> IsAbstract
    defAbstract Definition
    info
                    mcc :: Maybe CompiledClauses
    mcc = Definition -> Maybe CompiledClauses
    defCompiled Definition
    info
                    inv :: FunctionInverse
    inv = Definition -> FunctionInverse
    defInverse Definition
    info
                [Char] -> PrimFun -> TCM ()
    bindPrimitive [Char]
    pfname (PrimFun -> TCM ()) -> PrimFun -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ PrimFun
    pf { primFunName :: QName
    primFunName = QName
    qx }
                QName -> Definition -> TCM ()
    addConstant QName
    qx (Definition -> TCM ()) -> Definition -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ Definition
    info { theDef :: Defn
    theDef = Primitive :: IsAbstract
    -> [Char]
    -> [Clause]
    -> FunctionInverse
    -> Maybe CompiledClauses
    -> Defn
    Primitive { primAbstr :: IsAbstract
    primAbstr    = IsAbstract
    a
                                                           , primName :: [Char]
    primName     = [Char]
    pfname
                                                           , primClauses :: [Clause]
    primClauses  = [Clause]
    cls
                                                           , primInv :: FunctionInverse
    primInv      = FunctionInverse
    inv
                                                           , primCompiled :: Maybe CompiledClauses
    primCompiled = Maybe CompiledClauses
    mcc } }

                -- needed? yes, for checking equations for mul
                [Char] -> Term -> TCM ()
    bindBuiltinName [Char]
    s Term
    v

              Expr
    _ -> TypeError -> TCM ()
    forall (m :: * -> *) a.
    (HasCallStack, MonadTCError m) =>
    TypeError -> m a
    typeError (TypeError -> TCM ()) -> TypeError -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ [Char] -> TypeError
    GenericError ([Char] -> TypeError) -> [Char] -> TypeError
    forall a b. (a -> b) -> a -> b
    $ [Char]
    "Builtin " [Char] -> [Char] -> [Char]
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    s [Char] -> [Char] -> [Char]
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " must be bound to a function"

          BuiltinSort{} -> TCM ()
    forall a. HasCallStack => a
    __IMPOSSIBLE__ -- always a "BuiltinNoDef"

          BuiltinPostulate Relevance
    rel TCM Type
    t -> do
            Type
    t' <- TCM Type
    t
            Term
    v <- Relevance -> TCMT IO Term -> TCMT IO Term
    forall (tcm :: * -> *) r a.
    (MonadTCEnv tcm, LensRelevance r) =>
    r -> tcm a -> tcm a
    applyRelevanceToContext Relevance
    rel (TCMT IO Term -> TCMT IO Term) -> TCMT IO Term -> TCMT IO Term
    forall a b. (a -> b) -> a -> b
    $ Expr -> Type -> TCMT IO Term
    checkExpr Expr
    e Type
    t'
            let err :: TCM ()
    err = TypeError -> TCM ()
    forall (m :: * -> *) a.
    (HasCallStack, MonadTCError m) =>
    TypeError -> m a
    typeError (TypeError -> TCM ()) -> TypeError -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ [Char] -> TypeError
    GenericError ([Char] -> TypeError) -> [Char] -> TypeError
    forall a b. (a -> b) -> a -> b
    $
                        [Char]
    "The argument to BUILTIN " [Char] -> [Char] -> [Char]
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    s [Char] -> [Char] -> [Char]
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " must be a postulated name"
            case Expr
    e of
              A.Def QName
    q -> do
                Definition
    def <- QName -> TCMT IO Definition
    forall (m :: * -> *). HasConstInfo m => QName -> m Definition
    getConstInfo QName
    q
                case Definition -> Defn
    theDef Definition
    def of
                  Axiom {} -> do
                    [Char] -> QName -> Type -> TCM ()
    builtinSizeHook [Char]
    s QName
    q Type
    t'
                    -- And compilation pragmas for base types
                    Bool -> TCM () -> TCM ()
    forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
    when ([Char]
    s [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinLevel)  (TCM () -> TCM ()) -> TCM () -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ QName -> TCM ()
    setConstTranspAxiom QName
    q TCM () -> TCM () -> TCM ()
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> QName -> [Char] -> TCM ()
    addHaskellPragma QName
    q [Char]
    "= type ()"
                    Bool -> TCM () -> TCM ()
    forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
    when ([Char]
    s [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinChar)   (TCM () -> TCM ()) -> TCM () -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ QName -> TCM ()
    setConstTranspAxiom QName
    q TCM () -> TCM () -> TCM ()
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> QName -> [Char] -> TCM ()
    addHaskellPragma QName
    q [Char]
    "= type Char"
                    Bool -> TCM () -> TCM ()
    forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
    when ([Char]
    s [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinString) (TCM () -> TCM ()) -> TCM () -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ QName -> TCM ()
    setConstTranspAxiom QName
    q TCM () -> TCM () -> TCM ()
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> QName -> [Char] -> TCM ()
    addHaskellPragma QName
    q [Char]
    "= type Data.Text.Text"
                    Bool -> TCM () -> TCM ()
    forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
    when ([Char]
    s [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinFloat)  (TCM () -> TCM ()) -> TCM () -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ QName -> TCM ()
    setConstTranspAxiom QName
    q TCM () -> TCM () -> TCM ()
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> QName -> [Char] -> TCM ()
    addHaskellPragma QName
    q [Char]
    "= type Double"
                    Bool -> TCM () -> TCM ()
    forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
    when ([Char]
    s [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinWord64) (TCM () -> TCM ()) -> TCM () -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ QName -> TCM ()
    setConstTranspAxiom QName
    q TCM () -> TCM () -> TCM ()
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> QName -> [Char] -> TCM ()
    addHaskellPragma QName
    q [Char]
    "= type MAlonzo.RTE.Word64"
                    Bool -> TCM () -> TCM ()
    forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
    when ([Char]
    s [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinPathP)  (TCM () -> TCM ()) -> TCM () -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ QName -> TCM ()
    builtinPathPHook QName
    q
                    [Char] -> Term -> TCM ()
    bindBuiltinName [Char]
    s Term
    v
                  Defn
    _        -> TCM ()
    err
              Expr
    _ -> TCM ()
    err

          BuiltinUnknown Maybe (TCM Type)
    mt Term -> Type -> TCM ()
    f -> do
            (Term
    v, Type
    t) <- Maybe (TCM Type)
    -> TCM (Term, Type)
    -> (TCM Type -> TCM (Term, Type))
    -> TCM (Term, Type)
    forall a b. Maybe a -> b -> (a -> b) -> b
    caseMaybe Maybe (TCM Type)
    mt (Expr -> TCM (Term, Type)
    inferExpr Expr
    e) ((TCM Type -> TCM (Term, Type)) -> TCM (Term, Type))
    -> (TCM Type -> TCM (Term, Type)) -> TCM (Term, Type)
    forall a b. (a -> b) -> a -> b
    $ \ TCM Type
    tcmt -> do
              Type
    t <- TCM Type
    tcmt
              (,Type
    t) (Term -> (Term, Type)) -> TCMT IO Term -> TCM (Term, Type)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Expr -> Type -> TCMT IO Term
    checkExpr Expr
    e Type
    t
            Term -> Type -> TCM ()
    f Term
    v Type
    t
            [Char] -> Term -> TCM ()
    bindBuiltinName [Char]
    s Term
    v

    setConstTranspAxiom :: QName -> TCM ()
    setConstTranspAxiom :: QName -> TCM ()
    setConstTranspAxiom QName
    q =
      (Signature -> Signature) -> TCM ()
    forall (m :: * -> *).
    MonadTCState m =>
    (Signature -> Signature) -> m ()
    modifySignature ((Signature -> Signature) -> TCM ())
    -> (Signature -> Signature) -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ QName -> (Definition -> Definition) -> Signature -> Signature
    updateDefinition QName
    q ((Definition -> Definition) -> Signature -> Signature)
    -> (Definition -> Definition) -> Signature -> Signature
    forall a b. (a -> b) -> a -> b
    $ (Defn -> Defn) -> Definition -> Definition
    updateTheDef (Defn -> Defn -> Defn
    forall a b. a -> b -> a
    const (Defn -> Defn -> Defn) -> Defn -> Defn -> Defn
    forall a b. (a -> b) -> a -> b
    $ Defn
    constTranspAxiom)

    builtinPathPHook :: QName -> TCM ()
    builtinPathPHook :: QName -> TCM ()
    builtinPathPHook QName
    q =
          (Signature -> Signature) -> TCM ()
    forall (m :: * -> *).
    MonadTCState m =>
    (Signature -> Signature) -> m ()
    modifySignature ((Signature -> Signature) -> TCM ())
    -> (Signature -> Signature) -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ QName -> (Definition -> Definition) -> Signature -> Signature
    updateDefinition QName
    q
          ((Definition -> Definition) -> Signature -> Signature)
    -> (Definition -> Definition) -> Signature -> Signature
    forall a b. (a -> b) -> a -> b
    $ ([Polarity] -> [Polarity]) -> Definition -> Definition
    updateDefPolarity       [Polarity] -> [Polarity]
    forall a. a -> a
    id
          (Definition -> Definition)
    -> (Definition -> Definition) -> Definition -> Definition
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ([Occurrence] -> [Occurrence]) -> Definition -> Definition
    updateDefArgOccurrences ([Occurrence] -> [Occurrence] -> [Occurrence]
    forall a b. a -> b -> a
    const [Occurrence
    Unused,Occurrence
    StrictPos,Occurrence
    Mixed,Occurrence
    Mixed])

    -- | Bind a builtin thing to an expression.
    bindBuiltin :: String -> ResolvedName -> TCM ()
    bindBuiltin :: [Char] -> ResolvedName -> TCM ()
    bindBuiltin [Char]
    b ResolvedName
    x = do
      TCMT IO Bool -> TCM () -> TCM ()
    forall (m :: * -> *). Monad m => m Bool -> m () -> m ()
    unlessM ((Int
    0 Int -> Int -> Bool
    forall a. Eq a => a -> a -> Bool
    ==) (Int -> Bool) -> TCMT IO Int -> TCMT IO Bool
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> TCMT IO Int
    forall (m :: * -> *). (Applicative m, MonadTCEnv m) => m Int
    getContextSize) (TCM () -> TCM ()) -> TCM () -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ do
        -- Andreas, 2017-11-01, issue #2824
        -- Only raise an error if the name for the builtin is defined in a parametrized module.
        let
          failure :: forall m a. MonadTCError m => m a
          failure :: forall (m :: * -> *) a. MonadTCError m => m a
    failure = TypeError -> m a
    forall (m :: * -> *) a.
    (HasCallStack, MonadTCError m) =>
    TypeError -> m a
    typeError (TypeError -> m a) -> TypeError -> m a
    forall a b. (a -> b) -> a -> b
    $ [Char] -> TypeError
    BuiltinInParameterisedModule [Char]
    b
        -- Get the non-empty list of AbstractName for x
        NonEmpty AbstractName
    xs <- case ResolvedName
    x of
          VarName{}            -> TCMT IO (NonEmpty AbstractName)
    forall (m :: * -> *) a. MonadTCError m => m a
    failure
          DefinedName Access
    _ AbstractName
    x Suffix
    NoSuffix -> NonEmpty AbstractName -> TCMT IO (NonEmpty AbstractName)
    forall (m :: * -> *) a. Monad m => a -> m a
    return (NonEmpty AbstractName -> TCMT IO (NonEmpty AbstractName))
    -> NonEmpty AbstractName -> TCMT IO (NonEmpty AbstractName)
    forall a b. (a -> b) -> a -> b
    $ AbstractName
    x AbstractName -> [AbstractName] -> NonEmpty AbstractName
    forall a. a -> [a] -> NonEmpty a
    :| []
          DefinedName Access
    _ AbstractName
    x Suffix{} -> TCMT IO (NonEmpty AbstractName)
    forall (m :: * -> *) a. MonadTCError m => m a
    failure
          FieldName NonEmpty AbstractName
    xs         -> NonEmpty AbstractName -> TCMT IO (NonEmpty AbstractName)
    forall (m :: * -> *) a. Monad m => a -> m a
    return NonEmpty AbstractName
    xs
          ConstructorName Set Induction
    _ NonEmpty AbstractName
    xs -> NonEmpty AbstractName -> TCMT IO (NonEmpty AbstractName)
    forall (m :: * -> *) a. Monad m => a -> m a
    return NonEmpty AbstractName
    xs
          PatternSynResName NonEmpty AbstractName
    xs -> TCMT IO (NonEmpty AbstractName)
    forall (m :: * -> *) a. MonadTCError m => m a
    failure
          ResolvedName
    UnknownName          -> TCMT IO (NonEmpty AbstractName)
    forall (m :: * -> *) a. MonadTCError m => m a
    failure
        -- For ambiguous names, we check all of their definitions:
        TCMT IO Bool -> TCM () -> TCM ()
    forall (m :: * -> *). Monad m => m Bool -> m () -> m ()
    unlessM (NonEmpty AbstractName
    -> (AbstractName -> TCMT IO Bool) -> TCMT IO Bool
    forall (f :: * -> *) (m :: * -> *) a.
    (Functor f, Foldable f, Monad m) =>
    f a -> (a -> m Bool) -> m Bool
    allM NonEmpty AbstractName
    xs ((AbstractName -> TCMT IO Bool) -> TCMT IO Bool)
    -> (AbstractName -> TCMT IO Bool) -> TCMT IO Bool
    forall a b. (a -> b) -> a -> b
    $ ((Int
    0 Int -> Int -> Bool
    forall a. Eq a => a -> a -> Bool
    ==) (Int -> Bool)
    -> (Tele (Dom Type) -> Int) -> Tele (Dom Type) -> Bool
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Tele (Dom Type) -> Int
    forall a. Sized a => a -> Int
    size) (Tele (Dom Type) -> Bool)
    -> (AbstractName -> TCMT IO (Tele (Dom Type)))
    -> AbstractName
    -> TCMT IO Bool
    forall (m :: * -> *) b c a.
    Functor m =>
    (b -> c) -> (a -> m b) -> a -> m c
    <.> ModuleName -> TCMT IO (Tele (Dom Type))
    forall (m :: * -> *).
    (Functor m, ReadTCState m) =>
    ModuleName -> m (Tele (Dom Type))
    lookupSection (ModuleName -> TCMT IO (Tele (Dom Type)))
    -> (AbstractName -> ModuleName)
    -> AbstractName
    -> TCMT IO (Tele (Dom Type))
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . QName -> ModuleName
    qnameModule (QName -> ModuleName)
    -> (AbstractName -> QName) -> AbstractName -> ModuleName
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . AbstractName -> QName
    anameName) (TCM () -> TCM ()) -> TCM () -> TCM ()
    forall a b. (a -> b) -> a -> b
    $
          TCM ()
    forall (m :: * -> *) a. MonadTCError m => m a
    failure
      -- Since the name was define in a parameter-free context, we can switch to the empty context.
      -- (And we should!)
      TCM () -> TCM ()
    forall (tcm :: * -> *) a.
    (MonadTCEnv tcm, ReadTCState tcm) =>
    tcm a -> tcm a
    inTopContext (TCM () -> TCM ()) -> TCM () -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ do
      if | [Char]
    b [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinRefl  -> Warning -> TCM ()
    forall (m :: * -> *).
    (HasCallStack, MonadWarning m) =>
    Warning -> m ()
    warning (Warning -> TCM ()) -> Warning -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ [Char] -> [Char] -> Warning
    OldBuiltin [Char]
    b [Char]
    builtinEquality
         | [Char]
    b [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinZero  -> [Char] -> [Char] -> TCM ()
    forall {m :: * -> *}. MonadWarning m => [Char] -> [Char] -> m ()
    now [Char]
    builtinNat [Char]
    b
         | [Char]
    b [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinSuc   -> [Char] -> [Char] -> TCM ()
    forall {m :: * -> *}. MonadWarning m => [Char] -> [Char] -> m ()
    now [Char]
    builtinNat [Char]
    b
         | [Char]
    b [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinNil   -> [Char] -> [Char] -> TCM ()
    forall {m :: * -> *}. MonadWarning m => [Char] -> [Char] -> m ()
    now [Char]
    builtinList [Char]
    b
         | [Char]
    b [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinCons  -> [Char] -> [Char] -> TCM ()
    forall {m :: * -> *}. MonadWarning m => [Char] -> [Char] -> m ()
    now [Char]
    builtinList [Char]
    b
         | [Char]
    b [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinInf   -> ResolvedName -> TCM ()
    bindBuiltinInf ResolvedName
    x
         | [Char]
    b [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinSharp -> ResolvedName -> TCM ()
    bindBuiltinSharp ResolvedName
    x
         | [Char]
    b [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinFlat  -> ResolvedName -> TCM ()
    bindBuiltinFlat ResolvedName
    x
         | [Char]
    b [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinEquality -> ResolvedName -> TCM ()
    bindBuiltinEquality ResolvedName
    x
         | Just BuiltinInfo
    i <- [Char] -> Maybe BuiltinInfo
    findBuiltinInfo [Char]
    b -> BuiltinInfo -> Expr -> TCM ()
    bindBuiltinInfo BuiltinInfo
    i (ResolvedName -> Expr
    forall a. NameToExpr a => a -> Expr
    A.nameToExpr ResolvedName
    x)
         | Bool
    otherwise -> TypeError -> TCM ()
    forall (m :: * -> *) a.
    (HasCallStack, MonadTCError m) =>
    TypeError -> m a
    typeError (TypeError -> TCM ()) -> TypeError -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ [Char] -> TypeError
    NoSuchBuiltinName [Char]
    b
      where
        now :: [Char] -> [Char] -> m ()
    now [Char]
    new [Char]
    b = Warning -> m ()
    forall (m :: * -> *).
    (HasCallStack, MonadWarning m) =>
    Warning -> m ()
    warning (Warning -> m ()) -> Warning -> m ()
    forall a b. (a -> b) -> a -> b
    $ [Char] -> [Char] -> Warning
    OldBuiltin [Char]
    b [Char]
    new

    isUntypedBuiltin :: String -> Bool
    isUntypedBuiltin :: [Char] -> Bool
    isUntypedBuiltin = [[Char]] -> [Char] -> Bool
    forall a. Ord a => [a] -> a -> Bool
    hasElem [ [Char]
    builtinFromNat, [Char]
    builtinFromNeg, [Char]
    builtinFromString ]

    bindUntypedBuiltin :: String -> ResolvedName -> TCM ()
    bindUntypedBuiltin :: [Char] -> ResolvedName -> TCM ()
    bindUntypedBuiltin [Char]
    b = \case
      DefinedName Access
    _ AbstractName
    x Suffix
    NoSuffix -> AbstractName -> TCM ()
    bind AbstractName
    x
      DefinedName Access
    _ AbstractName
    x Suffix{} -> TCM ()
    wrong
      FieldName (AbstractName
    x :| [])  -> AbstractName -> TCM ()
    bind AbstractName
    x
      FieldName (AbstractName
    x :| [AbstractName]
    _)   -> AbstractName -> TCM ()
    forall {m :: * -> *} {a} {b}.
    (MonadError TCErr m, PrettyTCM a, PureTCM m,
     MonadInteractionPoints m, MonadFresh NameId m,
     MonadStConcreteNames m, IsString (m Doc), Null (m Doc),
     Semigroup (m Doc)) =>
    a -> m b
    amb AbstractName
    x
      VarName Name
    _x BindingSource
    _bnd      -> TCM ()
    wrong
      ResolvedName
    UnknownName          -> TCM ()
    wrong
      ConstructorName Set Induction
    _ NonEmpty AbstractName
    xs -> NonEmpty AbstractName -> TCM ()
    err NonEmpty AbstractName
    xs
      PatternSynResName NonEmpty AbstractName
    xs -> NonEmpty AbstractName -> TCM ()
    err NonEmpty AbstractName
    xs
      where
      bind :: AbstractName -> TCM ()
    bind AbstractName
    x = [Char] -> Term -> TCM ()
    bindBuiltinName [Char]
    b (QName -> Elims -> Term
    Def (AbstractName -> QName
    anameName AbstractName
    x) [])
      wrong :: TCM ()
    wrong  = [Char] -> TCM ()
    forall (m :: * -> *) a.
    (HasCallStack, MonadTCError m) =>
    [Char] -> m a
    genericError ([Char] -> TCM ()) -> [Char] -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ [Char]
    "The argument to BUILTIN " [Char] -> [Char] -> [Char]
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    b [Char] -> [Char] -> [Char]
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " must be a defined name"
      amb :: a -> m b
    amb a
    x  = Doc -> m b
    forall (m :: * -> *) a.
    (HasCallStack, MonadTCError m) =>
    Doc -> m a
    genericDocError (Doc -> m b) -> m Doc -> m b
    forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
    =<< do [Char] -> m Doc
    forall (m :: * -> *). Applicative m => [Char] -> m Doc
    text [Char]
    "Name " m Doc -> m Doc -> m Doc
    forall (m :: * -> *). Applicative m => m Doc -> m Doc -> m Doc
    <+> a -> m Doc
    forall a (m :: * -> *). (PrettyTCM a, MonadPretty m) => a -> m Doc
    prettyTCM a
    x m Doc -> m Doc -> m Doc
    forall (m :: * -> *). Applicative m => m Doc -> m Doc -> m Doc
    <+> [Char] -> m Doc
    forall (m :: * -> *). Applicative m => [Char] -> m Doc
    text [Char]
    " is ambiguous"
      err :: NonEmpty AbstractName -> TCM ()
    err (AbstractName
    x :| [AbstractName]
    xs1)
        | [AbstractName] -> Bool
    forall a. Null a => a -> Bool
    null [AbstractName]
    xs1  = TCM ()
    wrong
        | Bool
    otherwise = AbstractName -> TCM ()
    forall {m :: * -> *} {a} {b}.
    (MonadError TCErr m, PrettyTCM a, PureTCM m,
     MonadInteractionPoints m, MonadFresh NameId m,
     MonadStConcreteNames m, IsString (m Doc), Null (m Doc),
     Semigroup (m Doc)) =>
    a -> m b
    amb AbstractName
    x

    -- | Bind a builtin thing to a new name.
    --
    -- Since their type is closed, it does not matter whether we are in a
    -- parameterized module when we declare them.
    -- We simply ignore the parameters.
    bindBuiltinNoDef :: String -> A.QName -> TCM ()
    bindBuiltinNoDef :: [Char] -> QName -> TCM ()
    bindBuiltinNoDef [Char]
    b QName
    q = TCM () -> TCM ()
    forall (tcm :: * -> *) a.
    (MonadTCEnv tcm, ReadTCState tcm) =>
    tcm a -> tcm a
    inTopContext (TCM () -> TCM ()) -> TCM () -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ do
      Bool -> TCM () -> TCM ()
    forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
    when ([Char]
    b [Char] -> [[Char]] -> Bool
    forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
    `elem` [[Char]]
    sizeBuiltins) (TCM () -> TCM ()) -> TCM () -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ TCMT IO Bool -> TCM () -> TCM ()
    forall (m :: * -> *). Monad m => m Bool -> m () -> m ()
    unlessM TCMT IO Bool
    forall (m :: * -> *). HasOptions m => m Bool
    sizedTypesOption (TCM () -> TCM ()) -> TCM () -> TCM ()
    forall a b. (a -> b) -> a -> b
    $
        [Char] -> TCM ()
    forall (m :: * -> *) a.
    (HasCallStack, MonadTCError m) =>
    [Char] -> m a
    genericError ([Char] -> TCM ()) -> [Char] -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ [Char]
    "Cannot declare size BUILTIN " [Char] -> [Char] -> [Char]
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    b [Char] -> [Char] -> [Char]
    forall a. [a] -> [a] -> [a]
    ++ [Char]
    " with option --no-sized-types"
      case BuiltinInfo -> BuiltinDescriptor
    builtinDesc (BuiltinInfo -> BuiltinDescriptor)
    -> Maybe BuiltinInfo -> Maybe BuiltinDescriptor
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> [Char] -> Maybe BuiltinInfo
    findBuiltinInfo [Char]
    b of

        Just (BuiltinPostulate Relevance
    rel TCM Type
    mt) -> do
          -- We start by adding the corresponding postulate
          Type
    t <- TCM Type
    mt
          QName -> ArgInfo -> QName -> Type -> Defn -> TCM ()
    addConstant' QName
    q (Relevance -> ArgInfo -> ArgInfo
    forall a. LensRelevance a => Relevance -> a -> a
    setRelevance Relevance
    rel ArgInfo
    defaultArgInfo) QName
    q Type
    t Defn
    def
          -- And we then *modify* the definition based on our needs:
          -- We add polarity information for SIZE-related definitions
          [Char] -> QName -> Type -> TCM ()
    builtinSizeHook [Char]
    b QName
    q Type
    t
          -- Finally, bind the BUILTIN in the environment.
          [Char] -> Term -> TCM ()
    bindBuiltinName [Char]
    b (Term -> TCM ()) -> Term -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ QName -> Elims -> Term
    Def QName
    q []
          where
            -- Andreas, 2015-02-14
            -- Special treatment of SizeUniv, should maybe be a primitive.
            def :: Defn
    def | [Char]
    b [Char] -> [Char] -> Bool
    forall a. Eq a => a -> a -> Bool
    == [Char]
    builtinSizeUniv = Defn
    emptyFunction
                    { funClauses :: [Clause]
    funClauses = [ (Clause
    forall a. Null a => a
    empty :: Clause) { clauseBody :: Maybe Term
    clauseBody = Term -> Maybe Term
    forall a. a -> Maybe a
    Just (Term -> Maybe Term) -> Term -> Maybe Term
    forall a b. (a -> b) -> a -> b
    $ Sort -> Term
    Sort Sort
    sSizeUniv } ]
                    , funCompiled :: Maybe CompiledClauses
    funCompiled = CompiledClauses -> Maybe CompiledClauses
    forall a. a -> Maybe a
    Just ([Arg [Char]] -> Term -> CompiledClauses
    forall a. [Arg [Char]] -> a -> CompiledClauses' a
    CC.Done [] (Term -> CompiledClauses) -> Term -> CompiledClauses
    forall a b. (a -> b) -> a -> b
    $ Sort -> Term
    Sort Sort
    sSizeUniv)
                    , funMutual :: Maybe [QName]
    funMutual    = [QName] -> Maybe [QName]
    forall a. a -> Maybe a
    Just []
                    , funTerminates :: Maybe Bool
    funTerminates = Bool -> Maybe Bool
    forall a. a -> Maybe a
    Just Bool
    True
                    }
                | Bool
    otherwise = Defn
    defaultAxiom

        Just (BuiltinPrim [Char]
    name Term -> TCM ()
    axioms) -> do
          PrimImpl Type
    t PrimFun
    pf <- [Char] -> TCM PrimitiveImpl
    lookupPrimitiveFunction [Char]
    name
          [Char] -> PrimFun -> TCM ()
    bindPrimitive [Char]
    name (PrimFun -> TCM ()) -> PrimFun -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ PrimFun
    pf { primFunName :: QName
    primFunName = QName
    q }
          let v :: Term
    v   = QName -> Elims -> Term
    Def QName
    q []
              def :: Defn
    def = Primitive :: IsAbstract
    -> [Char]
    -> [Clause]
    -> FunctionInverse
    -> Maybe CompiledClauses
    -> Defn
    Primitive { primAbstr :: IsAbstract
    primAbstr    = IsAbstract
    ConcreteDef
                              , primName :: [Char]
    primName     = [Char]
    name
                              , primClauses :: [Clause]
    primClauses  = []
                              , primInv :: FunctionInverse
    primInv      = FunctionInverse
    forall c. FunctionInverse' c
    NotInjective
                              , primCompiled :: Maybe CompiledClauses
    primCompiled = CompiledClauses -> Maybe CompiledClauses
    forall a. a -> Maybe a
    Just ([Arg [Char]] -> Term -> CompiledClauses
    forall a. [Arg [Char]] -> a -> CompiledClauses' a
    CC.Done [] (Term -> CompiledClauses) -> Term -> CompiledClauses
    forall a b. (a -> b) -> a -> b
    $ QName -> Elims -> Term
    Def QName
    q [])
                              }
          QName -> ArgInfo -> QName -> Type -> Defn -> TCM ()
    addConstant' QName
    q ArgInfo
    defaultArgInfo QName
    q Type
    t Defn
    def
          Term -> TCM ()
    axioms Term
    v
          [Char] -> Term -> TCM ()
    bindBuiltinName [Char]
    b Term
    v

        Just (BuiltinDataCons TCM Type
    mt) -> do
          Type
    t <- TCM Type
    mt
          QName
    d <- QName -> TCMT IO QName
    forall (m :: * -> *) a. Monad m => a -> m a
    return (QName -> TCMT IO QName) -> QName -> TCMT IO QName
    forall a b. (a -> b) -> a -> b
    $! Term -> QName
    getPrimName (Term -> QName) -> Term -> QName
    forall a b. (a -> b) -> a -> b
    $ Type -> Term
    forall t a. Type'' t a -> a
    unEl Type
    t
          let
            ch :: ConHead
    ch = QName -> DataOrRecord -> Induction -> [Arg QName] -> ConHead
    ConHead QName
    q DataOrRecord
    IsData Induction
    Inductive []
            def :: Defn
    def = Constructor :: Int
    -> Int
    -> ConHead
    -> QName
    -> IsAbstract
    -> Induction
    -> CompKit
    -> Maybe [QName]
    -> [IsForced]
    -> Maybe [Bool]
    -> Defn
    Constructor
                  { conPars :: Int
    conPars   = Int
    0   -- Andrea TODO: fix zeros
                  , conArity :: Int
    conArity  = Int
    0
                  , conSrcCon :: ConHead
    conSrcCon = ConHead
    ch
                  , conData :: QName
    conData   = QName
    d
                  , conAbstr :: IsAbstract
    conAbstr  = IsAbstract
    ConcreteDef
                  , conInd :: Induction
    conInd    = Induction
    Inductive
                  , conComp :: CompKit
    conComp   = CompKit
    emptyCompKit
                  , conProj :: Maybe [QName]
    conProj   = Maybe [QName]
    forall a. Maybe a
    Nothing
                  , conForced :: [IsForced]
    conForced = []
                  , conErased :: Maybe [Bool]
    conErased = Maybe [Bool]
    forall a. Maybe a
    Nothing
                  }
          QName -> ArgInfo -> QName -> Type -> Defn -> TCM ()
    addConstant' QName
    q ArgInfo
    defaultArgInfo QName
    q Type
    t Defn
    def
          QName -> [QName] -> TCM ()
    addDataCons QName
    d [QName
    q]
          [Char] -> Term -> TCM ()
    bindBuiltinName [Char]
    b (Term -> TCM ()) -> Term -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ ConHead -> ConInfo -> Elims -> Term
    Con ConHead
    ch ConInfo
    ConOSystem []

        Just (BuiltinData TCM Type
    mt [[Char]]
    cs) -> do
          Type
    t <- TCM Type
    mt
          QName -> ArgInfo -> QName -> Type -> Defn -> TCM ()
    addConstant' QName
    q ArgInfo
    defaultArgInfo QName
    q Type
    t (Type -> Defn
    forall {a}. LensSort a => a -> Defn
    def Type
    t)
          [Char] -> Term -> TCM ()
    bindBuiltinName [Char]
    b (Term -> TCM ()) -> Term -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ QName -> Elims -> Term
    Def QName
    q []
          where
            def :: a -> Defn
    def a
    t = Datatype :: Int
    -> Int
    -> Maybe Clause
    -> [QName]
    -> Sort
    -> Maybe [QName]
    -> IsAbstract
    -> [QName]
    -> Defn
    Datatype
                  { dataPars :: Int
    dataPars       = Int
    0
                  , dataIxs :: Int
    dataIxs        = Int
    0
                  , dataClause :: Maybe Clause
    dataClause     = Maybe Clause
    forall a. Maybe a
    Nothing
                  , dataCons :: [QName]
    dataCons       = []     -- Constructors are added later
                  , dataSort :: Sort
    dataSort       = a -> Sort
    forall a. LensSort a => a -> Sort
    getSort a
    t
                  , dataAbstr :: IsAbstract
    dataAbstr      = IsAbstract
    ConcreteDef
                  , dataMutual :: Maybe [QName]
    dataMutual     = Maybe [QName]
    forall a. Maybe a
    Nothing
                  , dataPathCons :: [QName]
    dataPathCons   = []
                  }

        Just (BuiltinSort [Char]
    sortname) -> do
          let s :: Sort
    s = case [Char]
    sortname of
                    [Char]
    "primSet"      -> Integer -> Sort
    mkType Integer
    0
                    [Char]
    "primProp"     -> Integer -> Sort
    mkProp Integer
    0
                    [Char]
    "primStrictSet" -> Integer -> Sort
    mkSSet Integer
    0
                    [Char]
    "primSetOmega" -> IsFibrant -> Integer -> Sort
    forall t. IsFibrant -> Integer -> Sort' t
    Inf IsFibrant
    IsFibrant Integer
    0
                    [Char]
    "primStrictSetOmega" -> IsFibrant -> Integer -> Sort
    forall t. IsFibrant -> Integer -> Sort' t
    Inf IsFibrant
    IsStrict Integer
    0
                    [Char]
    _              -> Sort
    forall a. HasCallStack => a
    __IMPOSSIBLE__
              def :: Defn
    def = [Char] -> Sort -> Defn
    PrimitiveSort [Char]
    sortname Sort
    s
          QName -> ArgInfo -> QName -> Type -> Defn -> TCM ()
    addConstant' QName
    q ArgInfo
    defaultArgInfo QName
    q (Sort -> Type
    sort (Sort -> Type) -> Sort -> Type
    forall a b. (a -> b) -> a -> b
    $ Sort -> Sort
    univSort Sort
    s) Defn
    def
          [Char] -> Term -> TCM ()
    bindBuiltinName [Char]
    b (Term -> TCM ()) -> Term -> TCM ()
    forall a b. (a -> b) -> a -> b
    $ QName -> Elims -> Term
    Def QName
    q []

        Just{}  -> TCM ()
    forall a. HasCallStack => a
    __IMPOSSIBLE__
        Maybe BuiltinDescriptor
    Nothing -> TCM ()
    forall a. HasCallStack => a
    __IMPOSSIBLE__ -- typeError $ NoSuchBuiltinName b

    builtinKindOfName :: String -> Maybe KindOfName
    builtinKindOfName :: [Char] -> Maybe KindOfName
    builtinKindOfName = BuiltinInfo -> KindOfName
    distinguish (BuiltinInfo -> KindOfName)
    -> ([Char] -> Maybe BuiltinInfo) -> [Char] -> Maybe KindOfName
    forall (m :: * -> *) b c a.
    Functor m =>
    (b -> c) -> (a -> m b) -> a -> m c
    <.> [Char] -> Maybe BuiltinInfo
    findBuiltinInfo
      where
      distinguish :: BuiltinInfo -> KindOfName
    distinguish BuiltinInfo
    d = case BuiltinInfo -> BuiltinDescriptor
    builtinDesc BuiltinInfo
    d of
        BuiltinDataCons{}  -> KindOfName
    ConName
        BuiltinData{}      -> KindOfName
    DataName       -- Andreas, 2020-04-13: Crude.  Could be @RecName@.
        BuiltinPrim{}      -> KindOfName
    PrimName
        BuiltinPostulate{} -> KindOfName
    AxiomName
        BuiltinSort{}      -> KindOfName
    PrimName
        BuiltinUnknown{}   -> KindOfName
    OtherDefName