Agda-2.5.3: A dependently typed functional programming language and proof assistant

Safe HaskellNone
LanguageHaskell2010

Agda.Auto.Syntax

Synopsis

Documentation

type UId o = Metavar (Exp o) (RefInfo o) Source #

Unique identifiers for variable occurrences in unification.

data HintMode Source #

Constructors

HMNormal 
HMRecCall 

data RefInfo o Source #

The concrete instance of the blk parameter in Metavar. I.e., the information passed to the search control.

Constructors

RIEnv 

Fields

RIMainInfo 

Fields

  • riMainCxtLength :: Nat

    Size of typing context in which meta was created.

  • riMainType :: HNExp o

    Head normal form of type of meta.

  • riMainIota :: Bool

    True if iota steps performed when normalising target type (used to put cost when traversing a definition by construction instantiation).

RIUnifInfo [CAction o] (HNExp o) 
RICopyInfo (ICExp o) 
RIIotaStep Bool 
RIInferredTypeUnknown 
RINotConstructor 
RIUsedVars [UId o] [Elr o] 
RIPickSubsvar 
RIEqRState EqReasoningState 
RICheckElim Bool 
RICheckProjIndex [ConstRef o] 

Instances

Conversion TOM Clause (Maybe ([Pat O], MExp O)) Source # 

Methods

convert :: Clause -> TOM (Maybe ([Pat O], MExp O)) Source #

Conversion TOM Type (MExp O) Source # 

Methods

convert :: Type -> TOM (MExp O) Source #

Conversion TOM Term (MExp O) Source # 

Methods

convert :: Term -> TOM (MExp O) Source #

Conversion TOM Args (MM (ArgList O) (RefInfo O)) Source # 

Methods

convert :: Args -> TOM (MM (ArgList O) (RefInfo O)) Source #

Replace o (Exp o) (MExp o) Source # 

Methods

replace' :: Nat -> MExp o -> Exp o -> Reader (Nat, Nat) (MExp o) Source #

Conversion TOM [Clause] [([Pat O], MExp O)] Source # 

Methods

convert :: [Clause] -> TOM [([Pat O], MExp O)] Source #

Unify o t => Unify o (MM t (RefInfo o)) Source # 

Methods

unify' :: MM t (RefInfo o) -> MM t (RefInfo o) -> StateT (Assignments o) Maybe () Source #

notequal' :: MM t (RefInfo o) -> MM t (RefInfo o) -> ReaderT * (Nat, Nat) (StateT (Assignments o) IO) Bool Source #

Replace o t u => Replace o (MM t (RefInfo o)) u Source # 

Methods

replace' :: Nat -> MExp o -> MM t (RefInfo o) -> Reader (Nat, Nat) u Source #

Conversion MOT a b => Conversion MOT (MM a (RefInfo O)) b Source # 

Methods

convert :: MM a (RefInfo O) -> MOT b Source #

LocalTerminationEnv (MArgList o) Source # 
LocalTerminationEnv (MExp o) Source # 

Methods

sizeAndBoundVars :: MExp o -> (Sum Nat, [Nat]) Source #

type MyPB o = PB (RefInfo o) Source #

type MyMB a o = MB a (RefInfo o) Source #

type Nat = Int Source #

data MId Source #

Constructors

Id String 
NoId 

data Abs a Source #

Abstraction with maybe a name.

Different from Agda, where there is also info whether function is constant.

Constructors

Abs MId a 

Instances

Unify o t => Unify o (Abs t) Source # 

Methods

unify' :: Abs t -> Abs t -> StateT (Assignments o) Maybe () Source #

notequal' :: Abs t -> Abs t -> ReaderT * (Nat, Nat) (StateT (Assignments o) IO) Bool Source #

Replace o t u => Replace o (Abs t) (Abs u) Source # 

Methods

replace' :: Nat -> MExp o -> Abs t -> Reader (Nat, Nat) (Abs u) Source #

Conversion MOT a b => Conversion MOT (Abs a) (Abs b) Source # 

Methods

convert :: Abs a -> MOT (Abs b) Source #

Renaming t => Renaming (Abs t) Source # 

Methods

renameOffset :: Nat -> (Nat -> Nat) -> Abs t -> Abs t Source #

FreeVars t => FreeVars (Abs t) Source # 

Methods

freeVarsOffset :: Nat -> Abs t -> Set Nat Source #

ExpandMetas t => ExpandMetas (Abs t) Source # 

Methods

expandMetas :: Abs t -> IO (Abs t) Source #

MetaliseOKH t => MetaliseOKH (Abs t) Source # 

Methods

metaliseOKH :: Abs t -> IO (Abs t) Source #

Lift t => Lift (Abs t) Source # 

Methods

lift' :: Nat -> Nat -> Abs t -> Abs t Source #

data ConstDef o Source #

Constant signatures.

Constructors

ConstDef 

Fields

data DeclCont o Source #

Constant definitions.

type Clause o = ([Pat o], MExp o) Source #

data Pat o Source #

Constructors

PatConApp (ConstRef o) [Pat o] 
PatVar String 
PatExp

Dot pattern.

Instances

data Elr o Source #

Head of application (elimination).

Constructors

Var Nat 
Const (ConstRef o) 

Instances

Eq (Elr o) Source # 

Methods

(==) :: Elr o -> Elr o -> Bool #

(/=) :: Elr o -> Elr o -> Bool #

Renaming (Elr o) Source # 

Methods

renameOffset :: Nat -> (Nat -> Nat) -> Elr o -> Elr o Source #

FreeVars (Elr o) Source # 

Methods

freeVarsOffset :: Nat -> Elr o -> Set Nat Source #

Weakening (Elr o) Source # 

Methods

weak' :: Nat -> Elr o -> Elr o Source #

data Sort Source #

Constructors

Set Nat 
UnknownSort 
Type 

data Exp o Source #

Agsy's internal syntax.

Constructors

App 

Fields

Lam Hiding (Abs (MExp o))

Lambda with hiding information.

Pi (Maybe (UId o)) Hiding Bool (MExp o) (Abs (MExp o))

True if possibly dependent (var not known to not occur). False if non-dependent.

Sort Sort 
AbsurdLambda Hiding

Absurd lambda with hiding information.

Instances

Conversion TOM Clause (Maybe ([Pat O], MExp O)) Source # 

Methods

convert :: Clause -> TOM (Maybe ([Pat O], MExp O)) Source #

Conversion TOM Type (MExp O) Source # 

Methods

convert :: Type -> TOM (MExp O) Source #

Conversion TOM Term (MExp O) Source # 

Methods

convert :: Term -> TOM (MExp O) Source #

Unify o (Exp o) Source # 

Methods

unify' :: Exp o -> Exp o -> StateT (Assignments o) Maybe () Source #

notequal' :: Exp o -> Exp o -> ReaderT * (Nat, Nat) (StateT (Assignments o) IO) Bool Source #

Conversion MOT (Exp O) Type Source # 

Methods

convert :: Exp O -> MOT Type Source #

Conversion MOT (Exp O) Term Source # 

Methods

convert :: Exp O -> MOT Term Source #

Replace o (Exp o) (MExp o) Source # 

Methods

replace' :: Nat -> MExp o -> Exp o -> Reader (Nat, Nat) (MExp o) Source #

Conversion TOM [Clause] [([Pat O], MExp O)] Source # 

Methods

convert :: [Clause] -> TOM [([Pat O], MExp O)] Source #

Renaming (Exp o) Source # 

Methods

renameOffset :: Nat -> (Nat -> Nat) -> Exp o -> Exp o Source #

FreeVars (Exp o) Source # 

Methods

freeVarsOffset :: Nat -> Exp o -> Set Nat Source #

ExpandMetas (Exp o) Source # 

Methods

expandMetas :: Exp o -> IO (Exp o) Source #

MetaliseOKH (Exp o) Source # 

Methods

metaliseOKH :: Exp o -> IO (Exp o) Source #

LocalTerminationEnv (MExp o) Source # 

Methods

sizeAndBoundVars :: MExp o -> (Sum Nat, [Nat]) Source #

Lift (Exp o) Source # 

Methods

lift' :: Nat -> Nat -> Exp o -> Exp o Source #

type MExp o = MM (Exp o) (RefInfo o) Source #

"Maybe expression": Expression or reference to meta variable.

data ArgList o Source #

Constructors

ALNil

No more eliminations.

ALCons Hiding (MExp o) (MArgList o)

Application and tail.

ALProj (MArgList o) (MM (ConstRef o) (RefInfo o)) Hiding (MArgList o)

proj pre args, projfcn idx, tail

ALConPar (MArgList o)

Constructor parameter (missing in Agda). Agsy has monomorphic constructors. Inserted to cover glitch of polymorphic constructor applications coming from Agda

type MArgList o = MM (ArgList o) (RefInfo o) Source #

data WithSeenUIds a o Source #

Constructors

WithSeenUIds 

Fields

data HNExp' o Source #

Constructors

HNApp (Elr o) (ICArgList o) 
HNLam Hiding (Abs (ICExp o)) 
HNPi Hiding Bool (ICExp o) (Abs (ICExp o)) 
HNSort Sort 

data HNArgList o Source #

Head-normal form of ICArgList. First entry is exposed.

Q: Why are there no projection eliminations?

data ICArgList o Source #

Lazy concatenation of argument lists under explicit substitutions.

Constructors

CALNil 
CALConcat (Clos (MArgList o) o) (ICArgList o) 

Instances

type ICExp o = Clos (MExp o) o Source #

An expression a in an explicit substitution [CAction a].

data Clos a o Source #

Constructors

Clos [CAction o] a 

Instances

Weakening (Clos a o) Source # 

Methods

weak' :: Nat -> Clos a o -> Clos a o Source #

type CExp o = TrBr (ICExp o) o Source #

data TrBr a o Source #

Constructors

TrBr [MExp o] a 

Instances

Weakening a => Weakening (TrBr a o) Source # 

Methods

weak' :: Nat -> TrBr a o -> TrBr a o Source #

data CAction o Source #

Entry of an explicit substitution.

An explicit substitution is a list of CActions. This is isomorphic to the usual presentation where Skip and Weak would be constructors of exp. substs.

Constructors

Sub (ICExp o)

Instantation of variable.

Skip

For going under a binder, often called Lift.

Weak Nat

Shifting substitution (going to a larger context).

type Ctx o = [(MId, CExp o)] Source #

type EE = IO Source #

class MetaliseOKH t where Source #

Minimal complete definition

metaliseOKH

Methods

metaliseOKH :: t -> IO t Source #

Instances

MetaliseOKH (ArgList o) Source # 

Methods

metaliseOKH :: ArgList o -> IO (ArgList o) Source #

MetaliseOKH (Exp o) Source # 

Methods

metaliseOKH :: Exp o -> IO (Exp o) Source #

MetaliseOKH t => MetaliseOKH (Abs t) Source # 

Methods

metaliseOKH :: Abs t -> IO (Abs t) Source #

MetaliseOKH t => MetaliseOKH (MM t a) Source # 

Methods

metaliseOKH :: MM t a -> IO (MM t a) Source #

class ExpandMetas t where Source #

Minimal complete definition

expandMetas

Methods

expandMetas :: t -> IO t Source #

Instances

ExpandMetas (ArgList o) Source # 

Methods

expandMetas :: ArgList o -> IO (ArgList o) Source #

ExpandMetas (Exp o) Source # 

Methods

expandMetas :: Exp o -> IO (Exp o) Source #

ExpandMetas t => ExpandMetas (Abs t) Source # 

Methods

expandMetas :: Abs t -> IO (Abs t) Source #

ExpandMetas t => ExpandMetas (MM t a) Source # 

Methods

expandMetas :: MM t a -> IO (MM t a) Source #

sub :: MExp o -> CExp o -> CExp o Source #

subi :: MExp o -> ICExp o -> ICExp o Source #

weak :: Weakening t => Nat -> t -> t Source #

class Weakening t where Source #

Minimal complete definition

weak'

Methods

weak' :: Nat -> t -> t Source #

Instances

Weakening (ICArgList o) Source # 

Methods

weak' :: Nat -> ICArgList o -> ICArgList o Source #

Weakening (Elr o) Source # 

Methods

weak' :: Nat -> Elr o -> Elr o Source #

Weakening a => Weakening (TrBr a o) Source # 

Methods

weak' :: Nat -> TrBr a o -> TrBr a o Source #

Weakening (Clos a o) Source # 

Methods

weak' :: Nat -> Clos a o -> Clos a o Source #

doclos :: [CAction o] -> Nat -> Either Nat (ICExp o) Source #

Substituting for a variable.

freeVars :: FreeVars t => t -> Set Nat Source #

FreeVars class and instances

class FreeVars t where Source #

Minimal complete definition

freeVarsOffset

Methods

freeVarsOffset :: Nat -> t -> Set Nat Source #

Instances

FreeVars (ArgList o) Source # 
FreeVars (Exp o) Source # 

Methods

freeVarsOffset :: Nat -> Exp o -> Set Nat Source #

FreeVars (Elr o) Source # 

Methods

freeVarsOffset :: Nat -> Elr o -> Set Nat Source #

FreeVars t => FreeVars (Abs t) Source # 

Methods

freeVarsOffset :: Nat -> Abs t -> Set Nat Source #

(FreeVars a, FreeVars b) => FreeVars (a, b) Source # 

Methods

freeVarsOffset :: Nat -> (a, b) -> Set Nat Source #

FreeVars t => FreeVars (MM t a) Source # 

Methods

freeVarsOffset :: Nat -> MM t a -> Set Nat Source #

rename :: Renaming t => (Nat -> Nat) -> t -> t Source #

Renaming Typeclass and instances

class Renaming t where Source #

Minimal complete definition

renameOffset

Methods

renameOffset :: Nat -> (Nat -> Nat) -> t -> t Source #

Instances

Renaming (ArgList o) Source # 

Methods

renameOffset :: Nat -> (Nat -> Nat) -> ArgList o -> ArgList o Source #

Renaming (Exp o) Source # 

Methods

renameOffset :: Nat -> (Nat -> Nat) -> Exp o -> Exp o Source #

Renaming (Elr o) Source # 

Methods

renameOffset :: Nat -> (Nat -> Nat) -> Elr o -> Elr o Source #

Renaming t => Renaming (Abs t) Source # 

Methods

renameOffset :: Nat -> (Nat -> Nat) -> Abs t -> Abs t Source #

Renaming (CSPatI o) Source # 

Methods

renameOffset :: Nat -> (Nat -> Nat) -> CSPatI o -> CSPatI o Source #

Renaming t => Renaming (HI t) Source # 

Methods

renameOffset :: Nat -> (Nat -> Nat) -> HI t -> HI t Source #

(Renaming a, Renaming b) => Renaming (a, b) Source # 

Methods

renameOffset :: Nat -> (Nat -> Nat) -> (a, b) -> (a, b) Source #

Renaming t => Renaming (MM t a) Source # 

Methods

renameOffset :: Nat -> (Nat -> Nat) -> MM t a -> MM t a Source #