@tuprolog/2p-full 0.31.5-dev0c → 0.31.5-dev0n

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 (64) hide show
  1. package/2p-bdd.js +234 -229
  2. package/2p-bdd.js.map +1 -1
  3. package/2p-core.js +5618 -6238
  4. package/2p-core.js.map +1 -1
  5. package/2p-datalog.js +9 -2
  6. package/2p-datalog.js.map +1 -1
  7. package/2p-dsl-core.js +9 -2
  8. package/2p-dsl-core.js.map +1 -1
  9. package/2p-dsl-solve.js +9 -2
  10. package/2p-dsl-solve.js.map +1 -1
  11. package/2p-dsl-theory.js +9 -2
  12. package/2p-dsl-theory.js.map +1 -1
  13. package/2p-dsl-unify.js +9 -2
  14. package/2p-dsl-unify.js.map +1 -1
  15. package/2p-full.js +26 -3
  16. package/2p-full.js.map +1 -1
  17. package/2p-io-lib.js +931 -954
  18. package/2p-io-lib.js.map +1 -1
  19. package/2p-oop-lib.js +1308 -1337
  20. package/2p-oop-lib.js.map +1 -1
  21. package/2p-parser-core.js +364 -368
  22. package/2p-parser-core.js.map +1 -1
  23. package/2p-parser-js.js +14 -3
  24. package/2p-parser-js.js.map +1 -1
  25. package/2p-parser-theory.js +66 -41
  26. package/2p-parser-theory.js.map +1 -1
  27. package/2p-repl.js +183 -181
  28. package/2p-repl.js.map +1 -1
  29. package/2p-serialize-core.js +9 -2
  30. package/2p-serialize-core.js.map +1 -1
  31. package/2p-serialize-theory.js +9 -2
  32. package/2p-serialize-theory.js.map +1 -1
  33. package/2p-solve-classic.js +1408 -1680
  34. package/2p-solve-classic.js.map +1 -1
  35. package/2p-solve-concurrent.js +9 -2
  36. package/2p-solve-concurrent.js.map +1 -1
  37. package/2p-solve-plp.js +19 -5
  38. package/2p-solve-plp.js.map +1 -1
  39. package/2p-solve-problog.js +1880 -1915
  40. package/2p-solve-problog.js.map +1 -1
  41. package/2p-solve-streams.js +1251 -1343
  42. package/2p-solve-streams.js.map +1 -1
  43. package/2p-solve.js +5397 -5851
  44. package/2p-solve.js.map +1 -1
  45. package/2p-theory.js +1800 -1796
  46. package/2p-theory.js.map +1 -1
  47. package/2p-unify.js +371 -372
  48. package/2p-unify.js.map +1 -1
  49. package/2p-utils.js +555 -517
  50. package/2p-utils.js.map +1 -1
  51. package/88b0986a7186d029-atomicfu-js-ir.js +9 -2
  52. package/88b0986a7186d029-atomicfu-js-ir.js.map +1 -1
  53. package/clikt-clikt-js-ir.js +2208 -2427
  54. package/clikt-clikt-js-ir.js.map +1 -1
  55. package/kotlin-kotlin-stdlib-js-ir.js +3030 -3127
  56. package/kotlin-kotlin-stdlib-js-ir.js.map +1 -1
  57. package/kotlin-kotlinx-atomicfu-runtime-js-ir.js +9 -2
  58. package/kotlin-kotlinx-atomicfu-runtime-js-ir.js.map +1 -1
  59. package/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js +9 -2
  60. package/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js.map +1 -1
  61. package/kt-math.js +3196 -2832
  62. package/kt-math.js.map +1 -1
  63. package/package.json +56 -2
  64. package/2p-full.d.ts +0 -270
package/2p-repl.js CHANGED
@@ -1,95 +1,106 @@
1
- (function (_, kotlin_kotlin, kotlin_it_unibo_tuprolog_solve, kotlin_it_unibo_tuprolog_core, kotlin_com_github_ajalt_clikt_clikt, kotlin_it_unibo_tuprolog_theory, kotlin_it_unibo_tuprolog_parser_core, kotlin_it_unibo_tuprolog_io_lib, kotlin_it_unibo_tuprolog_oop_lib) {
1
+ (function (root, factory) {
2
+ if (typeof define === 'function' && define.amd)
3
+ define(['exports', './2p-solve.js', './kotlin-kotlin-stdlib-js-ir.js', './2p-core.js', './clikt-clikt-js-ir.js', './2p-theory.js', './2p-parser-core.js', './2p-io-lib.js', './2p-oop-lib.js'], factory);
4
+ else if (typeof exports === 'object')
5
+ factory(module.exports, require('./2p-solve.js'), require('./kotlin-kotlin-stdlib-js-ir.js'), require('./2p-core.js'), require('./clikt-clikt-js-ir.js'), require('./2p-theory.js'), require('./2p-parser-core.js'), require('./2p-io-lib.js'), require('./2p-oop-lib.js'));
6
+ else {
7
+ if (typeof this['2p-solve'] === 'undefined') {
8
+ throw new Error("Error loading module '2p-repl'. Its dependency '2p-solve' was not found. Please, check whether '2p-solve' is loaded prior to '2p-repl'.");
9
+ }
10
+ if (typeof this['kotlin-kotlin-stdlib-js-ir'] === 'undefined') {
11
+ throw new Error("Error loading module '2p-repl'. Its dependency 'kotlin-kotlin-stdlib-js-ir' was not found. Please, check whether 'kotlin-kotlin-stdlib-js-ir' is loaded prior to '2p-repl'.");
12
+ }
13
+ if (typeof this['2p-core'] === 'undefined') {
14
+ throw new Error("Error loading module '2p-repl'. Its dependency '2p-core' was not found. Please, check whether '2p-core' is loaded prior to '2p-repl'.");
15
+ }
16
+ if (typeof this['clikt-clikt-js-ir'] === 'undefined') {
17
+ throw new Error("Error loading module '2p-repl'. Its dependency 'clikt-clikt-js-ir' was not found. Please, check whether 'clikt-clikt-js-ir' is loaded prior to '2p-repl'.");
18
+ }
19
+ if (typeof this['2p-theory'] === 'undefined') {
20
+ throw new Error("Error loading module '2p-repl'. Its dependency '2p-theory' was not found. Please, check whether '2p-theory' is loaded prior to '2p-repl'.");
21
+ }
22
+ if (typeof this['2p-parser-core'] === 'undefined') {
23
+ throw new Error("Error loading module '2p-repl'. Its dependency '2p-parser-core' was not found. Please, check whether '2p-parser-core' is loaded prior to '2p-repl'.");
24
+ }
25
+ if (typeof this['2p-io-lib'] === 'undefined') {
26
+ throw new Error("Error loading module '2p-repl'. Its dependency '2p-io-lib' was not found. Please, check whether '2p-io-lib' is loaded prior to '2p-repl'.");
27
+ }
28
+ if (typeof this['2p-oop-lib'] === 'undefined') {
29
+ throw new Error("Error loading module '2p-repl'. Its dependency '2p-oop-lib' was not found. Please, check whether '2p-oop-lib' is loaded prior to '2p-repl'.");
30
+ }
31
+ root['2p-repl'] = factory(typeof this['2p-repl'] === 'undefined' ? {} : this['2p-repl'], this['2p-solve'], this['kotlin-kotlin-stdlib-js-ir'], this['2p-core'], this['clikt-clikt-js-ir'], this['2p-theory'], this['2p-parser-core'], this['2p-io-lib'], this['2p-oop-lib']);
32
+ }
33
+ }(this, function (_, kotlin_it_unibo_tuprolog_solve, kotlin_kotlin, kotlin_it_unibo_tuprolog_core, kotlin_clikt_clikt, kotlin_it_unibo_tuprolog_theory, kotlin_it_unibo_tuprolog_parser_core, kotlin_it_unibo_tuprolog_io_lib, kotlin_it_unibo_tuprolog_oop_lib) {
2
34
  'use strict';
3
35
  //region block: imports
4
- var emptyMap = kotlin_kotlin.$_$.t3;
5
36
  var Halt = kotlin_it_unibo_tuprolog_solve.$_$.r4;
6
- var isInterface = kotlin_kotlin.$_$.y6;
37
+ var isInterface = kotlin_kotlin.$_$.g6;
7
38
  var No = kotlin_it_unibo_tuprolog_solve.$_$.s4;
8
39
  var Yes = kotlin_it_unibo_tuprolog_solve.$_$.t4;
9
- var Companion_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.n2;
40
+ var Companion_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.l2;
10
41
  var format = kotlin_it_unibo_tuprolog_core.$_$.c3;
11
- var ProgramResult = kotlin_com_github_ajalt_clikt_clikt.$_$.b;
12
- var HaltException = kotlin_it_unibo_tuprolog_solve.$_$.t2;
13
- var StringBuilder = kotlin_kotlin.$_$.v9;
14
- var THROW_CCE = kotlin_kotlin.$_$.sb;
15
- var isCharSequence = kotlin_kotlin.$_$.w6;
16
- var trim = kotlin_kotlin.$_$.cb;
17
- var toString = kotlin_kotlin.$_$.n7;
18
- var Unit_getInstance = kotlin_kotlin.$_$.r2;
19
- var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.d2;
20
- var endsWith$default = kotlin_kotlin.$_$.l;
21
- var CliktCommand = kotlin_com_github_ajalt_clikt_clikt.$_$.a;
22
- var charSequenceLength = kotlin_kotlin.$_$.l6;
23
- var charSequenceGet = kotlin_kotlin.$_$.k6;
24
- var toString_0 = kotlin_kotlin.$_$.h2;
42
+ var ProgramResult = kotlin_clikt_clikt.$_$.b;
43
+ var HaltException = kotlin_it_unibo_tuprolog_solve.$_$.r2;
44
+ var StringBuilder = kotlin_kotlin.$_$.h9;
45
+ var THROW_CCE = kotlin_kotlin.$_$.tb;
46
+ var isCharSequence = kotlin_kotlin.$_$.e6;
47
+ var trim = kotlin_kotlin.$_$.db;
48
+ var toString = kotlin_kotlin.$_$.x6;
49
+ var Unit_getInstance = kotlin_kotlin.$_$.v1;
50
+ var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.h1;
51
+ var endsWith = kotlin_kotlin.$_$.n9;
52
+ var VOID = kotlin_kotlin.$_$.gc;
53
+ var CliktCommand = kotlin_clikt_clikt.$_$.a;
54
+ var emptyMap = kotlin_kotlin.$_$.x2;
55
+ var charSequenceLength = kotlin_kotlin.$_$.s5;
56
+ var charSequenceGet = kotlin_kotlin.$_$.r5;
57
+ var toString_0 = kotlin_kotlin.$_$.l1;
25
58
  var titlecase = kotlin_kotlin.$_$.qa;
26
- var isLowerCase = kotlin_kotlin.$_$.ba;
27
- var defaultCliktConsole = kotlin_com_github_ajalt_clikt_clikt.$_$.d;
28
- var classMeta = kotlin_kotlin.$_$.m6;
29
- var setMetadataFor = kotlin_kotlin.$_$.j7;
59
+ var isLowerCase = kotlin_kotlin.$_$.s9;
60
+ var protoOf = kotlin_kotlin.$_$.s6;
61
+ var defaultCliktConsole = kotlin_clikt_clikt.$_$.d;
62
+ var classMeta = kotlin_kotlin.$_$.t5;
63
+ var setMetadataFor = kotlin_kotlin.$_$.t6;
30
64
  var TuPrologException_init_$Init$ = kotlin_it_unibo_tuprolog_core.$_$.m;
31
- var captureStack = kotlin_kotlin.$_$.h6;
65
+ var objectCreate = kotlin_kotlin.$_$.q6;
66
+ var captureStack = kotlin_kotlin.$_$.o5;
32
67
  var TuPrologException = kotlin_it_unibo_tuprolog_core.$_$.l1;
33
- var objectMeta = kotlin_kotlin.$_$.i7;
68
+ var objectMeta = kotlin_kotlin.$_$.r6;
34
69
  var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_theory.$_$.b;
35
- var trimMargin$default = kotlin_kotlin.$_$.a1;
36
- var ParseException = kotlin_it_unibo_tuprolog_parser_core.$_$.d;
70
+ var trimMargin = kotlin_kotlin.$_$.bb;
71
+ var ParseException = kotlin_it_unibo_tuprolog_parser_core.$_$.b;
37
72
  var Companion_getInstance_1 = kotlin_it_unibo_tuprolog_core.$_$.d1;
38
- var parseStructWithOperators = kotlin_it_unibo_tuprolog_parser_core.$_$.f;
73
+ var parseStructWithOperators = kotlin_it_unibo_tuprolog_parser_core.$_$.e;
39
74
  var Companion_getInstance_2 = kotlin_it_unibo_tuprolog_core.$_$.f1;
40
- var joinToString$default = kotlin_kotlin.$_$.e;
41
- var option$default = kotlin_com_github_ajalt_clikt_clikt.$_$.j;
42
- var multiple$default = kotlin_com_github_ajalt_clikt_clikt.$_$.i;
43
- var int = kotlin_com_github_ajalt_clikt_clikt.$_$.e;
44
- var default$default = kotlin_com_github_ajalt_clikt_clikt.$_$.g;
45
- var flag$default = kotlin_com_github_ajalt_clikt_clikt.$_$.h;
46
- var toLong = kotlin_kotlin.$_$.l7;
75
+ var joinToString = kotlin_kotlin.$_$.f3;
76
+ var option = kotlin_clikt_clikt.$_$.i;
77
+ var multiple = kotlin_clikt_clikt.$_$.h;
78
+ var int = kotlin_clikt_clikt.$_$.j;
79
+ var default_0 = kotlin_clikt_clikt.$_$.f;
80
+ var flag = kotlin_clikt_clikt.$_$.g;
81
+ var toLong = kotlin_kotlin.$_$.v6;
47
82
  var Info_getInstance = kotlin_it_unibo_tuprolog_core.$_$.k1;
48
- var Companion_getInstance_3 = kotlin_it_unibo_tuprolog_solve.$_$.n1;
49
- var Companion_getInstance_4 = kotlin_it_unibo_tuprolog_solve.$_$.f2;
83
+ var Companion_getInstance_3 = kotlin_it_unibo_tuprolog_solve.$_$.l1;
84
+ var Companion_getInstance_4 = kotlin_it_unibo_tuprolog_solve.$_$.d2;
50
85
  var IOLib_getInstance = kotlin_it_unibo_tuprolog_io_lib.$_$.a;
51
86
  var arrayConcat = kotlin_kotlin.$_$.a;
52
87
  var OOPLib_getInstance = kotlin_it_unibo_tuprolog_oop_lib.$_$.a;
53
- var Companion_getInstance_5 = kotlin_it_unibo_tuprolog_solve.$_$.p2;
54
- var TrackVariables_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.c2;
55
- var KProperty1 = kotlin_kotlin.$_$.d8;
56
- var getPropertyCallableRef = kotlin_kotlin.$_$.r6;
57
- var NotImplementedError = kotlin_kotlin.$_$.nb;
58
- var parseStruct = kotlin_it_unibo_tuprolog_parser_core.$_$.e;
59
- var argument$default = kotlin_com_github_ajalt_clikt_clikt.$_$.f;
60
- var subcommands = kotlin_com_github_ajalt_clikt_clikt.$_$.c;
88
+ var Companion_getInstance_5 = kotlin_it_unibo_tuprolog_solve.$_$.n2;
89
+ var TrackVariables_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.a2;
90
+ var KProperty1 = kotlin_kotlin.$_$.o7;
91
+ var getPropertyCallableRef = kotlin_kotlin.$_$.z5;
92
+ var NotImplementedError = kotlin_kotlin.$_$.ob;
93
+ var parseStruct = kotlin_it_unibo_tuprolog_parser_core.$_$.d;
94
+ var argument = kotlin_clikt_clikt.$_$.e;
95
+ var subcommands = kotlin_clikt_clikt.$_$.c;
61
96
  //endregion
62
97
  //region block: pre-declaration
63
- setMetadataFor(AbstractTuPrologCommand, 'AbstractTuPrologCommand', classMeta, CliktCommand, undefined, undefined, undefined, []);
64
- setMetadataFor(NullInputException, 'NullInputException', classMeta, TuPrologException, undefined, undefined, undefined, []);
65
- setMetadataFor(Companion, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
66
- setMetadataFor(TuPrologCmd, 'TuPrologCmd', classMeta, AbstractTuPrologCommand, undefined, undefined, undefined, []);
67
- setMetadataFor(TuPrologSolveQuery, 'TuPrologSolveQuery', classMeta, AbstractTuPrologCommand, undefined, undefined, undefined, []);
98
+ setMetadataFor(AbstractTuPrologCommand, 'AbstractTuPrologCommand', classMeta, CliktCommand);
99
+ setMetadataFor(NullInputException, 'NullInputException', classMeta, TuPrologException);
100
+ setMetadataFor(Companion, 'Companion', objectMeta);
101
+ setMetadataFor(TuPrologCmd, 'TuPrologCmd', classMeta, AbstractTuPrologCommand);
102
+ setMetadataFor(TuPrologSolveQuery, 'TuPrologSolveQuery', classMeta, AbstractTuPrologCommand);
68
103
  //endregion
69
- function AbstractTuPrologCommand_init_$Init$(help, epilog, name, invokeWithoutSubcommand, printHelpOnEmptyArgs, helpTags, autoCompleteEnvvar, allowMultipleSubcommands, treatUnknownOptionsAsArgs, hidden, $mask0, $marker, $this) {
70
- if (!(($mask0 & 1) === 0))
71
- help = '';
72
- if (!(($mask0 & 2) === 0))
73
- epilog = '';
74
- if (!(($mask0 & 4) === 0))
75
- name = null;
76
- if (!(($mask0 & 8) === 0))
77
- invokeWithoutSubcommand = false;
78
- if (!(($mask0 & 16) === 0))
79
- printHelpOnEmptyArgs = false;
80
- if (!(($mask0 & 32) === 0))
81
- helpTags = emptyMap();
82
- if (!(($mask0 & 64) === 0))
83
- autoCompleteEnvvar = '';
84
- if (!(($mask0 & 128) === 0))
85
- allowMultipleSubcommands = false;
86
- if (!(($mask0 & 256) === 0))
87
- treatUnknownOptionsAsArgs = false;
88
- if (!(($mask0 & 512) === 0))
89
- hidden = false;
90
- AbstractTuPrologCommand.call($this, help, epilog, name, invokeWithoutSubcommand, printHelpOnEmptyArgs, helpTags, autoCompleteEnvvar, allowMultipleSubcommands, treatUnknownOptionsAsArgs, hidden);
91
- return $this;
92
- }
93
104
  function printSolution($this, sol, operatorSet) {
94
105
  var tmp0_subject = sol;
95
106
  if (isInterface(tmp0_subject, Yes)) {
@@ -105,17 +116,15 @@
105
116
  }
106
117
  }
107
118
  function printYesSolution($this, sol, operatorSet) {
108
- var tmp = format(sol, Companion_getInstance().withOperators(operatorSet));
109
- $this.i3y(tmp, false, false, null, 14, null);
119
+ $this.a3w(format(sol, Companion_getInstance().withOperators(operatorSet)));
110
120
  }
111
121
  function printHaltSolution($this, sol, operatorSet) {
112
- var ex = sol.c1w();
122
+ var ex = sol.y1u();
113
123
  if (ex instanceof HaltException) {
114
- $this.i3y('# goodbye.', false, false, null, 14, null);
124
+ $this.a3w('# goodbye.');
115
125
  throw new ProgramResult(ex.exitStatus);
116
126
  } else {
117
- var tmp = format(sol, Companion_getInstance().withOperators(operatorSet));
118
- $this.i3y(tmp, false, false, null, 14, null);
127
+ $this.a3w(format(sol, Companion_getInstance().withOperators(operatorSet)));
119
128
  }
120
129
  }
121
130
  function printEndOfSolutions($this) {
@@ -128,31 +137,38 @@
128
137
  // Inline function 'kotlin.text.trim' call
129
138
  var tmp0_trim = lastRead;
130
139
  tmp$ret$0 = toString(trim(isCharSequence(tmp0_trim) ? tmp0_trim : THROW_CCE()));
131
- var tmp = tmp$ret$0;
132
- var tmp_0 = _Char___init__impl__6a9atx(46);
133
- if (!!endsWith$default(tmp, tmp_0, false, 2, null)) {
140
+ if (!!endsWith(tmp$ret$0, _Char___init__impl__6a9atx(46))) {
134
141
  break $l$loop;
135
142
  }
136
- var tmp0_elvis_lhs = $this.m3y('>', null, false, false, null, ' ', false, 94, null);
137
- var tmp_1;
143
+ var tmp0_elvis_lhs = $this.e3w('>', VOID, VOID, VOID, VOID, ' ');
144
+ var tmp;
138
145
  if (tmp0_elvis_lhs == null) {
139
146
  throw NullInputException_init_$Create$('The standard input has been closed unexpectedly');
140
147
  } else {
141
- tmp_1 = tmp0_elvis_lhs;
148
+ tmp = tmp0_elvis_lhs;
142
149
  }
143
- lastRead = tmp_1;
144
- longQuery.re(lastRead);
150
+ lastRead = tmp;
151
+ longQuery.te(lastRead);
145
152
  }
146
153
  return longQuery.toString();
147
154
  }
148
155
  function printNoSolution($this, sol, operatorSet) {
149
- var tmp = format(sol, Companion_getInstance().withOperators(operatorSet));
150
- $this.i3y(tmp, false, false, null, 14, null);
156
+ $this.a3w(format(sol, Companion_getInstance().withOperators(operatorSet)));
151
157
  }
152
158
  function AbstractTuPrologCommand(help, epilog, name, invokeWithoutSubcommand, printHelpOnEmptyArgs, helpTags, autoCompleteEnvvar, allowMultipleSubcommands, treatUnknownOptionsAsArgs, hidden) {
159
+ help = help === VOID ? '' : help;
160
+ epilog = epilog === VOID ? '' : epilog;
161
+ name = name === VOID ? null : name;
162
+ invokeWithoutSubcommand = invokeWithoutSubcommand === VOID ? false : invokeWithoutSubcommand;
163
+ printHelpOnEmptyArgs = printHelpOnEmptyArgs === VOID ? false : printHelpOnEmptyArgs;
164
+ helpTags = helpTags === VOID ? emptyMap() : helpTags;
165
+ autoCompleteEnvvar = autoCompleteEnvvar === VOID ? '' : autoCompleteEnvvar;
166
+ allowMultipleSubcommands = allowMultipleSubcommands === VOID ? false : allowMultipleSubcommands;
167
+ treatUnknownOptionsAsArgs = treatUnknownOptionsAsArgs === VOID ? false : treatUnknownOptionsAsArgs;
168
+ hidden = hidden === VOID ? false : hidden;
153
169
  CliktCommand.call(this, help, epilog, name, invokeWithoutSubcommand, printHelpOnEmptyArgs, helpTags, autoCompleteEnvvar, allowMultipleSubcommands, treatUnknownOptionsAsArgs, hidden);
154
170
  }
155
- AbstractTuPrologCommand.prototype.l4a = function (e) {
171
+ protoOf(AbstractTuPrologCommand).d48 = function (e) {
156
172
  var tmp0_safe_receiver = e.message;
157
173
  var tmp;
158
174
  if (tmp0_safe_receiver == null) {
@@ -183,11 +199,10 @@
183
199
  tmp$ret$4 = tmp_0;
184
200
  tmp = tmp$ret$4;
185
201
  }
186
- var tmp_2 = '# ' + tmp;
187
- this.i3y(tmp_2, false, true, null, 10, null);
202
+ this.a3w('# ' + tmp, VOID, true);
188
203
  };
189
- AbstractTuPrologCommand.prototype.m4a = function () {
190
- var query = this.m3y('?-', null, false, false, null, ' ', false, 94, null);
204
+ protoOf(AbstractTuPrologCommand).e48 = function () {
205
+ var query = this.e3w('?-', VOID, VOID, VOID, VOID, ' ');
191
206
  var tmp;
192
207
  if (query == null) {
193
208
  throw NullInputException_init_$Create$('The standard input has been close unexpectedly');
@@ -195,9 +210,7 @@
195
210
  var tmp$ret$0;
196
211
  // Inline function 'kotlin.text.trim' call
197
212
  tmp$ret$0 = toString(trim((!(query == null) ? isCharSequence(query) : false) ? query : THROW_CCE()));
198
- var tmp_0 = tmp$ret$0;
199
- var tmp_1 = _Char___init__impl__6a9atx(46);
200
- if (endsWith$default(tmp_0, tmp_1, false, 2, null)) {
213
+ if (endsWith(tmp$ret$0, _Char___init__impl__6a9atx(46))) {
201
214
  tmp = query;
202
215
  } else {
203
216
  tmp = readQueryMultiline(this, query);
@@ -205,11 +218,11 @@
205
218
  }
206
219
  return tmp;
207
220
  };
208
- AbstractTuPrologCommand.prototype.n4a = function (solutions, operatorSet) {
221
+ protoOf(AbstractTuPrologCommand).f48 = function (solutions, operatorSet) {
209
222
  var first = true;
210
223
  $l$loop: while (solutions.m()) {
211
224
  if (!first) {
212
- var tmp0_safe_receiver = defaultCliktConsole().b46('', false);
225
+ var tmp0_safe_receiver = defaultCliktConsole().t43('', false);
213
226
  var tmp;
214
227
  if (tmp0_safe_receiver == null) {
215
228
  tmp = null;
@@ -225,16 +238,16 @@
225
238
  } else {
226
239
  first = false;
227
240
  }
228
- printSolution(this, solutions.p(), operatorSet);
241
+ printSolution(this, solutions.n(), operatorSet);
229
242
  }
230
243
  printEndOfSolutions(this);
231
244
  };
232
- AbstractTuPrologCommand.prototype.o4a = function (solutions, maxSolutions, operatorSet) {
245
+ protoOf(AbstractTuPrologCommand).g48 = function (solutions, maxSolutions, operatorSet) {
233
246
  var i = 0;
234
247
  while (i < maxSolutions ? solutions.m() : false) {
235
248
  var tmp0 = i;
236
249
  i = tmp0 + 1 | 0;
237
- printSolution(this, solutions.p(), operatorSet);
250
+ printSolution(this, solutions.n(), operatorSet);
238
251
  }
239
252
  printEndOfSolutions(this);
240
253
  };
@@ -248,7 +261,7 @@
248
261
  return $this;
249
262
  }
250
263
  function NullInputException_init_$Create$(message) {
251
- var tmp = NullInputException_init_$Init$_0(message, Object.create(NullInputException.prototype));
264
+ var tmp = NullInputException_init_$Init$_0(message, objectCreate(protoOf(NullInputException)));
252
265
  captureStack(tmp, NullInputException_init_$Create$);
253
266
  return tmp;
254
267
  }
@@ -257,7 +270,7 @@
257
270
  }
258
271
  function Companion() {
259
272
  Companion_instance = this;
260
- this.p4a_1 = 1000;
273
+ this.h48_1 = 1000;
261
274
  }
262
275
  var Companion_instance;
263
276
  function Companion_getInstance_6() {
@@ -266,60 +279,60 @@
266
279
  return Companion_instance;
267
280
  }
268
281
  function _get_files__hkfg7a($this) {
269
- return $this.i4b_1.k46($this, files$factory_0());
282
+ return $this.a49_1.c44($this, files$factory_0());
270
283
  }
271
284
  function _get_timeout__tg4wg($this) {
272
- return $this.j4b_1.k46($this, timeout$factory_0());
285
+ return $this.b49_1.c44($this, timeout$factory_0());
273
286
  }
274
287
  function _get_oop__e6e8e9($this) {
275
- return $this.k4b_1.k46($this, oop$factory_0());
288
+ return $this.c49_1.c44($this, oop$factory_0());
276
289
  }
277
290
  function loadTheory($this) {
278
291
  var theory = Companion_getInstance_0().emptyWithDefaultUnificator();
279
292
  var tmp0_iterator = _get_files__hkfg7a($this).j();
280
293
  while (tmp0_iterator.m()) {
281
- var file = tmp0_iterator.p();
294
+ var file = tmp0_iterator.n();
282
295
  if (isReadableFile(file)) {
283
296
  try {
284
297
  var t = loadTheoryFromFile(file);
285
- var tmp = '# Successfully loaded ' + toString(t.o()) + ' clauses from ' + file;
286
- $this.i3y(tmp, false, false, null, 14, null);
298
+ $this.a3w('# Successfully loaded ' + toString(t.p()) + ' clauses from ' + file);
287
299
  theory = theory.plusTheory(t);
288
300
  } catch ($p) {
289
301
  if ($p instanceof ParseException) {
290
- var tmp_0 = '\n |# Error while parsing theory file: ' + file + '\n |# Message: ' + $p.message + '\n |# Line : ' + $p.line + '\n |# Column : ' + $p.column + '\n |# Clause : ' + $p.clauseIndex + '\n ';
291
- var tmp_1 = trimMargin$default(tmp_0, null, 1, null);
292
- $this.i3y(tmp_1, false, true, null, 10, null);
302
+ var e = $p;
303
+ $this.a3w(trimMargin('\n |# Error while parsing theory file: ' + file + '\n |# Message: ' + e.message + '\n |# Line : ' + e.line + '\n |# Column : ' + e.column + '\n |# Clause : ' + e.clauseIndex + '\n '), VOID, true);
293
304
  } else {
294
305
  throw $p;
295
306
  }
296
307
  }
297
308
  }
298
309
  }
299
- $this.i3y('', false, false, null, 14, null);
310
+ $this.a3w('');
300
311
  return theory;
301
312
  }
302
313
  function readEvalPrintLoop($this, solver) {
303
314
  try {
304
- var query = $this.m4a();
315
+ var query = $this.e48();
305
316
  while (!(query == null)) {
306
317
  try {
307
- var goal = parseStructWithOperators(Companion_getInstance_1(), query, solver.h1v());
308
- var solutions = solver.solveWithTimeout(goal, $this.l4b()).j();
309
- $this.n4a(solutions, solver.h1v());
318
+ var goal = parseStructWithOperators(Companion_getInstance_1(), query, solver.e1u());
319
+ var solutions = solver.solveWithTimeout(goal, $this.d49()).j();
320
+ $this.f48(solutions, solver.e1u());
310
321
  } catch ($p) {
311
322
  if ($p instanceof ParseException) {
312
- $this.l4a($p);
323
+ var e = $p;
324
+ $this.d48(e);
313
325
  } else {
314
326
  throw $p;
315
327
  }
316
328
  }
317
- $this.i3y('', false, false, null, 14, null);
318
- query = $this.m4a();
329
+ $this.a3w('');
330
+ query = $this.e48();
319
331
  }
320
332
  } catch ($p) {
321
333
  if ($p instanceof NullInputException) {
322
- $this.i3y('\n# goodbye.', false, false, null, 14, null);
334
+ var _ = $p;
335
+ $this.a3w('\n# goodbye.');
323
336
  throw new ProgramResult(0);
324
337
  } else {
325
338
  throw $p;
@@ -333,83 +346,74 @@
333
346
  }
334
347
  function TuPrologCmd$getSolver$lambda(this$0) {
335
348
  return function (w) {
336
- var tmp = '# ' + w.message;
337
- this$0.i3y(tmp, false, true, null, 10, null);
349
+ this$0.a3w('# ' + w.message, VOID, true);
338
350
  var sep = '\n at ';
339
- var formatter = Companion_getInstance_2().prettyExpressionsPrettyVariables(w.j5().h1v());
340
- var tmp_0 = w.s1u();
341
- var stacktrace = joinToString$default(tmp_0, sep, null, null, 0, null, TuPrologCmd$getSolver$lambda$lambda(formatter), 30, null);
342
- var tmp_1 = '# at ' + stacktrace;
343
- this$0.i3y(tmp_1, false, true, null, 10, null);
351
+ var formatter = Companion_getInstance_2().prettyExpressionsPrettyVariables(w.n5().e1u());
352
+ var tmp = w.s1t();
353
+ var stacktrace = joinToString(tmp, sep, VOID, VOID, VOID, VOID, TuPrologCmd$getSolver$lambda$lambda(formatter));
354
+ this$0.a3w('# at ' + stacktrace, VOID, true);
344
355
  return Unit_getInstance();
345
356
  };
346
357
  }
347
358
  function TuPrologCmd$getSolver$lambda_0($this$flag) {
348
- return $this$flag.u29_1;
359
+ return $this$flag.x27_1;
349
360
  }
350
361
  function TuPrologCmd(additionalLibraries) {
351
362
  Companion_getInstance_6();
352
- AbstractTuPrologCommand_init_$Init$('Start a Prolog Read-Eval-Print loop', null, 'java -jar 2p-repl.jar', true, false, null, null, true, false, false, 882, null, this);
353
- this.h4b_1 = additionalLibraries;
363
+ AbstractTuPrologCommand.call(this, 'Start a Prolog Read-Eval-Print loop', VOID, 'java -jar 2p-repl.jar', true, VOID, VOID, VOID, true);
364
+ this.z48_1 = additionalLibraries;
365
+ this.a49_1 = multiple(option(this, ['-T', '--theory'], 'Path of theory file to be loaded')).l45(this, files$factory());
354
366
  var tmp = this;
355
- var tmp_0 = option$default(this, ['-T', '--theory'], 'Path of theory file to be loaded', null, false, null, null, null, null, 252, null);
356
- tmp.i4b_1 = multiple$default(tmp_0, null, false, 3, null).t47(this, files$factory());
357
- var tmp_1 = this;
358
367
  Companion_getInstance_6();
359
- var tmp_2 = 'Maximum amount of time for computing a solution (default: ' + 1000 + ' ms)';
360
- var tmp_3 = int(option$default(this, ['-t', '--timeout'], tmp_2, null, false, null, null, null, null, 252, null));
368
+ var tmp_0 = int(option(this, ['-t', '--timeout'], 'Maximum amount of time for computing a solution (default: ' + 1000 + ' ms)'));
361
369
  Companion_getInstance_6();
362
- tmp_1.j4b_1 = default$default(tmp_3, 1000, null, 2, null).t47(this, timeout$factory());
363
- var tmp_4 = this;
364
- var tmp_5 = option$default(this, ['--oop'], 'Loads the OOP library', null, false, null, null, null, null, 252, null);
365
- tmp_4.k4b_1 = flag$default(tmp_5, [], false, null, 5, null).t47(this, oop$factory());
366
- }
367
- TuPrologCmd.prototype.h3z = function () {
368
- var solve = this.m4b();
369
- var subcommand = this.v2b().c3x_1;
370
+ tmp.b49_1 = default_0(tmp_0, 1000).l45(this, timeout$factory());
371
+ this.c49_1 = flag(option(this, ['--oop'], 'Loads the OOP library'), [], false).l45(this, oop$factory());
372
+ }
373
+ protoOf(TuPrologCmd).z3w = function () {
374
+ var solve = this.e49();
375
+ var subcommand = this.y29().u3u_1;
370
376
  if (subcommand == null) {
371
377
  readEvalPrintLoop(this, solve);
372
378
  }
373
379
  };
374
- TuPrologCmd.prototype.l4b = function () {
380
+ protoOf(TuPrologCmd).d49 = function () {
375
381
  return toLong(_get_timeout__tg4wg(this));
376
382
  };
377
- TuPrologCmd.prototype.m4b = function () {
383
+ protoOf(TuPrologCmd).e49 = function () {
378
384
  Info_getInstance();
379
- var tmp = '# 2P-Kt version ' + '0.31.5-dev0c+d53549ad7';
380
- this.i3y(tmp, false, false, null, 14, null);
385
+ this.a3w('# 2P-Kt version ' + '0.1.0-archeo+0c07eb3');
381
386
  var theory = loadTheory(this);
382
- var tmp_0 = Companion_getInstance_3();
383
- var outputChannel = tmp_0.of(TuPrologCmd$getSolver$lambda(this));
384
- var tmp_1;
387
+ var tmp = Companion_getInstance_3();
388
+ var outputChannel = tmp.of(TuPrologCmd$getSolver$lambda(this));
389
+ var tmp_0;
385
390
  if (_get_oop__e6e8e9(this)) {
386
- tmp_1 = Companion_getInstance_4().of(arrayConcat([[IOLib_getInstance(), OOPLib_getInstance()], this.h4b_1]));
391
+ tmp_0 = Companion_getInstance_4().of(arrayConcat([[IOLib_getInstance(), OOPLib_getInstance()], this.z48_1]));
387
392
  } else {
388
- tmp_1 = Companion_getInstance_4().of(arrayConcat([[IOLib_getInstance()], this.h4b_1]));
393
+ tmp_0 = Companion_getInstance_4().of(arrayConcat([[IOLib_getInstance()], this.z48_1]));
389
394
  }
390
- var libraries = tmp_1;
395
+ var libraries = tmp_0;
391
396
  var tmp$ret$2;
392
397
  // Inline function 'kotlin.also' call
393
- var tmp_2 = Companion_getInstance_5().t1x().newBuilder().setRuntime(libraries).setStaticKb(theory);
394
- var tmp_3 = TrackVariables_getInstance();
395
- var tmp0_also = tmp_2.setNotableFlagByValue(tmp_3, TuPrologCmd$getSolver$lambda_0).setWarnings(outputChannel).build();
398
+ var tmp_1 = Companion_getInstance_5().l1w().newBuilder().setRuntime(libraries).setStaticKb(theory);
399
+ var tmp_2 = TrackVariables_getInstance();
400
+ var tmp0_also = tmp_1.setNotableFlagByValue(tmp_2, TuPrologCmd$getSolver$lambda_0).setWarnings(outputChannel).build();
396
401
  // Inline function 'kotlin.contracts.contract' call
397
402
  // Inline function 'it.unibo.tuprolog.ui.repl.TuPrologCmd.getSolver.<anonymous>' call
398
403
  var tmp$ret$0;
399
404
  // Inline function 'kotlin.collections.iterator' call
400
- var tmp0_iterator = tmp0_also.w1u();
405
+ var tmp0_iterator = tmp0_also.v1t();
401
406
  tmp$ret$0 = tmp0_iterator.z().j();
402
407
  var tmp0_iterator_0 = tmp$ret$0;
403
408
  while (tmp0_iterator_0.m()) {
404
- var tmp1_loop_parameter = tmp0_iterator_0.p();
409
+ var tmp1_loop_parameter = tmp0_iterator_0.n();
405
410
  var tmp$ret$1;
406
411
  // Inline function 'kotlin.collections.component2' call
407
412
  tmp$ret$1 = tmp1_loop_parameter.b1();
408
413
  var library = tmp$ret$1;
409
- var tmp_4 = '# Successfully loaded library `' + library.o2e() + '`';
410
- this.i3y(tmp_4, false, false, null, 14, null);
414
+ this.a3w('# Successfully loaded library `' + library.q2c() + '`');
411
415
  }
412
- this.i3y('', false, false, null, 14, null);
416
+ this.a3w('');
413
417
  tmp$ret$2 = tmp0_also;
414
418
  return tmp$ret$2;
415
419
  };
@@ -444,14 +448,14 @@
444
448
  }, null);
445
449
  }
446
450
  function _get_query__c6g9vb($this) {
447
- return $this.e4c_1.k46($this, query$factory_0());
451
+ return $this.w49_1.c44($this, query$factory_0());
448
452
  }
449
453
  function _get_maxSolutions__ysux2t($this) {
450
- return $this.f4c_1.k46($this, maxSolutions$factory_0());
454
+ return $this.x49_1.c44($this, maxSolutions$factory_0());
451
455
  }
452
456
  function _get_parentCommand__z09ff4($this) {
453
- var tmp0_safe_receiver = $this.v2b().m3w_1;
454
- var tmp = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.n3w_1;
457
+ var tmp0_safe_receiver = $this.y29().e3u_1;
458
+ var tmp = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.f3u_1;
455
459
  return tmp instanceof TuPrologCmd ? tmp : THROW_CCE();
456
460
  }
457
461
  function evalAndPrint($this, solver) {
@@ -461,16 +465,17 @@
461
465
  tmp$ret$0 = charSequenceLength(tmp0_isNotEmpty) > 0;
462
466
  if (tmp$ret$0) {
463
467
  try {
464
- var duration = _get_parentCommand__z09ff4($this).l4b();
468
+ var duration = _get_parentCommand__z09ff4($this).d49();
465
469
  var solutions = solver.solveWithTimeout(parseStruct(Companion_getInstance_1(), _get_query__c6g9vb($this)), duration).j();
466
470
  if (_get_maxSolutions__ysux2t($this) === 0) {
467
- $this.n4a(solutions, solver.h1v());
471
+ $this.f48(solutions, solver.e1u());
468
472
  } else {
469
- $this.o4a(solutions, _get_maxSolutions__ysux2t($this), solver.h1v());
473
+ $this.g48(solutions, _get_maxSolutions__ysux2t($this), solver.e1u());
470
474
  }
471
475
  } catch ($p) {
472
476
  if ($p instanceof ParseException) {
473
- $this.l4a($p);
477
+ var e = $p;
478
+ $this.d48(e);
474
479
  } else {
475
480
  throw $p;
476
481
  }
@@ -481,15 +486,12 @@
481
486
  }
482
487
  }
483
488
  function TuPrologSolveQuery() {
484
- AbstractTuPrologCommand_init_$Init$('Compute a particular query and then terminate', null, 'solve', false, false, null, null, false, false, false, 1018, null, this);
485
- var tmp = this;
486
- tmp.e4c_1 = argument$default(this, null, null, null, null, 15, null).l46(this, query$factory());
487
- var tmp_0 = this;
488
- var tmp_1 = int(option$default(this, ['-n', '--numberOfSolutions'], 'Number of solution to calculate', null, false, null, null, null, null, 252, null));
489
- tmp_0.f4c_1 = default$default(tmp_1, 0, null, 2, null).t47(this, maxSolutions$factory());
489
+ AbstractTuPrologCommand.call(this, 'Compute a particular query and then terminate', VOID, 'solve');
490
+ this.w49_1 = argument(this).d44(this, query$factory());
491
+ this.x49_1 = default_0(int(option(this, ['-n', '--numberOfSolutions'], 'Number of solution to calculate')), 0).l45(this, maxSolutions$factory());
490
492
  }
491
- TuPrologSolveQuery.prototype.h3z = function () {
492
- var solver = _get_parentCommand__z09ff4(this).m4b();
493
+ protoOf(TuPrologSolveQuery).z3w = function () {
494
+ var solver = _get_parentCommand__z09ff4(this).e49();
493
495
  evalAndPrint(this, solver);
494
496
  };
495
497
  function query$factory() {
@@ -521,13 +523,13 @@
521
523
  throw new NotImplementedError('An operation is not implemented: Not yet implemented');
522
524
  }
523
525
  function main(args) {
524
- subcommands(new TuPrologCmd([]), [new TuPrologSolveQuery()]).g3z(args);
526
+ subcommands(new TuPrologCmd([]), [new TuPrologSolveQuery()]).y3w(args);
525
527
  }
526
528
  //region block: exports
527
529
  _.$_$ = _.$_$ || {};
528
530
  _.$_$.a = main;
529
531
  //endregion
530
532
  return _;
531
- }(module.exports, require('./kotlin-kotlin-stdlib-js-ir.js'), require('./2p-solve.js'), require('./2p-core.js'), require('./clikt-clikt-js-ir.js'), require('./2p-theory.js'), require('./2p-parser-core.js'), require('./2p-io-lib.js'), require('./2p-oop-lib.js')));
533
+ }));
532
534
 
533
535
  //# sourceMappingURL=2p-repl.js.map