-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtranslation.qmd
220 lines (160 loc) · 7.67 KB
/
translation.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
# Translations
the `Translate` class indicates that a code block will contain translation
exercises that require symbolizing natural language sentences.
## Propositional Logic
You can create propositional logic translation problems by also adding the
class `Prop`, like so:
~~~{.Translate .Prop}
3.1 P/\Q : People want to know what's going on and questions are unavoidable
~~~
The number 3.1 indicates the exercise number, and the colon separates the
solution from the text that will be presented for translation. The result of
the above is:
~~~{.Translate .Prop}
3.1 P/\Q : People want to know what's going on and questions are unavoidable
~~~
To complete it, replace the text to the left of the submit solution button with
your translation, press return to check, and then press "Submit Solution".
Propositional translations are considered correct if they are logically
equivalent to the original answer. So for example, `Q/\P` will be accepted
above.
## First-Order Translation
It is also possible to create first-order translation problems using the class `FOL`, thus:
~~~{.Translate .FOL}
3.2 AxF(x) : Everything is fine
~~~
with the result:
~~~{.Translate .FOL}
3.2 AxF(x) : Everything is fine
~~~
These are completed as above. Equivalence of first-order sentences is
undecidable, so we can't check it, but we can catch most cases of "equivalent"
translations by using some rewriting rules.[^1] So, for example `~Ex~F(x)` will
be accepted above.
[^1]: the procedure is roughly as follows:
a. using the standard rules of passage, drive quantifiers in as far as possible
in both the submitted solution $S_0$, and in the target sentence $T_0$, generating two
result sentences $S_1$,$T_1$
b. using the standard rules of passage, pull out quantifiers as far as
possible, in every possible way, generating a set $S_2$ of sentences from
$S_1$, and a set of sentences $T_2$ from $T_1$
c. allowing permutation of quantifiers within blocks, look for pairs of
sentences $(S_3,T_3)$ with matching quantifier prefixes. Canonically
rename the variables. Check the matricies of the resulting formulas for
propositional equivalence.
## Exact Translations
Using the class `Exact`, you can also create "translations" that don't accept
logically equivalent answers. These may be useful if you wish to, for example,
ask a student what the missing premise in some inference is. So, for example
you might write
~~~{.Translate .Exact}
3.3 P : To make a modus ponens inference with P→Q, you need...
~~~
to generate:
~~~{.Translate .Exact}
3.3 P : To make a modus ponens inference with P→Q, you need...
~~~
Exact translations use the same syntax as `Prop` by default, but can be
configured to use a large number of alternative syntaxes (see below)
## Systems
The way that formulas are parsed can also be customized. This is done by
setting the `system` attribute to indicate which formal system you are drawing
your syntax from. So for example,
~~~{.Translate .FOL system="magnusQL"}
3.5 AxBx : Everything is bananas
~~~
will generate:
~~~{.Translate .FOL system="magnusQL"}
3.5 AxBx : Everything is bananas
~~~
For first-order translations, the available systems are: `firstOrder`
`montagueQC` `magnusQL` `thomasBolducAndZachFOL` `thomasBolducAndZachFOL2019`
`LogicBookPD` `LogicBookPDPlus` `hausmanPL` `howardSnyderPL`
`ichikawaJenkinsQL` `hardegreePL` `goldfarbAltND` `goldfarbNDPlus` and
`goldfarbAltNDPlus`.
For propositional translations, the available systems are: `prop` `montagueSC`
`LogicBookSD` `LogicBookSDPlus` `hausmanSL` `howardSnyderSL`
`ichikawaJenkinsSL` `hausmanSL` `magnusSL` `magnusSLPlus`
`thomasBolducAndZachTFL` `thomasBolducAndZachTFL2019` `tomassiPL` and
`hardegreeSL`.
For exact translations, the available systems are all of the above, together
with modal logic systems `.HardegreeSL` `.HardegreePL` `.HardegreeWTL`,
`.HardegreeL` `.HardegreeK` `.HardegreeT` `.HardegreeB` `.HardegreeD`
`.Hardegree4` `.Hardegree5`, second order systems `.SecondOrder`
`.PolySecondOrder`, and set theory systems `ElementaryST` and
`SeparativeST`
## Advanced usage
#### Multiple Solutions
If you wish to allow students to find one translation of a sentence that admits
several formalizations, you can use a comma-separated list of admissible
solutions. So,
~~~{.Translate .FOL}
3.4 (P /\ Q) \/ R, P/\(Q\/R) : Jack jumped the fence and was caught by the watchman or got away.
~~~
generates
~~~{.Translate .FOL}
3.4 (P /\ Q) \/ R, P/\(Q\/R) : Jack jumped the fence and was caught by the watchman or got away.
~~~
#### Options and Attributes
In addition to allowing for custom point values with `points=VALUE`, and
turning off submission with `submission="none"`, translations also have the
following options
<div class="table">
Name Effect
------------------------ ------------------------------------------------------------------------
`nocheck` Disables checking solutions
`exam` Allows for submission of work which is incomplete or incorrect
`checksyntax` When `exam` is active, blocks submission of syntactically incorrect work
------------------------ ------------------------------------------------------------------------
</div>
These can be included in the space separated list supplied to the `options`
attribute.
#### Translation tests
Finally, you can impose one or more extra tests on a translation. This is done
by setting the `tests` attribute to indicate which tests you wish to require
the translation to pass. The available tests for propositional translations are
<div class="table">
Name Effect
------------------------ ------------------------------------------------------------------
`CNF` Requires conjunctive normal form
`DNF` Requires disjunctive normal form
`maxCon:N` Requires that the translation contain N or fewer connectives
`maxNot:N` Requires that the translation contain N or fewer negations
`maxAnd:N` Requires that the translation contain N or fewer conjunctions
`maxIff:N` Requires that the translation contain N or fewer biconditionals
`maxIf:N` Requires that the translation contain N or fewer conditionals
`maxOr:N` Requires that the translation contain N or fewer disjunctions
`maxFalse:N` Requires that the translation contain N or fewer falsity constants
`maxAtom:N` Requires that the translation contain N or fewer atomic sentences
------------------------ ------------------------------------------------------------------
</div>
The available tests for first-order translations are all the propositional
tests, plus:
<div class="table">
Name Effect
------------------------ ------------------------------------------------------------------
`PNF` Requires prenex normal form
------------------------ ------------------------------------------------------------------
</div>
When using multiple tests, their names must be separated by spaces, so for
example,
~~~{.Translate .FOL tests="PNF maxNeg:0"}
3.6 ~Ex~F(x) : Nothing is not bananas.
~~~
will generate:
~~~{.Translate .FOL tests="PNF maxNeg:0"}
3.6 ~Ex~F(x) : Nothing is not bananas.
~~~
#### Partial Solutions
It's possible to include a partial solution to a translation problem, by
including the partial solution after a `|` following the problem. So for
example,
~~~{.Translate .FOL options="nocheck"}
3.7 AxF(x) : Everything is fine
| For all x, x is fine
~~~
Generates
~~~{.Translate .FOL options="nocheck"}
3.7 AxF(x) : Everything is fine
| For all x, x is fine
~~~