%%% Constructive Logic (15-317), Fall 2009 %%% Assignment 9: Proving Metatheorems in Twelf %% Atoms, including some sample ones for examples atom : type. %name atom P. a : atom. b : atom. c : atom. d : atom. e : atom. f : atom. %% Propositions prop : type. %name prop A. \/ : prop -> prop -> prop. %infix right 12 \/. ~ : prop -> prop. %prefix 13 ~. ? : atom -> prop. %prefix 14 ?. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% TODO (Task 2): define => %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % (uncomment to get fixity, once you've defined => above. -wjl) % %infix right 10 =>. %% Classical Sequent Calculus contra : type. true : prop -> type. false : prop -> type. init : true (? P) -> false (? P) -> contra. \/R : (false A -> false B -> contra) -> (false (A \/ B) -> contra). \/L : (true A -> contra) -> (true B -> contra) -> (true (A \/ B) -> contra). ~R : (true A -> contra) -> (false (~ A) -> contra). ~L : (false A -> contra) -> (true (~ A) -> contra). %% Derived rules %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% TODO (Task 2): define =>R, =>L %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Identity Theorem identity : {A:prop} (true A -> false A -> contra) -> type. %mode identity +A -D. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% TODO (Task 3): fill in cases %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %worlds () (identity _ _). %total A (identity A _).