Skip to content

Commit 043b5fd

Browse files
committed
Fix typos and add layout tag
1 parent 9258079 commit 043b5fd

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

docs/docs/reference/simple-smp.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1-
# Simple Symmetric Metaprogramming
1+
---
2+
layout: doc-page
3+
title: "The Meta-theory of Symmetric Meta-programming"
4+
---
5+
6+
# The Meta-theory of Symmetric Meta-programming
27

38
23.12.2017
49

5-
This note presents a simplified variant of symmetric metaprogramming
6-
which only treats dialgogues between two stages. We could have quotes
7-
containing splices (which can contain quotes, which can contain
8-
splices, and so on). Or we could start with a splice with embedded
9-
quotes. The important restriction is that (1) a term contains toplevel
10-
quotes or toplevel splices, but not both and (2) quotes cannot appear
10+
This note presents a simplified variant of symmetric meta-programming
11+
and sketches its soundness proof. The variant treats only dialogues
12+
between two stages. A program can have quotes which can contain
13+
splices (which can contain quotes, which can contain splices, and so
14+
on). Or the program could start with a splice with embedded
15+
quotes. The essential restriction is that (1) a term can contain top-level
16+
quotes or top-level splices, but not both, and (2) quotes cannot appear
1117
directly inside quotes and splices cannot appear directly inside
1218
splices. In other words, the universe is restricted to two phases
1319
only.
@@ -95,12 +101,12 @@ Typing judgments are of the form `E1 * E2 |- t: T` where `E1, E2` are environme
95101
E1 * E2 |- t1 t2: T
96102

97103

98-
E1E2 |- t: T
104+
E2E1 |- t: T
99105
-----------------
100106
E1 ~ E2 |- ’t: ’T
101107

102108

103-
E1 ~ E2 |- t: ’T
109+
E2 ~ E1 |- t: ’T
104110
----------------
105111
E1 ’ E2 |- ~t: T
106112

@@ -109,7 +115,7 @@ Typing judgments are of the form `E1 * E2 |- t: T` where `E1, E2` are environme
109115

110116
## Soundness
111117

112-
The meta-theory typically requires mutual inductions over two judgements.
118+
The meta-theory typically requires mutual inductions over two judgments.
113119

114120
### Progress Theorem
115121

@@ -122,7 +128,7 @@ To prove (1):
122128

123129
- the cases for variables, lambdas and applications are as in STL.
124130
- If `t = ’t2`, then by inversion we have ` ’ E1 |- t2: T2` for some type `T2`.
125-
By second I.H., we have one of:
131+
By the second I.H., we have one of:
126132
- `t2 = u`, hence `’t2` is a value,
127133
- `t2 ==> t3`, hence `’t2 --> ’t3`.
128134
- The case `t = ~t2` is not typable.
@@ -150,7 +156,7 @@ To prove (2):
150156
### Substitution Lemma
151157

152158
1. If `E1 ~ E2 |- s: S` and `E1 ~ E2, x: S |- t: T` then `E1 ~ E2 |- [x := s]t: T`.
153-
2. If `E1 E2 |- s: S` and `E2, x: S ’ E1 |- t: T` then `E2 ’ E1 |- [x := s]t: T`.
159+
2. If `E1 ~ E2 |- s: S` and `E2, x: S ’ E1 |- t: T` then `E2 ’ E1 |- [x := s]t: T`.
154160

155161
The proofs are by induction on typing derivations for `t`, analogous
156162
to the proof for STL (with (2) a bit simpler than (1) since we do not

0 commit comments

Comments
 (0)