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
|
# Inductives
|
||||||
|
|
||||||
* Add support for them in type checking, conversion, etc
|
* 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
|
, Tests
|
||||||
, Parsing.Parse
|
, Parsing.Parse
|
||||||
, Parsing.Lex
|
, Parsing.Lex
|
||||||
|
, Inductive
|
||||||
|
, Inductive.Check
|
||||||
|
|
||||||
options = "-p contrib --warnpartial"
|
options = "-p contrib --warnpartial"
|
||||||
|
|
||||||
|
|
|
@ -3,15 +3,13 @@ module Inductive
|
||||||
import Data.Vect
|
import Data.Vect
|
||||||
|
|
||||||
import Term
|
import Term
|
||||||
|
import Misc
|
||||||
|
|
||||||
{-
|
{-
|
||||||
The type of a constructor, indexed like terms
|
The type of a constructor, indexed like terms
|
||||||
-}
|
-}
|
||||||
public export
|
Constructor : (ctx : Index) -> (tags : Vect n Nat) -> Type
|
||||||
data Constructor : (ctx : Index) -> (tags : Vect n Nat) -> Type where
|
Constructor = Term ctx tags
|
||||||
Tr : Term n v -> Constructor n v -- a term
|
|
||||||
Sum : Constructor n v -> Constructor (S n) v -> Constructor n v -- Σ _ : #0 , #1
|
|
||||||
|
|
||||||
|
|
||||||
{-
|
{-
|
||||||
The type of an inductive definition. It is a vector of constructors.
|
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
|
public export
|
||||||
Inductive : Nat -> Index -> Vect n Nat -> Type
|
Inductive : Nat -> Index -> Vect n Nat -> Type
|
||||||
Inductive cons ctx tags = Vect cons (Constructor ctx (cons :: tags))
|
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