inductive type constructor is just a term

Rachel Lambda Samuelsson 2022-07-20 18:17:02 +02:00
parent bd8cb07309
commit b98643fbc5
4 changed files with 17 additions and 6 deletions

View File

@ -1,3 +1,8 @@
# Inductives
* Add support for them in type checking, conversion, etc
* Positivity check, etc
# Generally
* Create a syntax and parser

View File

@ -9,6 +9,8 @@ modules = Term
, Tests
, Parsing.Parse
, Parsing.Lex
, Inductive
, Inductive.Check
options = "-p contrib --warnpartial"

View File

@ -3,15 +3,13 @@ module Inductive
import Data.Vect
import Term
import Misc
{-
The type of a constructor, indexed like terms
-}
public export
data Constructor : (ctx : Index) -> (tags : Vect n Nat) -> Type where
Tr : Term n v -> Constructor n v -- a term
Sum : Constructor n v -> Constructor (S n) v -> Constructor n v -- Σ _ : #0 , #1
Constructor : (ctx : Index) -> (tags : Vect n Nat) -> Type
Constructor = Term ctx tags
{-
The type of an inductive definition. It is a vector of constructors.
@ -20,4 +18,3 @@ data Constructor : (ctx : Index) -> (tags : Vect n Nat) -> Type where
public export
Inductive : Nat -> Index -> Vect n Nat -> Type
Inductive cons ctx tags = Vect cons (Constructor ctx (cons :: tags))

View File

@ -0,0 +1,7 @@
module Inductive.Check
import Inductive
import Term
import Value
import Convert
import Check