2014-12-01 05:16:01 +00:00
|
|
|
prelude constant N : Type.{1}
|
2014-06-15 17:40:18 +00:00
|
|
|
definition B : Type.{1} := Type.{0}
|
2014-10-02 23:20:52 +00:00
|
|
|
constant ite : B → N → N → N
|
|
|
|
constant and : B → B → B
|
|
|
|
constant f : N → N
|
|
|
|
constant p : B
|
|
|
|
constant q : B
|
|
|
|
constant x : N
|
|
|
|
constant y : N
|
|
|
|
constant z : N
|
2015-09-30 23:52:56 +00:00
|
|
|
infixr ` ∧ `:25 := and
|
2014-10-21 01:40:55 +00:00
|
|
|
notation `if` c `then` t:45 `else` e:45 := ite c t e
|
2014-06-15 17:40:18 +00:00
|
|
|
check if p ∧ q then f x else y
|
|
|
|
check if p ∧ q then q else y
|
2014-10-02 23:20:52 +00:00
|
|
|
constant list : Type.{1}
|
|
|
|
constant nil : list
|
|
|
|
constant cons : N → list → list
|
2014-06-15 17:40:18 +00:00
|
|
|
-- Non empty lists
|
2015-09-30 23:52:56 +00:00
|
|
|
notation `[` l:(foldr `, ` (h t, cons h t) nil) `]` := l
|
2014-06-15 17:40:18 +00:00
|
|
|
check [x, y, z, x, y, y]
|
|
|
|
check [x]
|
|
|
|
notation `[` `]` := nil
|
|
|
|
check []
|