-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathderivations.qmd
292 lines (216 loc) · 9.47 KB
/
derivations.qmd
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
# Derivations
The `ProofChecker` class indicates that a code block will contain derivation
exercises. The `Playground` class indicates that a code block will generate a
"playground" in which instead of checking whether the proof establishes
something set in advance, Carnap will figure out what the proof establishes and
display it at the top of the proof-box. The formal systems used can be
controlled using predefined classes, or by setting attributes on the code-block
(see below).
## Predefined classes
To get started, it's possible to create simple exercises in the propositional
system of the Carnap book like this:
~~~{.ProofChecker .Prop}
1.1 P :|-: Q->P
~~~
Where the `:|-:` again indicates a turnstile. The result is then:
~~~{.ProofChecker .Prop}
1.7 P:|-: Q->P
~~~
Similarly,
~~~{.Playground .Prop}
~~~
generates
~~~{.Playground .Prop}
~~~
The class `Prop` specifies that we wish to use the propositional formal system
of the Carnap book, and specifies a couple of UI-defaults for displaying proofs
in that system. The currently available predefined classes are:
<div class="table">
-------------------------------------------------------------------------------------------------------------------------------------
Class Strings Description
------------------------------------------------------------- ---------------------------------------------------------------------------
`.Prop`, `.FirstOrder`, `.SecondOrder`, `.PolySecondOrder`, Montague-Style systems, the first two of which are used in the Carnap book.
`.MontagueSC`,`.MontagueQC`, `ElementaryST`, `SeparativeST`
`.LogicBookSD`, `LogicBookSDPlus`, `LogicBookPD`, Fitch style systems based on Bergmann Moore and Nelson's *Logic Book*.
`.LogicBookPDPlus`
`.ForallxSL`, `.ForallxSLPlus`, `.ForallxQL` Fitch-style systems based on Magnus's *Forall x*.
`.ZachTFL`, `.ZachTFL2019`, `.ZachFOL`, `.ZachFOL2019`, Fitch-style systems based on the Calgary Remix of *Forall x*.
`.ZachFOLPlus2019`
`.IchikawaJenkinsSL`, `.IchikawaJenkinsQL` Fitch-style systems based on the Ichikawa-Jenkins Remix of *Forall x*.
`.GamutMPND`, `.GamutIPND`, `.GamutPND`, `.GamutPNDPlus` Fitch-style systems based on the systems used in Gamut's *Introduction to Logic*, including minimal and intuitionistic fragments of propositional logic.
`.GamutND`,
`HowardSnyderSL`,`HowardSnyderPL` Systems based on Howard-Snyder's *The Power of Logic*.
`HausmanSL`,`HausmanPL` Systems based on Hausman's *Logic and Philosophy*.
`.GoldfarbND`, `.GoldfarbAltND`, `.GoldfarbNDPlus`, Lemmon-style systems based on Goldfarb's *Deductive Logic*.
`.GoldfarbAltNDPlus`
`.TomassiPL` Lemmon-style system based on Tomassi's *Logic*
`.HardegreeSL`, `.HardegreePL`, `.HardegreeWTL`, Hardegree-style systems based on Hardegree's *Modal Logic*
`.HardegreeL`, `.HardegreeK`, `.HardegreeT`, `.HardegreeB`,
`.HardegreeD`, `.Hardegree4`, `.Hardegree5`, `.HardegreeMPL`
`.ZachPropEq` Chain of equivalence prover.
-------------------------------------------------------------------------------------------------------------------------------------
</div>
## Advanced Usage
#### Options
Like the other exercises, derivations allow for `points=VALUE` and
`submission="none"`.
Derivations, however, currently have a little more depth than the other types
of exercises. There are, correspondingly, more options available:
<div class="table">
Name Effect
------------ ------------------------------------------------------------------
`fonts` Uses [Fira Logic](http://github.com/gleachkr/FiraLogic) font, including ligatures for logical symbols
`popout` Makes it possible to open the problem in a new window
`render` Renders a picture of the proof as you type
`indent` Automatically indents newlines to the level of the previous line
`tabindent` Insert indent on tab press
`resize` Automatically resizes proof area
`exam` Allows for submission of work which is incomplete or incorrect
------------ ------------------------------------------------------------------
</div>
These can all be included in the "options" string supplied to the options
attribute of the code block, like this:
~~~{.ProofChecker .Prop options="indent fonts popout resize render indent"}
1.8 P :|-: Q->P
|1.Show Q->P
|2. Q:AS
|3. P:PR
|4.:CD 3
~~~
The result of the above is:
~~~{.ProofChecker .Prop options="indent fonts popout resize render indent"}
1.8 P :|-: Q->P
|1.Show Q->P
|2. Q:AS
|3. P:PR
|4.:CD 3
~~~
An options string will override any options that are included by default in a
given predefined class. For example, `.Prop` automatically turns on the
`resize` option. However if we have just
~~~{.ProofChecker .Prop options="indent"}
1.9 P :|-: Q->P
~~~
We get a proofbox that resizes manually:
~~~{.ProofChecker .Prop options="indent"}
1.9 P :|-: Q->P
~~~
#### Partial Solutions
A partial solution to a problem can be included by following a problem with a
derivation that is line-by-line prefixed with the `|` character, optionally
(for readability) followed by a line number followed by a period, like this:
~~~{.ProofChecker .Prop}
1.7 P :|-: Q->P
|1.Show Q->P
|2. Q:AS
|3. P:PR
|4.:CD 3
~~~
This gives us:
~~~{.ProofChecker .Prop}
1.7 P :|-: Q->P
|1.Show Q->P
|2. Q:AS
|3. P:PR
|4.:CD 3
~~~
Everything after the line number (or the `|` if you don't use numbers) is
included in the proof, so be careful about spaces!
You can also include a partial derivation without specific solution, by
replacing `.ProofChecker` with `.Playground`, writing for example:
```
~~~{.Playground .Prop}
|1.Show Q->P
|2. Q:AS
|3. P:PR
|4.:CD 3
~~~
```
which gives you a proof box that calculates what has been derived and displays
it at the top, rather than calculating whether the derivation proves a given
sequent, thus:
~~~{.Playground .Prop}
|1.Show Q->P
|2. Q:AS
|3. ?:PR
|4.:CD 3
~~~
#### Feedback
The defaults for feedback (check the proof with every keypress) can also be
overridden by setting the feedback attribute. The override options for feedback
are
<div class="table">
Name Effect
------------- ------------------------------------
`manual` require a button-press for feedback
`syntaxonly` warn about syntax errors, but do not check proof for correctness
`none` do not offer feedback
------------- ------------------------------------
</div>
So,
~~~{.ProofChecker .Prop submission="none" feedback="manual"}
1.10 P :|-: Q->P
~~~
produces
~~~{.ProofChecker .Prop submission="none" feedback="manual"}
1.10 P :|-: Q->P
~~~
#### Systems
If you don't want to use a predefined class, you can set the system option
manually. This will give you complete control over which options are set—only
the ones you select will be active. So you would write something like:
~~~{.ProofChecker system="prop" submission="none" feedback="manual"}
1.11 -Q :|-: Q->P
~~~
to produce
~~~{.ProofChecker system="prop" submission="none" feedback="manual"}
1.11 -Q :|-: Q->P
~~~
The available propositional systems are: `prop` `montagueSC` `LogicBookSD`
`LogicBookSDPlus` `hausmanSL` `howardSnyderSL` `ichikawaJenkinsSL` `hausmanSL`
`magnusSL` `magnusSLPlus` `thomasBolducAndZachTFL`
`thomasBolducAndZachTFL2019` `gamutMPND` `gamutIPND`,
`gamutPND` `gamutPNDPlus` `tomassiPL` and `hardegreeSL`. The available
first-order systems are: `firstOrder` `montagueQC` `magnusQL`
`thomasBolducAndZachFOL` `thomasBolducAndZachFOL2019`
`thomasBolducAndZachFOLPlus2019` `LogicBookPD` `LogicBookPDPlus` `gamutND`
`hausmanPL` `howardSnyderPL` `ichikawaJenkinsQL` `hardegreePL` `goldfarbAltND`
`goldfarbNDPlus` and `goldfarbAltNDPlus`. The available set theory systems are:
`elementarySetTheory` and `separativeSetTheory`. The available second-order
systems are: `secondOrder` and `PolySecondOrder`. The available propositional
modal logic systems are: `hardegreeL` `hardegreeK` `hardegreeT` `hardegreeB`
`hardegreeD` `hardegree4` and `hardegree5`. The available predicate modal logic
system is `hardegreeMPL`, and the available "world theory" system is
`hardegreeWTL`.
#### Initialization
The `init` attribute may be set to "now" in order to check the proof as soon as
it is loaded, instead of waiting for a user interaction.
#### Indentation Guides
Besides just the indentation guide created by setting `guides` in the options
string, there are several more refined overlays available for increasing the
readability of a typed proof. These are configured by setting the `guides`
attribute. The available options for guides are:
<div class="table">
Name Effect
------------------ ------------------------------------
`montague` Montague style guides below show lines
`fitch` A fitch style proof overlay
`hausman` A Hausman style proof overlay
`howard-snyder` A Howard-Snyder style proof overlay
`indent` Simple indentation indicator guides
------------------ ------------------------------------
</div>
So,
~~~{.Playground .ForallxSL guides="fitch"}
P :AS
P/\P :&I 1 1
P :&E 2
P->P :->I 1-3
~~~
Produces:
~~~{.Playground .ForallxSL guides="fitch" init="now" options="fonts resize"}
P :AS
P/\P :&I 1 1
P :&E 2
P->P :->I 1-3
~~~