-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_stlc.elpi
61 lines (51 loc) · 1.71 KB
/
test_stlc.elpi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
accumulate itp.
accumulate stlc/theory.
main T S :-
test_pair T [
then (intro x) (
then (intro y) (
then andI (
then (maptac andI [1, 2]) (
then branch (
then (mapp x) (
then shift (
then shift (
then shift (
then unbranch (
then branch (
then (mapp x) (
then unbranch ((maptac (mapp y) [1, 2])
)))))))))))))] S.
test_itp PTerm InScript OutScript :-
prove (arr (arr a (arr b c)) (arr a (arr b c))) InScript PTerm OutScript.
test_itp PTerm OutScript :-
prove (arr (arr a (arr b c)) (arr a (arr b c))) PTerm OutScript.
test_pair PTerm InScript OutScript :-
prove (arr a (arr b (prod (prod a b) (prod b a)))) InScript PTerm OutScript.
test_pair PTerm OutScript :-
prove (arr a (arr b (prod (prod a b) (prod b a)))) PTerm OutScript.
% (A -> (B -> C)) -> ((A & B) -> C)
% and elim test
% [intro x, intro y, app, andER y, app x, andEL y]
interactive_pairElim :- interactive_pairElim [].
interactive_pairElim InScript :-
of X (arr (arr a (arr b c)) (arr (prod a b) c)) X',
run_itp X InScript.
% (A & B -> C) -> (A -> B -> C)
% and intro test
% [intro x, intro y, intro z, app z, andI y x]
interactive_pairIntro :- interactive_pairIntro [].
interactive_pairIntro InScript :-
of X (arr (arr (prod a b) c) (arr a (arr b c))) X',
run_itp X InScript.
% (A v B) -> (A -> C) -> (B -> C) -> C
% case test
% [intro x, intro y, intro z, orE x u v, app y u, app z v]
interactive_case :- interactive_case [].
interactive_case InScript :-
of X (arr (sum a b) (arr (arr a c) (arr (arr b c) c))) X',
run_itp X InScript.
% suml test
interactive_suml :-
of X (arr a (sum a b)) X',
run_itp X InScript.