pisigma-0.2.1: A dependently typed core language

Language.PiSigma.Syntax

Synopsis

Documentation

type Bind a = (Name, a)Source

The use of Bind indicates the scope of the bound identifier.

newtype Boxed Source

Constructors

Boxed (Clos Term) 

Instances

type Clos a = (a, Scope)Source

class Closure a whereSource

Methods

getScope :: a -> ScopeSource

putScope :: a -> Scope -> aSource

Instances

data Entry Source

Constructors

Decl Loc Name Type 
Defn Loc Name Term 

Instances

class Enum a

Class Enum defines operations on sequentially ordered types.

The enumFrom... methods are used in Haskell's translation of arithmetic sequences.

Instances of Enum may be derived for any enumeration type (types whose constructors have no fields). The nullary constructors are assumed to be numbered left-to-right by fromEnum from 0 through n-1. See Chapter 10 of the Haskell Report for more details.

For any type that is an instance of class Bounded as well as Enum, the following should hold:

    enumFrom     x   = enumFromTo     x maxBound
    enumFromThen x y = enumFromThenTo x y bound
      where
        bound | fromEnum y >= fromEnum x = maxBound
              | otherwise                = minBound

class Env e whereSource

Methods

emptyE :: eSource

extE :: e -> PrtInfo -> (Id, e)Source

setE :: e -> Id -> EnvEntry -> eSource

getE :: e -> Id -> EnvEntrySource

prtE :: e -> Id -> PrtInfoSource

Instances

data EnvEntry Source

Constructors

Id Id 
Closure (Clos Term) 

class GetLoc a whereSource

Methods

getLoc :: a -> LocSource

Instances

type Id = IntSource

data Loc Source

Constructors

Unknown 
Loc 

Fields

filename :: !String
 
line :: !Int
 
column :: !Int
 

Instances

Eq Loc

Locations are always equal. This allows us to derive equality for the abstract syntax that ignores the locations.

Show Loc 

data Ne Source

Neutral terms.

Instances

Eq Ne 
Show Ne 
Print Ne 
Equal Ne 
Nf Ne Term 

data Phrase Source

Constructors

Prog Prog 
Term Term 

Instances

data PiSigma Source

For treating quantifiers in a uniform way.

Constructors

Pi 
Sigma 

Instances

type Prog = [Entry]Source

data PrtInfo Source

Constructors

PrtInfo 

Fields

name :: Name
 
expand :: Bool
 

Instances

newtype Scope Source

Constructors

Scope [(Name, (Id, Maybe (Clos Type)))] 

Instances

Eq Scope 
Show Scope 
Closure (Clos a) 
GetLoc a => GetLoc (Clos a) 
Print (Clos Term) 
Equal (Clos Term) 
Nf (Clos Term) Term 

(-*-) :: Type -> Type -> TypeSource

Smart constructor for product.

(->-) :: Type -> Type -> TypeSource

Smart constructor for function space.

lam :: [(Loc, Name)] -> Term -> TermSource

Smart constructor for lambda abstractions.

pis :: [(Loc, Name)] -> Type -> Type -> TypeSource

Smart constructor for multiple Pi applications.

sigmas :: [(Loc, Name)] -> Type -> Type -> TypeSource

Smart constructor for multiple Sigma applications.

split :: Loc -> Term -> (Name, Name) -> Term -> TermSource

Smart constructor for split.