forked from mrieppel/TruthTableGenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtruthtable.html
272 lines (210 loc) · 7.38 KB
/
truthtable.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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Truth Table Generator</title>
<!--
Truth Table Generator
The MIT License (MIT)
Copyright (c) 2014-2022 Michael Rieppel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<script src='truthtable.js' type="text/javascript"></script>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap" rel="stylesheet">
<style type="text/css">
body {
font-family: "Open Sans", Verdana, Helvetica, sans-serif;
color:#444444;
height:100%;
background-color:white;
margin: 0px;
padding: 0px;
}
a:link {color:#4B2EDE;text-decoration:none;} /* unvisited link */
a:visited {color:#4B2EDE;text-decoration:none;} /* visited link */
a:hover {color:#9D90DC;text-decoration:none;} /* mouse over link */
a:active {color:#FFA04D;text-decoration:none;} /* selected link */
#container {
width:90%;
max-width: 800px;
position: relative;
min-height: 100vh;
margin-right:auto;
margin-left:auto;
font-size:16px;
padding-bottom:40px;
}
#location {
color:#999999;
font-size:14px;
padding-top:5px;
}
#location a {
color:#999999;
}
#githublink {
position:absolute;
top:5px;
right:5px;
}
#title {
text-align:center;
font-size:26px;
margin-top:15px;
margin-bottom:15px;
}
#ttinput {
margin-left:auto;
margin-right:auto;
padding-top:5px;
padding-bottom:5px;
}
#tt {
width:100%;
margin-left:auto;
margin-right:auto;
margin-top: 20px;
margin-bottom: 20px;
border-top:solid 1px #d3d3d3;
border-bottom:solid 1px #d3d3d3;
min-height:80px;
}
#in-op {
width:100%;
}
#in-op1, #in-op2, #in-op3 {
display:inline-block;
width:200px;
vertical-align:top;
}
table.truth {
border-collapse:collapse;
margin-left:auto;
margin-right:auto;
margin-top:10px;
margin-bottom:10px;
}
table.truth th {
border-bottom:1px solid black;
text-align: center;
padding:.2em;
font-weight: normal;
}
table.truth td {
border:0;
padding:.2em;
}
table.truth .dv {
border-right:1px solid black;
}
table.truth .mc {
color:red;
}
td.connective {
padding-right:1em;
}
footer {
font-size:85%;
color:#aaaaaa;
text-align:center;
position:absolute;
bottom:0;
width:100%;
padding:5px;
}
</style>
</head>
<body>
<div id='container'>
<div id='location'><a href='../index.html'>Home</a> > <a href='../etc/index.html'>Etc</a> > <a href='truthtable.html'>Truth Table Generator</a></div>
<div id='githublink'><a href='https://github.com/mrieppel/TruthTableGenerator'><img src='github.png' style="height:25px;"></a></div>
<div id='title'>Truth Table Generator</div>
<p>This page contains a program that will generate truth tables for formulas of truth-functional logic. You can enter multiple formulas separated by commas to include more than one formula in a single table (e.g. to test for entailment). Tables can be displayed in html (either the full table or the column under the main connective only), plain text, or <a href='http://www.latex-project.org/'>LaTeX</a>. You can also select which symbols to use for the two truth values and the connectives.</p>
<div id="ttinput">
<input type="text" id="in" size="40">
<input type="button" value="Generate Table" onclick="construct();">
</div>
<div id="tt"></div>
<div id="in-op">
<div id="in-op1">
<div>Truth-Values:</div>
<input type="radio" id="tv1" name="tvstyle" value="tf" checked><label for="tv1">T/F</label><br>
<input type="radio" id="tv2" name="tvstyle" value="tb"><label for="tv2">⊤/⊥</label><br>
<input type="radio" id="tv3" name="tvstyle" value="oz"><label for="tv3">1/0</label><br>
</div>
<div id="in-op2">
<div>Connectives:</div>
<input type="radio" id="cn1" name="cset" value="cs1" checked><label for="cn1">¬, ∧, ∨, →, ↔</label><br>
<input type="radio" id="cn2" name="cset" value="cs2"><label for="cn2">~, &, ∨, →, ↔</label><br>
<input type="radio" id="cn3" name="cset" value="cs3"><label for="cn3">~, &, ∨, ⊃, ≡</label><br>
</div>
<div id="in-op3">
<div>Table Type:</div>
<input type="radio" name="style" id="full" checked><label for="full">Full Table</label><br>
<input type="radio" name="style" id="main"><label for="main">Main Connective Only</label><br>
<input type="radio" name="style" id="text"><label for="textt"><label for="full">Text Table</label><br>
<input type="radio" name="style" id="latex"><label for="latex">LaTex Table</label><br>
</div>
</div>
<br>
<p><b>Symbols:</b> use the following keyboard symbols in your input for the various logical connectives:</p>
<table>
<tr><td class="connective">~</td><td>for negation</td></tr>
<tr><td class="connective">&</td><td>for conjunction</td></tr>
<tr><td class="connective">v</td><td>for disjunction</td></tr>
<tr><td class="connective">></td><td>for the conditional</td></tr>
<tr><td class="connective">< ></td><td>for the biconditional</td></tr>
<tr><td class="connective">#</td><td>for absurdity</td></tr>
<tr><td class="connective">|</td><td>for NAND (aka the <a href="sheffer.html">Sheffer Stroke</a>)</td></tr>
<tr><td class="connective">!</td><td>for NOR (Wittgenstein's <a href="sheffer.html">Sheffer Stroke</a>)</td></tr>
</table>
<br>
<p>Here are some examples of well-formed inputs the program will accept:</p>
<ul style="list-style-type:none;padding:0;">
<li>~A</li>
<li>(A & B)</li>
<li>(A & (~B > C))</li>
<li>(# > (B v ~A))</li>
<li>(A|B) <> ~(A & B)</li>
<li>(A <> (B v C)), A, (~B > C)</li>
</ul>
<p>The source code is available on GitHub, just click the icon at the top right corner of the page.
<footer>© 2010-2022 Michael Rieppel</footer>
</div>
<!-- Close container div -->
<!-- Start of StatCounter Code for Default Guide -->
<script type="text/javascript">
var sc_project=10143714;
var sc_invisible=1;
var sc_security="d4b1e890";
var sc_client_storage="disabled";
var scJsHost = (("https:" == document.location.protocol) ?
"https://secure." : "http://www.");
document.write("<sc"+"ript type='text/javascript' src='" +
scJsHost+
"statcounter.com/counter/counter.js'></"+"script>");
</script>
<noscript><div class="statcounter"><a title="free web stats"
href="http://statcounter.com/" target="_blank"><img
class="statcounter"
src="//c.statcounter.com/10143714/0/d4b1e890/1/" alt="free
web stats"></a></div></noscript>
<!-- End of StatCounter Code for Default Guide -->
</body>
</html>