-
Notifications
You must be signed in to change notification settings - Fork 2
/
chemski.html
178 lines (159 loc) · 8.77 KB
/
chemski.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
<!DOCTYPE html>
<html lang="en-US">
<!-- based on a modification of the js version https://github.com/ishanpm/chemlambda-editor of my chemlambda v2, see the issue https://github.com/chorasimilarity/chemlambda-gui/issues/9
author: Marius Buliga
last modified: 24.08.2020
//
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/icequine-on-white.css">
<title>chemSKI & chemλ</title>
</head>
<body style="overflow: scroll;">
<script src="js/d3.v5.9.4.min.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/pagelook-skilambda.js"></script>
<script src="js/ioprep.js"></script>
<div class="header">
<span3>Cite as: </span3><div>chemSKI & chemlambda. <a href="http://imar.ro/~mbuliga/index.html">© Marius Buliga</a> (2020), https://mbuliga.github.io/chemski/chemski.html<span id="citeas"></span></div><br>
<span3>Version 24.08.2020</span3><br><br>
<span3>See also:</span3><br> <a href="https://chemlambda.github.io/index.html">All chemlambda projects</a>
<div><br><br>
German Kruszewski posed the problem of a graph-rewriting version of his and Tomas Mikolov <a href="https://www.mitpressjournals.org/doi/pdf/10.1162/isal_a_00258">Combinatory Chemistry: Towards a Simple Model of Emergent Evolution</a>, <a href="https://arxiv.org/abs/2003.07916">arXiv:2003.07916</a> in chemlambda style. <br><br>
<a href="https://github.com/mbuliga/chemski">chemSKI</a> is a purely local graph rewrite system for the SKI combinators calculus which answers this problem.<br><br>
In chemSKI there are two 1-valent nodes, for the combinators I and K, and two 3-valent nodes, for the combinator S and for the application (A like in chemlambda). There are also two 1-valent nodes, FRIN (free in) and FROUT (free out) and a 2-valent node Arrow, which serve the same roles as in chemlambda, namely to cap the free half-edges of the graph or to allow simultaneous application of rewrites, followed by the deletion of the introduced Arrow nodes by the rewrite COMB (which "combs" the graph). <br><br>
The rewrites concerning the node S are different, according to the existence of an edge between S node ports 1 and 2 (in this case S represents the combinator S) or not (in this case S is a fanout node). <br><br>
There is a variant of chemSKI which is fully compatible with chemlambda rewrites, called "chemSKI+λ" where the occurences of the node S when there is no edge between ports 1 and 2 are replaced with a chemlambda node FOE. You can toggle between chemSKI and chemSKI+λ by using the "change" button.<br><br>
You can explore the differences between chemSKI and chemSKI+λ by using the parser window and button "λSKI -> mol". <br><br>
The parser transforms any mix of SKI with lambda calculus (where the letters "S", "K", and "I" are always interpreted as combinators, not lambda calculus variables) into a mol file (i.e. into a graph). This graph can be reduced with chemSKI plus chemlambda or chemSKI+λ plus chemlambda. <br><br>
In the case of chemSKI the chemlambda nodes do not interpret the node S as a fanout, nor the pure chemSKI nodes (I,S,K) do not see FO and FOE as fanouts. Differently, if you change to the chemistry chemSKI+λ then the reductions work better, with the price of mixing the FO and FOE nodes into the pure chemSKI formalism. <br><br>
</div>
</div>
<div class="row">
<div class="col-2 menu" style="text-align: left;">
<div class="scol-12"></div>
<div class="scol-12"></div>
<div class="scol-12"> <span3 id="buttonAge" class="image2" ></span3></div>
<div class="scol-12"> <span3 id="whichChem" class="image2" ></span3></div>
<div class="scol-12"> <!--
<span3 id="agetext"> </span3><br><br><br><br>
<span3 id="buttonAge" class="image2" ></span3>--> <br><br><br>
<span3 id="chemtext">chemSKI</span3>
<br><br>
<span3 id="whichChem2" class="image2" ></span3>
</div>
</div>
<div class="col-7 menu">
<ul>
<li>
<span2>
<select class="theme-construction" id="listofmols" onchange="selectionLambda();">
<option value="SKInote">MENU</option>
<option value="SKKI">SKKI --> I </option>
<option value="SIISII"> (SII)(SII) </option>
<option value="SKILAMBDAEX"> (λx.λy.y x x) K S I </option>
<option value="IA">chemSKI and chemSKI+λ rewrite I-A</option>
<option value="SK">only chemSKI rewrite S-K (at port 2 of S)</option>
<option value="SK3">only chemSKI rewrite S-K (at port 3 of S)</option>
<option value="AS">only chemSKI rewrite A-S</option>
<option value="IS">only chemSKI rewrite I-S</option>
<option value="KS">only chemSKI rewrite K-S</option>
<option value="SS1">only chemSKI rewrite S-S</option>
<option value="AK">chemSKI and chemSKI+λ rewrite A-K</option>
<option value="KAB">chemSKI and chemSKI+λ rewrite K-A </option>
<option value="SABC">chemSKI and chemSKI+λ rewrite S-A</option>
</select>
</span2>
</li>
<li> λ or SKI -> mol <div><textarea id="inputlambda" class="image2" style="height: 80px; width: 100%; background-color: #010101;
color: #6495ED; font-size: 14px;"></textarea> </div>
</li>
<li> mol -> λ or SKI <div><textarea id="evaluation" class="image2" style="height: 80px; width: 100%; background-color: #010101;
color: #6495ED; font-size: 14px;"></textarea> </div></li>
<li>
<span3>rewrites weights slider</span3> <div class="slidecontainer">GROW <input class="slider" type="range" min="0" max="100" value="50" id="rewritesRange"> SLIM</div>
</li>
</ul>
</div>
<div class="col-3 menu" style="text-align: left;">
<span3 style="text-align: left;"> nodes ∼ </span3><span id="nodenumber"></span><br><br>
<span3 id="errors"></span3>
</div>
</div>
<div class="row">
<div class="col-2 menu">
<!-- <div class="scol-12"> <span3 id="lambdatomolbutton" class="image2" ></span3></div> -->
</div>
<div class="col-7 menu">
<!--<div><textarea id="inputlambda" style="height: 50px; width: 100%;"></textarea> </div> -->
</div>
<div class="col-3 menu" style="text-align: left;">
</div>
</div>
<div class="row">
<div class="col-2 menu">
<!-- <div class="scol-12"> <span3 id="button0" class="image2" ></span3></div> -->
<div class="scol-12"> <span3 id="button1" class="image2" ></span3></div>
<div class="scol-12"> <span3 id="button2" class="image2" ></span3></div>
<div class="scol-12"> <span3 id="button3" class="image2" ></span3></div>
<!-- <div class="scol-12"> <span3 id="button4" class="image2" ></span3></div> -->
</div>
<div class="col-7 menu">
<ul>
<li> <div id="svgdiv"> </div></li>
<li><span3>gravity slider</span3> <div class="slidecontainer">MIN <input class="slider" type="range" min="1" max="250" value="150" id="gravRange"> MAX</div></li>
<li><span2>CODE: </span2><span id="molyoulookat"></span></li>
<li><span> (Rewrites stop at max. </span><span id="maxnodenumber">1024</span> nodes<span>)</span></li>
</ul>
</div>
<div class="col-3 menu" style="text-align: left;">
<span id="comments" ></span>
</div>
</div>
<div class="row">
<div class="scol-6" style="text-align: left;">
<span2>before:</span2><br><br>
<span id="puttransformcachealt"></span>
</div>
<div class="scol-6" style="text-align: left;">
<span2>chosen:</span2><br><br>
<span id="chosentransform"></span>
</div>
<div class="scol-6" style="text-align: left;">
<span2>after:</span2><br><br>
<span id="puttransformcachealtafter"></span>
</div>
<div class="scol-6" style="text-align: left;">
<span2>mol before:</span2><br><br>
<span id="molexport"></span>
</div>
<div class="scol-6" style="text-align: left;">
<span2>mol after:</span2><br><br>
<span id="molexportafter"></span>
</div>
</div>
<script src="js/iceMol.js"></script>
<script src="js/iceComments.js"></script>
<script src="js/parameters.js"></script>
<script src="js/nodes.js"></script>
<script src="js/chemistry.js"></script>
<!-- <script src="js/reactions.js"></script> -->
<script src="js/myD3Graph.js"></script>
<script src="js/icequine.js"></script>
<script src="js/0parser.js"></script>
<script src="js/lambdaTerms.js"></script>
<script>
var whichP = location.hash;
whichP = whichP.replace(/#/g, "");
if (whichP != "") {
document.getElementById("listofmols").value = whichP;
} else {
document.getElementById("listofmols").value = "SKInote";
}
whichButtons("SKInote");
selectionLambda();
</script>
</body>
</html>