-
Notifications
You must be signed in to change notification settings - Fork 5
/
fol-exs.html
206 lines (189 loc) · 6.48 KB
/
fol-exs.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- standard metadata -->
<meta charset="utf-8" />
<meta name="description" content="First-Order Logic exercises" />
<meta name="author" content="Kevin C. Klement" />
<meta name="copyright" content="© Kevin C. Klement" />
<meta name="keywords" content="logic,proof,deduction" />
<!-- facebook opengraph stuff -->
<meta property="og:title" content="First-Order Logic exercises" />
<meta property="og:image" content="sample.png" />
<meta property="og:description" content="First-Order Logic exercises" />
<!-- if you want to disable search indexing -->
<meta name="robots" content="noindex,nofollow" />
<!-- if mobile ready -->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<!-- web icon -->
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<title>First-Order Logic sample proof exercises</title>
<!-- page style from https://github.com/dhg/Skeleton -->
<link rel="stylesheet" href="normalize.css">
<link rel="stylesheet" href="skeleton.css">
<link href="https://fonts.googleapis.com/css?family=Noto+Sans" rel="stylesheet" type="text/css">
<style>
body {font-family: "Noto Sans";}
a, a:hover, a:visited, a:focus, a:active {color: #0c1c8c; text-decoration: none; font-weight: bold ;}
label, legend { display: inline-block; }
</style>
<!-- css file -->
<link rel="stylesheet" type="text/css" href="proofs.css" />
<!-- javascript file -->
<script type="text/javascript" charset="utf-8" src="ajax.js"></script>
<script type="text/javascript" charset="utf-8" src="syntax.js"></script>
<script type="text/javascript" charset="utf-8" src="proofs.js"></script>
<script type="text/javascript">
predicateSettings = true;
var exSetA = [
{
"prems": [],
"conc": "∀xFx ∨ ¬∀xFx"
},
{
"prems": [],
"conc": "∀z(Pz ∨ ¬Pz)"
},
{
"prems": ["∀x(Fx → Gx)", "∃xFx"],
"conc": "∃xGx"
},
{
"prems": ["∀x(Mx ↔ Nx)", "Ma ∧ ∃xRxa"],
"conc": "∃xNx"
},
{
"prems": ["∀x∀yGxy"],
"conc": "∃xGxx"
},
{
"prems": [],
"conc": "∀xRxx → ∃x∃yRxy"
},
{
"prems": [],
"conc": "∀y∃x(Qy → Qx)"
},
{
"prems": ["Na → ∀x(Mx ↔ Ma)","Ma","¬Mb"],
"conc": "¬Na"
},
{
"prems": ["∀x∀y(Gxy → Gyx)"],
"conc": "∀x∀y(Gxy ↔ Gyx)"
},
{
"prems": ["∀x(¬Mx ∨ Ljx)", "∀x(Bx → Ljx)", "∀x(Mx ∨ Bx)"],
"conc": "∀xLjx"
}
];
var exSetB = [
{
"prems": ["Pa ∨ Qb", "Qb → b=c", "¬Pa"],
"conc": "Qc"
},
{
"prems": ["m=n ∨ n=o", "Fn"],
"conc": "Fm ∨ Fo"
},
{
"prems": ["∀x x=m","Rma"],
"conc": "∃xRxx"
},
{
"prems": ["∀x∀y(Rxy → x = y)"],
"conc": "Rab → Rba"
},
{
"prems": ["¬∃x¬x=m"],
"conc": "∀x∀y(Px → Py)"
},
{
"prems": ["∃xJx","∃x¬Jx"],
"conc": "∃x∃y¬x=y"
},
{
"prems": ["∀x(x=n ↔ Mx)","∀x(Ox ∨ ¬Mx)"],
"conc": "On"
},
{
"prems": ["∃xDx","∀x(x=p ↔ Dx)"],
"conc": "Dp"
},
{
"prems": ["∃x[(Kx ∧ ∀y(Ky → x=y)) ∧ Bx]","Kd"],
"conc": "Bd"
},
{
"prems": [],
"conc": "Pa → ∀x(Px ∨ ¬ x=a)"
}
];
window.onload = function() {
exSetA.forEach( function(p) {
var instLine = '';
var sofar = [];
for (var i=0; i<p.prems.length; i++) {
instLine += prettyStr(p.prems[i]);
if ((i+1) != p.prems.length) {
instLine += ', ';
}
sofar.push({
"wffstr" : p.prems[i],
"jstr" : "Pr"
});
}
var li = document.createElement("li");
document.getElementById("setA").appendChild(li);
instLine += ' ⊢ ' + prettyStr(p.conc);
li.innerHTML = instLine;
makeProof(li, sofar, p.conc);
});
exSetB.forEach( function(p) {
var instLine = '';
var sofar = [];
for (var i=0; i<p.prems.length; i++) {
instLine += prettyStr(p.prems[i]);
if ((i+1) != p.prems.length) {
instLine += ', ';
}
sofar.push({
"wffstr" : p.prems[i],
"jstr" : "Pr"
});
}
var li = document.createElement("li");
document.getElementById("setB").appendChild(li);
instLine += ' ⊢ ' + prettyStr(p.conc);
li.innerHTML = instLine;
makeProof(li, sofar, p.conc);
});
}
</script>
<style type="text/css">
li {
margin-bottom: 4ex;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="one-half column" style="margin-top: 5%">
<h1>First-Order Logic sample proof exercises</h1>
<h3>Chapter 32, Exercise E</h3>
<p>Provide a proof of each claim.</p>
<ol id="setA">
</ol>
<h3>Chapter 34, Exercise A</h3>
<p>Provide a proof of each claim.</p>
<ol id="setB">
</ol>
<a href="index.html">Return to main demo page.</a>
</div>
</div>
</div>
</body>
</html>