porolog 0.0.4 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -5
  3. data/Rakefile +7 -2
  4. data/bin/porolog +58 -1
  5. data/coverage/badge.svg +1 -1
  6. data/coverage/index.html +76733 -2638
  7. data/doc/Array.html +1066 -0
  8. data/doc/Object.html +674 -0
  9. data/doc/Porolog.html +4153 -74
  10. data/doc/Symbol.html +501 -0
  11. data/doc/_index.html +280 -6
  12. data/doc/class_list.html +1 -1
  13. data/doc/file.README.html +34 -39
  14. data/doc/index.html +34 -39
  15. data/doc/method_list.html +1337 -57
  16. data/doc/top-level-namespace.html +4 -2
  17. data/lib/porolog.rb +1144 -4
  18. data/lib/porolog/arguments.rb +28 -24
  19. data/lib/porolog/core_ext.rb +188 -0
  20. data/lib/porolog/error.rb +9 -0
  21. data/lib/porolog/goal.rb +357 -0
  22. data/lib/porolog/instantiation.rb +346 -0
  23. data/lib/porolog/predicate.rb +74 -31
  24. data/lib/porolog/predicate/builtin.rb +825 -0
  25. data/lib/porolog/rule.rb +162 -0
  26. data/lib/porolog/scope.rb +4 -4
  27. data/lib/porolog/tail.rb +57 -0
  28. data/lib/porolog/value.rb +105 -0
  29. data/lib/porolog/variable.rb +325 -0
  30. data/test/porolog/arguments_test.rb +244 -195
  31. data/test/porolog/core_ext_test.rb +290 -0
  32. data/test/porolog/goal_test.rb +891 -0
  33. data/test/porolog/instantiation_test.rb +910 -0
  34. data/test/porolog/porolog_test.rb +2376 -13
  35. data/test/porolog/predicate/builtin_test.rb +1340 -0
  36. data/test/porolog/predicate_test.rb +84 -30
  37. data/test/porolog/rule_test.rb +527 -0
  38. data/test/porolog/scope_test.rb +0 -2
  39. data/test/porolog/tail_test.rb +127 -0
  40. data/test/porolog/value_test.rb +315 -0
  41. data/test/porolog/variable_test.rb +1614 -0
  42. data/test/samples_test.rb +277 -0
  43. data/test/test_helper.rb +115 -0
  44. metadata +34 -7
@@ -0,0 +1,501 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: Symbol
8
+
9
+ &mdash; Documentation by YARD 0.9.19
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "Symbol";
19
+ relpath = '';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="_index.html">Index (S)</a> &raquo;
40
+
41
+
42
+ <span class="title">Symbol</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: Symbol
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName"><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></span>
73
+
74
+ <ul class="fullTree">
75
+ <li><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></li>
76
+
77
+ <li class="next">Symbol</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/porolog/core_ext.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>In Porolog, Symbols represent Variables.</p>
106
+
107
+
108
+ </div>
109
+ </div>
110
+ <div class="tags">
111
+
112
+
113
+ </div>
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+ <h2>
122
+ Instance Method Summary
123
+ <small><a href="#" class="summary_toggle">collapse</a></small>
124
+ </h2>
125
+
126
+ <ul class="summary">
127
+
128
+ <li class="public ">
129
+ <span class="summary_signature">
130
+
131
+ <a href="#%2F-instance_method" title="#/ (instance method)">#<strong>/</strong>(other) &#x21d2; Array </a>
132
+
133
+
134
+
135
+ </span>
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+ <span class="summary_desc"><div class='inline'>
146
+ <p>An Array with the Object being the head and the other Object being the tail.</p>
147
+ </div></span>
148
+
149
+ </li>
150
+
151
+
152
+ <li class="public ">
153
+ <span class="summary_signature">
154
+
155
+ <a href="#myid-instance_method" title="#myid (instance method)">#<strong>myid</strong> &#x21d2; String </a>
156
+
157
+
158
+
159
+ </span>
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+ <span class="summary_desc"><div class='inline'>
170
+ <p>A convenience method for testing/debugging.</p>
171
+ </div></span>
172
+
173
+ </li>
174
+
175
+
176
+ <li class="public ">
177
+ <span class="summary_signature">
178
+
179
+ <a href="#type-instance_method" title="#type (instance method)">#<strong>type</strong> &#x21d2; Symbol </a>
180
+
181
+
182
+
183
+ </span>
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+ <span class="summary_desc"><div class='inline'>
194
+ <p>The type of the object (for a Symbol, should be :variable).</p>
195
+ </div></span>
196
+
197
+ </li>
198
+
199
+
200
+ <li class="public ">
201
+ <span class="summary_signature">
202
+
203
+ <a href="#variables-instance_method" title="#variables (instance method)">#<strong>variables</strong> &#x21d2; Array </a>
204
+
205
+
206
+
207
+ </span>
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+ <span class="summary_desc"><div class='inline'>
218
+ <p>Embedded variables (for a Symbol, should be itself).</p>
219
+ </div></span>
220
+
221
+ </li>
222
+
223
+
224
+ </ul>
225
+
226
+
227
+
228
+
229
+ <div id="instance_method_details" class="method_details_list">
230
+ <h2>Instance Method Details</h2>
231
+
232
+
233
+ <div class="method_details first">
234
+ <h3 class="signature first" id="/-instance_method">
235
+
236
+ #<strong>/</strong>(other) &#x21d2; <tt><span class='object_link'><a href="Array.html" title="Array (class)">Array</a></span></tt>
237
+
238
+
239
+
240
+
241
+
242
+ </h3><div class="docstring">
243
+ <div class="discussion">
244
+
245
+ <p>Returns an Array with the Object being the head and the other Object being the tail.</p>
246
+
247
+
248
+ </div>
249
+ </div>
250
+ <div class="tags">
251
+ <p class="tag_title">Parameters:</p>
252
+ <ul class="param">
253
+
254
+ <li>
255
+
256
+ <span class='name'>other</span>
257
+
258
+
259
+ <span class='type'>(<tt><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></tt>)</span>
260
+
261
+
262
+
263
+ &mdash;
264
+ <div class='inline'>
265
+ <p>the Object which is to be the tail</p>
266
+ </div>
267
+
268
+ </li>
269
+
270
+ </ul>
271
+
272
+ <p class="tag_title">Returns:</p>
273
+ <ul class="return">
274
+
275
+ <li>
276
+
277
+
278
+ <span class='type'>(<tt><span class='object_link'><a href="Array.html" title="Array (class)">Array</a></span></tt>)</span>
279
+
280
+
281
+
282
+ &mdash;
283
+ <div class='inline'>
284
+ <p>an Array with the Object being the head and the other Object being the tail.</p>
285
+ </div>
286
+
287
+ </li>
288
+
289
+ </ul>
290
+
291
+ </div><table class="source_code">
292
+ <tr>
293
+ <td>
294
+ <pre class="lines">
295
+
296
+
297
+ 76
298
+ 77
299
+ 78</pre>
300
+ </td>
301
+ <td>
302
+ <pre class="code"><span class="info file"># File 'lib/porolog/core_ext.rb', line 76</span>
303
+
304
+ <span class='kw'>def</span> <span class='op'>/</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
305
+ <span class='lbracket'>[</span><span class='kw'>self</span><span class='rbracket'>]</span><span class='op'>/</span><span class='id identifier rubyid_other'>other</span>
306
+ <span class='kw'>end</span></pre>
307
+ </td>
308
+ </tr>
309
+ </table>
310
+ </div>
311
+
312
+ <div class="method_details ">
313
+ <h3 class="signature " id="myid-instance_method">
314
+
315
+ #<strong>myid</strong> &#x21d2; <tt>String</tt>
316
+
317
+
318
+
319
+
320
+
321
+ </h3><div class="docstring">
322
+ <div class="discussion">
323
+
324
+ <p>A convenience method for testing/debugging.</p>
325
+
326
+
327
+ </div>
328
+ </div>
329
+ <div class="tags">
330
+
331
+ <p class="tag_title">Returns:</p>
332
+ <ul class="return">
333
+
334
+ <li>
335
+
336
+
337
+ <span class='type'>(<tt>String</tt>)</span>
338
+
339
+
340
+
341
+ &mdash;
342
+ <div class='inline'>
343
+ <p>the equivalent of inspect.</p>
344
+ </div>
345
+
346
+ </li>
347
+
348
+ </ul>
349
+
350
+ </div><table class="source_code">
351
+ <tr>
352
+ <td>
353
+ <pre class="lines">
354
+
355
+
356
+ 60
357
+ 61
358
+ 62</pre>
359
+ </td>
360
+ <td>
361
+ <pre class="code"><span class="info file"># File 'lib/porolog/core_ext.rb', line 60</span>
362
+
363
+ <span class='kw'>def</span> <span class='id identifier rubyid_myid'>myid</span>
364
+ <span class='id identifier rubyid_inspect'>inspect</span>
365
+ <span class='kw'>end</span></pre>
366
+ </td>
367
+ </tr>
368
+ </table>
369
+ </div>
370
+
371
+ <div class="method_details ">
372
+ <h3 class="signature " id="type-instance_method">
373
+
374
+ #<strong>type</strong> &#x21d2; <tt><span class='object_link'><a href="" title="Symbol (class)">Symbol</a></span></tt>
375
+
376
+
377
+
378
+
379
+
380
+ </h3><div class="docstring">
381
+ <div class="discussion">
382
+
383
+ <p>Returns the type of the object (for a Symbol, should be :variable)</p>
384
+
385
+
386
+ </div>
387
+ </div>
388
+ <div class="tags">
389
+
390
+ <p class="tag_title">Returns:</p>
391
+ <ul class="return">
392
+
393
+ <li>
394
+
395
+
396
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Symbol (class)">Symbol</a></span></tt>)</span>
397
+
398
+
399
+
400
+ &mdash;
401
+ <div class='inline'>
402
+ <p>the type of the object (for a Symbol, should be :variable)</p>
403
+ </div>
404
+
405
+ </li>
406
+
407
+ </ul>
408
+
409
+ </div><table class="source_code">
410
+ <tr>
411
+ <td>
412
+ <pre class="lines">
413
+
414
+
415
+ 70
416
+ 71
417
+ 72</pre>
418
+ </td>
419
+ <td>
420
+ <pre class="code"><span class="info file"># File 'lib/porolog/core_ext.rb', line 70</span>
421
+
422
+ <span class='kw'>def</span> <span class='id identifier rubyid_type'>type</span>
423
+ <span class='symbol'>:variable</span>
424
+ <span class='kw'>end</span></pre>
425
+ </td>
426
+ </tr>
427
+ </table>
428
+ </div>
429
+
430
+ <div class="method_details ">
431
+ <h3 class="signature " id="variables-instance_method">
432
+
433
+ #<strong>variables</strong> &#x21d2; <tt><span class='object_link'><a href="Array.html" title="Array (class)">Array</a></span></tt>
434
+
435
+
436
+
437
+
438
+
439
+ </h3><div class="docstring">
440
+ <div class="discussion">
441
+
442
+ <p>Returns embedded variables (for a Symbol, should be itself).</p>
443
+
444
+
445
+ </div>
446
+ </div>
447
+ <div class="tags">
448
+
449
+ <p class="tag_title">Returns:</p>
450
+ <ul class="return">
451
+
452
+ <li>
453
+
454
+
455
+ <span class='type'>(<tt><span class='object_link'><a href="Array.html" title="Array (class)">Array</a></span></tt>)</span>
456
+
457
+
458
+
459
+ &mdash;
460
+ <div class='inline'>
461
+ <p>embedded variables (for a Symbol, should be itself).</p>
462
+ </div>
463
+
464
+ </li>
465
+
466
+ </ul>
467
+
468
+ </div><table class="source_code">
469
+ <tr>
470
+ <td>
471
+ <pre class="lines">
472
+
473
+
474
+ 65
475
+ 66
476
+ 67</pre>
477
+ </td>
478
+ <td>
479
+ <pre class="code"><span class="info file"># File 'lib/porolog/core_ext.rb', line 65</span>
480
+
481
+ <span class='kw'>def</span> <span class='id identifier rubyid_variables'>variables</span>
482
+ <span class='lbracket'>[</span><span class='kw'>self</span><span class='rbracket'>]</span>
483
+ <span class='kw'>end</span></pre>
484
+ </td>
485
+ </tr>
486
+ </table>
487
+ </div>
488
+
489
+ </div>
490
+
491
+ </div>
492
+
493
+ <div id="footer">
494
+ Generated on Sun Aug 2 19:24:17 2020 by
495
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
496
+ 0.9.19 (ruby-2.6.5).
497
+ </div>
498
+
499
+ </div>
500
+ </body>
501
+ </html>