-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathappendix-rules.tex
More file actions
153 lines (147 loc) · 4.29 KB
/
Copy pathappendix-rules.tex
File metadata and controls
153 lines (147 loc) · 4.29 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
\section{Standard Rules}\label{sec:standard_rules}
This appendix collects the standard meta-functions and rules of the
filtered stepper calculus (substitution, decomposition, and
composition) deferred from \autoref{sec:filter}. The syntax of
evaluation contexts and the value judgment are given in
\autoref{fig:filter-syntax} and the accompanying rules in the main
body.
\fbox{\([v / x] e = e'\)} \(e'\) can be obtained by substitution of \(v\) for
\(x\) in expression \(e\).
\[
\begin{aligned}
[v / x] \Nat{n} &= \Nat{n} \\
[v / x] x &= v \\
[v / x] y &= y && \text{if } x \neq y \\
[v / x] (e_1(e_2)) &= ([v / x] e_1)([v / x] e_2) \\
[v / x] (e_1 + e_2) &= ([v / x] e_1) + ([v / x] e_2) \\
[v / x] \Lam{y}{e} &= \Lam{y}{[v / x] e} && \text{if } x \neq y \\
[v / x] \Lam{y}{e} &= \Lam{y}{e} && \text{if } x = y \\
[v / x] \Filter{(p, a, g)}{e} &= \Filter{([v / x]p, a, g)}{[v / x] e} \\
[v / x] \Residue{a}{g}{l}{e} &= \Residue{a}{g}{l}{[v / x] e} \\
[v / x] \Fix{x}{e} &= \Fix{x}{e} \\
[v / x] \Fix{y}{e} &= \Fix{y}{[v / x]e} && \text{if } x \neq y
\end{aligned}
\]
\fbox{\([v / x] p = p'\)} \(p'\) can be obtained by substitution of \(v\) for
\(x\) in pattern \(p\).
\[
\begin{aligned}
[v / x] \$e &= \$e \\
[v / x] \$v &= \$v \\
[v / x] \Nat{n} &= \Nat{n} \\
[v / x] y &= y && \text{if } x \neq y \\
[v / x] (p_1(p_2)) &= ([v / x] p_1)([v / x] p_2) \\
[v / x] (p_1 + p_2) &= ([v / x] p_1) + ([v / x] p_2) \\
[v / x] \Lam{y}{e} &= \Lam{y}{[v / x] e} && \text{if } x \neq y \\
[v / x] \Lam{y}{e} &= \Lam{y}{e} && \text{if } x = y \\
[v / x] \Fix{x}{e} &= \Fix{x}{e} \\
[v / x] \Fix{y}{e} &= \Fix{y}{[v / x]e} && \text{if } x \neq y
\end{aligned}
\]
\jbox{\(\Decompose{e}{\mathcal{E}}{e'}\)} Expression \(e\) can be decomposed into context \(\mathcal{E}\) and redex \(e'\).
\begin{mathpar}
% Residue
\inferrule[D-Residue-T]{
\Decompose{e}{\mathcal{E}}{e'}
}{
\Decompose{\Residue{a}{g}{l}{e}}{\Residue{a}{g}{l}{{\mathcal{E}}}}{e'}
} \qquad
\inferrule[D-Residue-E]{
\Value{v}
}{
\Decompose{\Residue{a}{g}{l}{v}}{\circ}{\Residue{a}{g}{l}{v}}
} \\
% Filter
\inferrule[D-Filter-T]{
\Decompose{e}{\mathcal{E}}{e'}
}{
\Decompose{\Filter{f}{e}}{\Filter{f}{\mathcal{E}}}{e'}
} \qquad
\inferrule[D-Filter-E]{
\Value{v}
}{
\Decompose{\Filter{f}{v}}{\circ}{\Filter{f}{v}}
} \\
% Application
\inferrule[D-Ap-L]{
\Decompose{e_1}{\mathcal{E}_1}{e_1'}
}{
\Decompose{e_1(e_2)}{\mathcal{E}_1(e_2)}{e_1'}
} \qquad
\inferrule[D-Ap-R]{
\Value{e_1} \\
\Decompose{e_2}{\mathcal{E}_2}{e_2'}
}{
\Decompose{e_1(e_2)}{e_1(\mathcal{E}_2)}{e_2'}
} \qquad
\inferrule[D-Ap-E]{
\Value{e_1} \\
\Value{e_2}
}{
\Decompose{e_1(e_2)}{\circ}{e_1(e_2)}
} \\
% Addition
\inferrule[D-Add-L]{
\Decompose{e_1}{\mathcal{E}_1}{e_1'}
}{
\Decompose{e_1 + e_2}{\mathcal{E}_1 + e_2}{e_1'}
} \qquad
\inferrule[D-Add-R]{
\Value{e_1} \\
\Decompose{e_2}{\mathcal{E}_2}{e_2'}
}{
\Decompose{e_1 + e_2}{e_1 + \mathcal{E}_2}{e_2'}
} \qquad
\inferrule[D-Add-E]{
\Value{e_1} \\
\Value{e_2}
}{
\Decompose{e_1 + e_2}{\circ}{e_1 + e_2}
} \\
\inferrule[D-Fix-E]{
\
}{
\Decompose{\Fix{x}{e}}{\circ}{\Fix{x}{e}}
}
\end{mathpar}
\jbox{\(\Compose{e}{\mathcal{E}}{e'}\)} Expression \(e\) can be obtained by plugging \(e'\) into the mark of \(\mathcal{E}\).
\begin{mathpar}
\inferrule[C-Top]{
}{
\Compose{e}{\circ}{e}
} \\
\inferrule[C-Ap-L]{
\Compose{e_1}{\mathcal{E}_1}{e_1'}
}{
\Compose{e_1(e_2)}{\mathcal{E}_1(e_2)}{e_2'}
} \qquad
\inferrule[C-Ap-R]{
\Compose{e_2}{\mathcal{E}}{e_2'}
}{
\Compose{e_1(e_2)}{e_1(\mathcal{E}_2)}{e_2'}
} \\
\inferrule[C-Add-L]{
\Compose{e_1}{\mathcal{E}_1}{e_1'}
}{
\Compose{e_1 + e_2}{\mathcal{E}_1 + e_2}{e_1'}
} \qquad
\inferrule[C-Add-R]{
\Compose{e_2}{\mathcal{E}_2}{e_2'}
}{
\Compose{e_1 + e_2}{e_1 + \mathcal{E}_2}{e_2'}
} \\
\inferrule[C-Filter]{
\Compose{e}{\mathcal{E}}{e'}
}{
\Compose{\Filter{f}{e}}{\Filter{f}{\mathcal{E}}}{e'}
} \qquad
\inferrule[C-Residue]{
\Compose{e}{\mathcal{E}}{e'}
}{
\Compose{\Residue{a}{g}{l}{e}}{\Residue{a}{g}{l}{\mathcal{E}}}{e'}
}
\end{mathpar}
%%% Local Variables:
%%% mode: LaTeX
%%% TeX-master: "main"
%%% End: