comparison sandbox/modus-ponens.agda @ 77:a2e6f61d5f2b default tip

Add modus-ponens
author atton <atton@cr.ie.u-ryukyu.ac.jp>
date Thu, 09 Feb 2017 06:32:03 +0000
parents
children
comparison
equal deleted inserted replaced
76:29a3a4b79d4d 77:a2e6f61d5f2b
1 module modus-ponens where
2
3 data _×_ (A B : Set) : Set where
4 <_,_> : A -> B -> A × B
5
6 fst : {A B : Set} -> A × B -> A
7 fst < a , _ > = a
8
9 snd : {A B : Set} -> A × B -> B
10 snd < _ , b > = b
11
12 f : {A B C : Set} -> (A -> B) × (B -> C) -> (A -> C)
13 f = (\p x -> snd p ((fst p) x))