Created
February 12, 2018 09:16
-
-
Save mgttlinger/a369e41c15174c32e511c2de4b3a6be7 to your computer and use it in GitHub Desktop.
Full polyadic in Idris
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Polyadic | |
import Data.Vect | |
parameters (o : Nat -> Type) | |
mutual | |
data MT : Nat -> Type where | |
Pf : novar f = true -> MT 0 | |
Iota1 : MT 1 | |
Iota2 : MT 2 | |
Falsum : MT 0 | |
Basic : o n -> MT n | |
App : MT n -> (args : Vect n (m ** MT m)) -> MT (foldr (\el, accu => (fst el) + accu) 0 args) | |
data MF : Type where | |
FNeg : MF -> MF | |
FDia : MT n -> Vect n MF -> MF | |
FProp : Nat -> MF | |
FNom : Nat -> MF | |
novar : MF -> Bool | |
novar (FNeg f) = novar f | |
novar (FProp _) = False | |
novar (FNom _) = False | |
novar (FDia _ args) = all novar args |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment