inductive type constructor is just a term
This commit is contained in:
parent
bd8cb07309
commit
b98643fbc5
5
TODO.md
5
TODO.md
|
@ -1,3 +1,8 @@
|
|||
# Inductives
|
||||
|
||||
* Add support for them in type checking, conversion, etc
|
||||
* Positivity check, etc
|
||||
|
||||
# Generally
|
||||
|
||||
* Create a syntax and parser
|
||||
|
|
2
pi.ipkg
2
pi.ipkg
|
@ -9,6 +9,8 @@ modules = Term
|
|||
, Tests
|
||||
, Parsing.Parse
|
||||
, Parsing.Lex
|
||||
, Inductive
|
||||
, Inductive.Check
|
||||
|
||||
options = "-p contrib --warnpartial"
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
||||
|
|
7
src/Inductive/Check.idr
Normal file
7
src/Inductive/Check.idr
Normal file
|
@ -0,0 +1,7 @@
|
|||
module Inductive.Check
|
||||
|
||||
import Inductive
|
||||
import Term
|
||||
import Value
|
||||
import Convert
|
||||
import Check
|
Loading…
Reference in New Issue
Block a user