Files
agdaproofs/Computability/LambdaCalculus/ChurchNumeral.agda
2021-11-07 09:48:57 +00:00

25 lines
693 B
Agda
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Lists.Lists
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import Decidable.Sets
open import Numbers.Naturals.Definition
open import Numbers.Naturals.Semiring
module Computability.LambdaCalculus.ChurchNumeral where
open import UnorderedSet.Definition DecideEquality
open import Computability.LambdaCalculus.Definition
private
iter : Term
iter zero = var 0
iter (succ n) = apply (var 1) (iter n)
church : Term
church n = lam 1 (lam 0 (iter n))
churchSucc : Term
churchSucc = lam 0 (lam 1 (lam 2 (apply (var 1) (apply (apply (var 0) (var 1)) (var 2)))))