@tuprolog/2p-full 0.30.5 → 0.31.1-dev02
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.
- package/2p-bdd.js +609 -0
- package/2p-bdd.js.map +1 -0
- package/2p-core.js +12057 -0
- package/2p-core.js.map +1 -0
- package/2p-datalog.js +8 -0
- package/2p-datalog.js.map +1 -0
- package/2p-dsl-core.js +8 -0
- package/2p-dsl-core.js.map +1 -0
- package/2p-dsl-solve.js +8 -0
- package/2p-dsl-solve.js.map +1 -0
- package/2p-dsl-theory.js +8 -0
- package/2p-dsl-theory.js.map +1 -0
- package/2p-dsl-unify.js +8 -0
- package/2p-dsl-unify.js.map +1 -0
- package/2p-full.d.ts +270 -0
- package/2p-full.js +21 -0
- package/2p-full.js.map +1 -0
- package/2p-io-lib.js +3600 -0
- package/2p-io-lib.js.map +1 -0
- package/2p-oop-lib.js +3660 -0
- package/2p-oop-lib.js.map +1 -0
- package/2p-parser-core.js +1450 -0
- package/2p-parser-core.js.map +1 -0
- package/2p-parser-js.js +29 -0
- package/2p-parser-js.js.map +1 -0
- package/2p-parser-theory.js +114 -0
- package/2p-parser-theory.js.map +1 -0
- package/2p-repl.js +519 -0
- package/2p-repl.js.map +1 -0
- package/2p-serialize-core.js +8 -0
- package/2p-serialize-core.js.map +1 -0
- package/2p-serialize-theory.js +8 -0
- package/2p-serialize-theory.js.map +1 -0
- package/2p-solve-classic.js +3329 -0
- package/2p-solve-classic.js.map +1 -0
- package/2p-solve-concurrent.js +8 -0
- package/2p-solve-concurrent.js.map +1 -0
- package/2p-solve-plp.js +44 -0
- package/2p-solve-plp.js.map +1 -0
- package/2p-solve-problog.js +4547 -0
- package/2p-solve-problog.js.map +1 -0
- package/2p-solve-streams.js +3028 -0
- package/2p-solve-streams.js.map +1 -0
- package/2p-solve.js +16824 -0
- package/2p-solve.js.map +1 -0
- package/2p-theory.js +4902 -0
- package/2p-theory.js.map +1 -0
- package/2p-unify.js +957 -0
- package/2p-unify.js.map +1 -0
- package/2p-utils.js +1423 -0
- package/2p-utils.js.map +1 -0
- package/88b0986a7186d029-atomicfu-js-ir.js +8 -0
- package/88b0986a7186d029-atomicfu-js-ir.js.map +1 -0
- package/clikt-clikt-js-ir.js +7240 -0
- package/clikt-clikt-js-ir.js.map +1 -0
- package/kotlin-kotlin-stdlib-js-ir.js +11847 -0
- package/kotlin-kotlin-stdlib-js-ir.js.map +1 -0
- package/kotlin-kotlinx-atomicfu-runtime-js-ir.js +8 -0
- package/kotlin-kotlinx-atomicfu-runtime-js-ir.js.map +1 -0
- package/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js +8 -0
- package/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js.map +1 -0
- package/kt-math.js +11348 -0
- package/kt-math.js.map +1 -0
- package/package.json +4 -36
- package/CONTRIBUTORS +0 -10
- package/LICENSE +0 -202
- package/kotlin/2p-full/it/unibo/tuprolog/tuprolog.kjsm +0 -0
- package/kotlin/2p-full.js +0 -15
- package/kotlin/2p-full.js.map +0 -1
- package/kotlin/2p-full.meta.js +0 -1
|
@@ -0,0 +1,3028 @@
|
|
|
1
|
+
(function (_, kotlin_kotlin, kotlin_it_unibo_tuprolog_solve, kotlin_it_unibo_tuprolog_utils, kotlin_it_unibo_tuprolog_unify, kotlin_it_unibo_tuprolog_core, kotlin_it_unibo_tuprolog_theory) {
|
|
2
|
+
'use strict';
|
|
3
|
+
//region block: imports
|
|
4
|
+
var imul = Math.imul;
|
|
5
|
+
var first = kotlin_kotlin.$_$.t8;
|
|
6
|
+
var classMeta = kotlin_kotlin.$_$.m6;
|
|
7
|
+
var setMetadataFor = kotlin_kotlin.$_$.j7;
|
|
8
|
+
var objectMeta = kotlin_kotlin.$_$.i7;
|
|
9
|
+
var isInterface = kotlin_kotlin.$_$.y6;
|
|
10
|
+
var Companion_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.m1;
|
|
11
|
+
var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_solve.$_$.o1;
|
|
12
|
+
var filter = kotlin_kotlin.$_$.r8;
|
|
13
|
+
var THROW_CCE = kotlin_kotlin.$_$.sb;
|
|
14
|
+
var Sequence = kotlin_kotlin.$_$.f8;
|
|
15
|
+
var Unit_getInstance = kotlin_kotlin.$_$.r2;
|
|
16
|
+
var map = kotlin_kotlin.$_$.c9;
|
|
17
|
+
var getAllOperators = kotlin_it_unibo_tuprolog_solve.$_$.t5;
|
|
18
|
+
var toOperatorSet = kotlin_it_unibo_tuprolog_solve.$_$.v5;
|
|
19
|
+
var Long = kotlin_kotlin.$_$.mb;
|
|
20
|
+
var extractSignature = kotlin_it_unibo_tuprolog_solve.$_$.s5;
|
|
21
|
+
var Request_init_$Create$ = kotlin_it_unibo_tuprolog_solve.$_$.f1;
|
|
22
|
+
var take = kotlin_kotlin.$_$.m9;
|
|
23
|
+
var buffered = kotlin_it_unibo_tuprolog_utils.$_$.q;
|
|
24
|
+
var copy$default = kotlin_it_unibo_tuprolog_solve.$_$.u;
|
|
25
|
+
var solveWithTimeout = kotlin_it_unibo_tuprolog_solve.$_$.b5;
|
|
26
|
+
var solve = kotlin_it_unibo_tuprolog_solve.$_$.c5;
|
|
27
|
+
var solveListWithTimeout = kotlin_it_unibo_tuprolog_solve.$_$.w4;
|
|
28
|
+
var solveList = kotlin_it_unibo_tuprolog_solve.$_$.v4;
|
|
29
|
+
var solveListWithOptions = kotlin_it_unibo_tuprolog_solve.$_$.x4;
|
|
30
|
+
var solveOnceWithTimeout = kotlin_it_unibo_tuprolog_solve.$_$.y4;
|
|
31
|
+
var solveOnce = kotlin_it_unibo_tuprolog_solve.$_$.a5;
|
|
32
|
+
var solveOnceWithOptions = kotlin_it_unibo_tuprolog_solve.$_$.z4;
|
|
33
|
+
var clone = kotlin_it_unibo_tuprolog_solve.$_$.u4;
|
|
34
|
+
var get_standardInput = kotlin_it_unibo_tuprolog_solve.$_$.g4;
|
|
35
|
+
var get_standardOutput = kotlin_it_unibo_tuprolog_solve.$_$.h4;
|
|
36
|
+
var get_standardError = kotlin_it_unibo_tuprolog_solve.$_$.f4;
|
|
37
|
+
var get_warnings = kotlin_it_unibo_tuprolog_solve.$_$.i4;
|
|
38
|
+
var Solver = kotlin_it_unibo_tuprolog_solve.$_$.q5;
|
|
39
|
+
var solverOf$default = kotlin_it_unibo_tuprolog_solve.$_$.z;
|
|
40
|
+
var solverOf$default_0 = kotlin_it_unibo_tuprolog_solve.$_$.y;
|
|
41
|
+
var NotImplementedError = kotlin_kotlin.$_$.nb;
|
|
42
|
+
var mutableSolverOf$default = kotlin_it_unibo_tuprolog_solve.$_$.v;
|
|
43
|
+
var mutableSolverOf$default_0 = kotlin_it_unibo_tuprolog_solve.$_$.w;
|
|
44
|
+
var newBuilder = kotlin_it_unibo_tuprolog_solve.$_$.n5;
|
|
45
|
+
var get_defaultRuntime = kotlin_it_unibo_tuprolog_solve.$_$.i5;
|
|
46
|
+
var get_defaultUnificator = kotlin_it_unibo_tuprolog_solve.$_$.k5;
|
|
47
|
+
var get_defaultFlags = kotlin_it_unibo_tuprolog_solve.$_$.f5;
|
|
48
|
+
var get_defaultStaticKb = kotlin_it_unibo_tuprolog_solve.$_$.j5;
|
|
49
|
+
var get_defaultDynamicKb = kotlin_it_unibo_tuprolog_solve.$_$.d5;
|
|
50
|
+
var get_defaultInputChannel = kotlin_it_unibo_tuprolog_solve.$_$.g5;
|
|
51
|
+
var get_defaultOutputChannel = kotlin_it_unibo_tuprolog_solve.$_$.h5;
|
|
52
|
+
var get_defaultErrorChannel = kotlin_it_unibo_tuprolog_solve.$_$.e5;
|
|
53
|
+
var get_defaultWarningsChannel = kotlin_it_unibo_tuprolog_solve.$_$.l5;
|
|
54
|
+
var solverWithDefaultBuiltins = kotlin_it_unibo_tuprolog_solve.$_$.o5;
|
|
55
|
+
var solverWithDefaultBuiltins$default = kotlin_it_unibo_tuprolog_solve.$_$.a1;
|
|
56
|
+
var mutableSolverWithDefaultBuiltins = kotlin_it_unibo_tuprolog_solve.$_$.m5;
|
|
57
|
+
var mutableSolverWithDefaultBuiltins$default = kotlin_it_unibo_tuprolog_solve.$_$.x;
|
|
58
|
+
var SolverFactory = kotlin_it_unibo_tuprolog_solve.$_$.p5;
|
|
59
|
+
var emptyList = kotlin_kotlin.$_$.s3;
|
|
60
|
+
var emptySequence = kotlin_kotlin.$_$.n8;
|
|
61
|
+
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.c1;
|
|
62
|
+
var firstOrNull = kotlin_kotlin.$_$.w3;
|
|
63
|
+
var plus = kotlin_kotlin.$_$.h9;
|
|
64
|
+
var toMutableList = kotlin_kotlin.$_$.t5;
|
|
65
|
+
var first_0 = kotlin_kotlin.$_$.x3;
|
|
66
|
+
var listOf = kotlin_kotlin.$_$.h4;
|
|
67
|
+
var lastOrNull = kotlin_kotlin.$_$.d4;
|
|
68
|
+
var contains = kotlin_kotlin.$_$.j8;
|
|
69
|
+
var Companion_getInstance_1 = kotlin_it_unibo_tuprolog_unify.$_$.a;
|
|
70
|
+
var equals = kotlin_kotlin.$_$.o6;
|
|
71
|
+
var plus_0 = kotlin_kotlin.$_$.f9;
|
|
72
|
+
var Collection = kotlin_kotlin.$_$.t2;
|
|
73
|
+
var hashCode = kotlin_kotlin.$_$.t6;
|
|
74
|
+
var Companion_getInstance_2 = kotlin_it_unibo_tuprolog_core.$_$.t;
|
|
75
|
+
var copyToArray = kotlin_kotlin.$_$.p3;
|
|
76
|
+
var Unifier = kotlin_it_unibo_tuprolog_core.$_$.a2;
|
|
77
|
+
var Companion_getInstance_3 = kotlin_it_unibo_tuprolog_core.$_$.e1;
|
|
78
|
+
var Companion_getInstance_4 = kotlin_it_unibo_tuprolog_core.$_$.u;
|
|
79
|
+
var prepareForExecution = kotlin_it_unibo_tuprolog_core.$_$.e3;
|
|
80
|
+
var single = kotlin_kotlin.$_$.f5;
|
|
81
|
+
var any = kotlin_kotlin.$_$.g8;
|
|
82
|
+
var sequence = kotlin_kotlin.$_$.j9;
|
|
83
|
+
var drop = kotlin_kotlin.$_$.r3;
|
|
84
|
+
var plus_1 = kotlin_kotlin.$_$.a5;
|
|
85
|
+
var indexOf = kotlin_kotlin.$_$.x8;
|
|
86
|
+
var CoroutineImpl = kotlin_kotlin.$_$.c6;
|
|
87
|
+
var SequenceScope = kotlin_kotlin.$_$.e8;
|
|
88
|
+
var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.b6;
|
|
89
|
+
var filterIndexed = kotlin_kotlin.$_$.o8;
|
|
90
|
+
var Companion_getInstance_5 = kotlin_it_unibo_tuprolog_solve.$_$.f2;
|
|
91
|
+
var Companion_getInstance_6 = kotlin_it_unibo_tuprolog_solve.$_$.a2;
|
|
92
|
+
var Companion_getInstance_7 = kotlin_it_unibo_tuprolog_theory.$_$.b;
|
|
93
|
+
var Companion_getInstance_8 = kotlin_it_unibo_tuprolog_solve.$_$.p1;
|
|
94
|
+
var currentTimeInstant = kotlin_it_unibo_tuprolog_solve.$_$.r5;
|
|
95
|
+
var Companion_getInstance_9 = kotlin_kotlin.$_$.q2;
|
|
96
|
+
var asSequence = kotlin_kotlin.$_$.g3;
|
|
97
|
+
var toList = kotlin_kotlin.$_$.p9;
|
|
98
|
+
var lazy = kotlin_kotlin.$_$.xb;
|
|
99
|
+
var collectionSizeOrDefault = kotlin_kotlin.$_$.j3;
|
|
100
|
+
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.b1;
|
|
101
|
+
var createSolver$default = kotlin_it_unibo_tuprolog_solve.$_$.s;
|
|
102
|
+
var createMutableSolver$default = kotlin_it_unibo_tuprolog_solve.$_$.r;
|
|
103
|
+
var apply = kotlin_it_unibo_tuprolog_solve.$_$.d4;
|
|
104
|
+
var applyIterable = kotlin_it_unibo_tuprolog_solve.$_$.c4;
|
|
105
|
+
var applySequence = kotlin_it_unibo_tuprolog_solve.$_$.e4;
|
|
106
|
+
var update$default = kotlin_it_unibo_tuprolog_solve.$_$.t;
|
|
107
|
+
var toString = kotlin_kotlin.$_$.n7;
|
|
108
|
+
var get_endTime = kotlin_it_unibo_tuprolog_solve.$_$.a4;
|
|
109
|
+
var get_remainingTime = kotlin_it_unibo_tuprolog_solve.$_$.b4;
|
|
110
|
+
var get_elapsedTime = kotlin_it_unibo_tuprolog_solve.$_$.z3;
|
|
111
|
+
var ExecutionContext = kotlin_it_unibo_tuprolog_solve.$_$.j4;
|
|
112
|
+
var KProperty1 = kotlin_kotlin.$_$.d8;
|
|
113
|
+
var getPropertyCallableRef = kotlin_kotlin.$_$.r6;
|
|
114
|
+
var interfaceMeta = kotlin_kotlin.$_$.u6;
|
|
115
|
+
var sequenceOf = kotlin_kotlin.$_$.i9;
|
|
116
|
+
var drop_0 = kotlin_kotlin.$_$.m8;
|
|
117
|
+
var TimeOutException_init_$Create$ = kotlin_it_unibo_tuprolog_solve.$_$.d1;
|
|
118
|
+
var getKClassFromExpression = kotlin_kotlin.$_$.b;
|
|
119
|
+
var Halt = kotlin_it_unibo_tuprolog_solve.$_$.r4;
|
|
120
|
+
var Yes = kotlin_it_unibo_tuprolog_solve.$_$.t4;
|
|
121
|
+
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.p1;
|
|
122
|
+
var No = kotlin_it_unibo_tuprolog_solve.$_$.s4;
|
|
123
|
+
var Companion_getInstance_10 = kotlin_it_unibo_tuprolog_core.$_$.d1;
|
|
124
|
+
var LogicError = kotlin_it_unibo_tuprolog_solve.$_$.u2;
|
|
125
|
+
var HaltException = kotlin_it_unibo_tuprolog_solve.$_$.t2;
|
|
126
|
+
var flatMap = kotlin_kotlin.$_$.u8;
|
|
127
|
+
var asIterable = kotlin_kotlin.$_$.h8;
|
|
128
|
+
var Rule = kotlin_it_unibo_tuprolog_core.$_$.y1;
|
|
129
|
+
var none = kotlin_kotlin.$_$.e9;
|
|
130
|
+
var Struct = kotlin_it_unibo_tuprolog_core.$_$.z1;
|
|
131
|
+
var ExtensionLibrary = kotlin_it_unibo_tuprolog_solve.$_$.z2;
|
|
132
|
+
var CommonBuiltins_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.l2;
|
|
133
|
+
var listOf_0 = kotlin_kotlin.$_$.i4;
|
|
134
|
+
var containsSignature = kotlin_it_unibo_tuprolog_solve.$_$.b3;
|
|
135
|
+
var containsOperator = kotlin_it_unibo_tuprolog_solve.$_$.a3;
|
|
136
|
+
var hasPrimitive = kotlin_it_unibo_tuprolog_solve.$_$.d3;
|
|
137
|
+
var hasFunction = kotlin_it_unibo_tuprolog_solve.$_$.c3;
|
|
138
|
+
var get_ruleSignatures = kotlin_it_unibo_tuprolog_solve.$_$.f3;
|
|
139
|
+
var hasProtected = kotlin_it_unibo_tuprolog_solve.$_$.e3;
|
|
140
|
+
var PrimitiveWrapper = kotlin_it_unibo_tuprolog_solve.$_$.l3;
|
|
141
|
+
var PrimitiveWrapper_init_$Init$ = kotlin_it_unibo_tuprolog_solve.$_$.e1;
|
|
142
|
+
var Companion_getInstance_11 = kotlin_it_unibo_tuprolog_solve.$_$.g2;
|
|
143
|
+
var Expected_CALLABLE_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.k;
|
|
144
|
+
var TypeError_init_$Create$ = kotlin_it_unibo_tuprolog_solve.$_$.b1;
|
|
145
|
+
var last = kotlin_kotlin.$_$.e4;
|
|
146
|
+
var first_1 = kotlin_kotlin.$_$.y3;
|
|
147
|
+
var Pair = kotlin_kotlin.$_$.qb;
|
|
148
|
+
var Companion_getInstance_12 = kotlin_it_unibo_tuprolog_core.$_$.h1;
|
|
149
|
+
var ErrorUtils_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.r1;
|
|
150
|
+
var Companion_getInstance_13 = kotlin_it_unibo_tuprolog_solve.$_$.z1;
|
|
151
|
+
var NonBacktrackable = kotlin_it_unibo_tuprolog_solve.$_$.u3;
|
|
152
|
+
var Companion_getInstance_14 = kotlin_it_unibo_tuprolog_solve.$_$.x1;
|
|
153
|
+
//endregion
|
|
154
|
+
//region block: pre-declaration
|
|
155
|
+
setMetadataFor(SolverStrategies$Companion$prologStandard$1, undefined, classMeta, undefined, undefined, undefined, undefined, []);
|
|
156
|
+
setMetadataFor(Companion, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
|
|
157
|
+
setMetadataFor(Companion_0, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
|
|
158
|
+
setMetadataFor(StreamsSolver, 'StreamsSolver', classMeta, undefined, [Solver], undefined, undefined, []);
|
|
159
|
+
setMetadataFor(StreamsSolverFactory, 'StreamsSolverFactory', objectMeta, undefined, [SolverFactory], undefined, undefined, []);
|
|
160
|
+
setMetadataFor(SideEffectManagerImpl, 'SideEffectManagerImpl', classMeta, undefined, undefined, undefined, undefined, []);
|
|
161
|
+
setMetadataFor(orderWithStrategy$slambda, 'orderWithStrategy$slambda', classMeta, CoroutineImpl, undefined, undefined, undefined, [1]);
|
|
162
|
+
setMetadataFor(StreamsExecutionContext, 'StreamsExecutionContext', classMeta, undefined, [ExecutionContext], undefined, undefined, []);
|
|
163
|
+
setMetadataFor(AbstractState, 'AbstractState', classMeta, undefined, undefined, undefined, undefined, []);
|
|
164
|
+
setMetadataFor(AlreadyExecutedState, 'AlreadyExecutedState', classMeta, undefined, undefined, undefined, undefined, []);
|
|
165
|
+
setMetadataFor(FinalState, 'FinalState', interfaceMeta, undefined, undefined, undefined, undefined, []);
|
|
166
|
+
function get_context() {
|
|
167
|
+
var tmp = this.h4c().context;
|
|
168
|
+
return tmp instanceof StreamsExecutionContext ? tmp : THROW_CCE();
|
|
169
|
+
}
|
|
170
|
+
setMetadataFor(IntermediateState, 'IntermediateState', interfaceMeta, undefined, undefined, undefined, undefined, []);
|
|
171
|
+
setMetadataFor(StateMachineExecutor$internalExecute$slambda, 'StateMachineExecutor$internalExecute$slambda', classMeta, CoroutineImpl, undefined, undefined, undefined, [1]);
|
|
172
|
+
setMetadataFor(StateMachineExecutor, 'StateMachineExecutor', objectMeta, undefined, undefined, undefined, undefined, []);
|
|
173
|
+
setMetadataFor(Companion_1, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
|
|
174
|
+
setMetadataFor(AbstractTimedState, 'AbstractTimedState', classMeta, AbstractState, [AbstractState, IntermediateState], undefined, undefined, []);
|
|
175
|
+
setMetadataFor(StateEnd, 'StateEnd', classMeta, AbstractState, [AbstractState, FinalState], undefined, undefined, []);
|
|
176
|
+
setMetadataFor(True, 'True', classMeta, StateEnd, [StateEnd, FinalState], undefined, undefined, []);
|
|
177
|
+
setMetadataFor(False, 'False', classMeta, StateEnd, [StateEnd, FinalState], undefined, undefined, []);
|
|
178
|
+
setMetadataFor(Halt_0, 'Halt', classMeta, StateEnd, [StateEnd, FinalState], undefined, undefined, []);
|
|
179
|
+
setMetadataFor(Companion_2, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
|
|
180
|
+
setMetadataFor(StateGoalEvaluation$behaveTimed$slambda, 'StateGoalEvaluation$behaveTimed$slambda', classMeta, CoroutineImpl, undefined, undefined, undefined, [1]);
|
|
181
|
+
setMetadataFor(StateGoalEvaluation, 'StateGoalEvaluation', classMeta, AbstractTimedState, undefined, undefined, undefined, []);
|
|
182
|
+
setMetadataFor(StateInit$behaveTimed$slambda, 'StateInit$behaveTimed$slambda', classMeta, CoroutineImpl, undefined, undefined, undefined, [1]);
|
|
183
|
+
setMetadataFor(StateInit, 'StateInit', classMeta, AbstractTimedState, undefined, undefined, undefined, []);
|
|
184
|
+
setMetadataFor(Companion_3, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
|
|
185
|
+
setMetadataFor(StateRuleSelection$behaveTimed$slambda, 'StateRuleSelection$behaveTimed$slambda', classMeta, CoroutineImpl, undefined, undefined, undefined, [1]);
|
|
186
|
+
setMetadataFor(StateRuleSelection, 'StateRuleSelection', classMeta, AbstractTimedState, undefined, undefined, undefined, []);
|
|
187
|
+
setMetadataFor(DefaultBuiltins, 'DefaultBuiltins', objectMeta, ExtensionLibrary, undefined, undefined, undefined, []);
|
|
188
|
+
setMetadataFor(Call, 'Call', objectMeta, PrimitiveWrapper, undefined, undefined, undefined, []);
|
|
189
|
+
setMetadataFor(Catch$uncheckedImplementation$slambda, 'Catch$uncheckedImplementation$slambda', classMeta, CoroutineImpl, undefined, undefined, undefined, [1]);
|
|
190
|
+
setMetadataFor(Catch, 'Catch', objectMeta, PrimitiveWrapper, undefined, undefined, undefined, []);
|
|
191
|
+
setMetadataFor(Conjunction$uncheckedImplementation$slambda, 'Conjunction$uncheckedImplementation$slambda', classMeta, CoroutineImpl, undefined, undefined, undefined, [1]);
|
|
192
|
+
setMetadataFor($solveConjunctionGoalsCOROUTINE$0, '$solveConjunctionGoalsCOROUTINE$0', classMeta, CoroutineImpl, undefined, undefined, undefined, []);
|
|
193
|
+
setMetadataFor(Conjunction, 'Conjunction', objectMeta, PrimitiveWrapper, undefined, undefined, undefined, [7]);
|
|
194
|
+
setMetadataFor(Cut, 'Cut', objectMeta, PrimitiveWrapper, undefined, undefined, undefined, []);
|
|
195
|
+
setMetadataFor(Not$uncheckedImplementation$slambda, 'Not$uncheckedImplementation$slambda', classMeta, CoroutineImpl, undefined, undefined, undefined, [1]);
|
|
196
|
+
setMetadataFor(Not, 'Not', objectMeta, PrimitiveWrapper, undefined, undefined, undefined, []);
|
|
197
|
+
setMetadataFor(Throw, 'Throw', objectMeta, NonBacktrackable, undefined, undefined, undefined, []);
|
|
198
|
+
//endregion
|
|
199
|
+
function SolverStrategies$Companion$prologStandard$1() {
|
|
200
|
+
}
|
|
201
|
+
SolverStrategies$Companion$prologStandard$1.prototype.d4c = function (predicationSequence, context) {
|
|
202
|
+
return first(predicationSequence);
|
|
203
|
+
};
|
|
204
|
+
SolverStrategies$Companion$prologStandard$1.prototype.e4c = function (unifiableClauses, context) {
|
|
205
|
+
return first(unifiableClauses);
|
|
206
|
+
};
|
|
207
|
+
SolverStrategies$Companion$prologStandard$1.prototype.f4c = function (term, context) {
|
|
208
|
+
return term.dw();
|
|
209
|
+
};
|
|
210
|
+
function Companion() {
|
|
211
|
+
Companion_instance = this;
|
|
212
|
+
var tmp = this;
|
|
213
|
+
tmp.g4c_1 = new SolverStrategies$Companion$prologStandard$1();
|
|
214
|
+
}
|
|
215
|
+
var Companion_instance;
|
|
216
|
+
function Companion_getInstance_15() {
|
|
217
|
+
if (Companion_instance == null)
|
|
218
|
+
new Companion();
|
|
219
|
+
return Companion_instance;
|
|
220
|
+
}
|
|
221
|
+
function StreamsSolver$Companion$solveToFinalStates$lambda(it) {
|
|
222
|
+
return !(it == null) ? isInterface(it, FinalState) : false;
|
|
223
|
+
}
|
|
224
|
+
function StreamsSolver$Companion$solveToFinalStates$lambda_0($goalRequest) {
|
|
225
|
+
return function (it) {
|
|
226
|
+
return it.h4c().solution.x1v().equals($goalRequest.x1v());
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
function StreamsSolver$Companion$solveToResponses$lambda(it) {
|
|
230
|
+
return it.h4c();
|
|
231
|
+
}
|
|
232
|
+
function StreamsSolver_init_$Init$(unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings, $this) {
|
|
233
|
+
StreamsSolver.call($this, unificator, libraries, flags, staticKb, dynamicKb, Companion_getInstance().p1y(stdIn), Companion_getInstance_0().s1y(stdOut, stdErr, warnings));
|
|
234
|
+
return $this;
|
|
235
|
+
}
|
|
236
|
+
function StreamsSolver_init_$Create$(unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings) {
|
|
237
|
+
return StreamsSolver_init_$Init$(unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings, Object.create(StreamsSolver.prototype));
|
|
238
|
+
}
|
|
239
|
+
function Companion_0() {
|
|
240
|
+
Companion_instance_0 = this;
|
|
241
|
+
}
|
|
242
|
+
Companion_0.prototype.i4c = function (goalRequest) {
|
|
243
|
+
var tmp$ret$0;
|
|
244
|
+
// Inline function 'kotlin.sequences.filterIsInstance' call
|
|
245
|
+
var tmp0_filterIsInstance = StateMachineExecutor_getInstance().j4c(new StateInit(goalRequest));
|
|
246
|
+
var tmp = filter(tmp0_filterIsInstance, StreamsSolver$Companion$solveToFinalStates$lambda);
|
|
247
|
+
tmp$ret$0 = isInterface(tmp, Sequence) ? tmp : THROW_CCE();
|
|
248
|
+
var tmp_0 = tmp$ret$0;
|
|
249
|
+
return filter(tmp_0, StreamsSolver$Companion$solveToFinalStates$lambda_0(goalRequest));
|
|
250
|
+
};
|
|
251
|
+
Companion_0.prototype.k4c = function (goalRequest) {
|
|
252
|
+
var tmp = this.i4c(goalRequest);
|
|
253
|
+
return map(tmp, StreamsSolver$Companion$solveToResponses$lambda);
|
|
254
|
+
};
|
|
255
|
+
var Companion_instance_0;
|
|
256
|
+
function Companion_getInstance_16() {
|
|
257
|
+
if (Companion_instance_0 == null)
|
|
258
|
+
new Companion_0();
|
|
259
|
+
return Companion_instance_0;
|
|
260
|
+
}
|
|
261
|
+
function StreamsSolver$solve$lambda(this$0) {
|
|
262
|
+
return function (it) {
|
|
263
|
+
this$0.l4c_1 = it.j5().z36(it.h4c().sideEffects);
|
|
264
|
+
return it.h4c().solution.cleanUp();
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
function StreamsSolver(unificator, libraries, flags, staticKb, dynamicKb, inputChannels, outputChannels) {
|
|
268
|
+
Companion_getInstance_16();
|
|
269
|
+
var tmp = this;
|
|
270
|
+
var tmp_0 = toOperatorSet(getAllOperators(libraries, [staticKb, dynamicKb]));
|
|
271
|
+
var tmp_1 = new Long(0, 0);
|
|
272
|
+
var tmp_2 = new Long(0, 0);
|
|
273
|
+
tmp.l4c_1 = StreamsExecutionContext_init_$Create$(unificator, libraries, flags, staticKb, dynamicKb, tmp_0, inputChannels, outputChannels, null, null, tmp_1, tmp_2, null, null, 16128, null);
|
|
274
|
+
}
|
|
275
|
+
StreamsSolver.prototype.u2b = function (goal, options) {
|
|
276
|
+
var tmp = this;
|
|
277
|
+
var tmp_0 = this.k1l();
|
|
278
|
+
var tmp_1 = this.w1u();
|
|
279
|
+
var tmp_2 = this.x1u();
|
|
280
|
+
var tmp_3 = this.y1u();
|
|
281
|
+
var tmp_4 = this.z1u();
|
|
282
|
+
var tmp_5 = this.a1v();
|
|
283
|
+
var tmp_6 = this.b1v();
|
|
284
|
+
var tmp_7 = new Long(0, 0);
|
|
285
|
+
var tmp_8 = options.j1x();
|
|
286
|
+
tmp.l4c_1 = StreamsExecutionContext_init_$Create$(tmp_0, tmp_1, tmp_2, tmp_3, tmp_4, null, tmp_5, tmp_6, null, null, tmp_7, tmp_8, null, null, 14112, null);
|
|
287
|
+
var tmp_9 = Companion_getInstance_16();
|
|
288
|
+
var tmp_10 = extractSignature(goal);
|
|
289
|
+
var tmp_11 = goal.gw();
|
|
290
|
+
var tmp_12 = this.l4c_1;
|
|
291
|
+
var tmp_13 = new Long(0, 0);
|
|
292
|
+
var tmp_14 = tmp_9.i4c(Request_init_$Create$(tmp_10, tmp_11, tmp_12, tmp_13, new Long(0, 0), 24, null));
|
|
293
|
+
var solutionSequence = map(tmp_14, StreamsSolver$solve$lambda(this));
|
|
294
|
+
if (options.k1x() > 0) {
|
|
295
|
+
solutionSequence = take(solutionSequence, options.k1x());
|
|
296
|
+
}
|
|
297
|
+
if (options.i1x()) {
|
|
298
|
+
solutionSequence = buffered(solutionSequence);
|
|
299
|
+
}
|
|
300
|
+
return solutionSequence;
|
|
301
|
+
};
|
|
302
|
+
StreamsSolver.prototype.solveWithOptions = function (goal, options) {
|
|
303
|
+
return this.u2b(goal, options);
|
|
304
|
+
};
|
|
305
|
+
StreamsSolver.prototype.p1v = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings) {
|
|
306
|
+
return StreamsSolver_init_$Create$(unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings);
|
|
307
|
+
};
|
|
308
|
+
StreamsSolver.prototype.k1l = function () {
|
|
309
|
+
return this.l4c_1.m4c_1;
|
|
310
|
+
};
|
|
311
|
+
StreamsSolver.prototype.w1u = function () {
|
|
312
|
+
return this.l4c_1.n4c_1;
|
|
313
|
+
};
|
|
314
|
+
StreamsSolver.prototype.x1u = function () {
|
|
315
|
+
return this.l4c_1.o4c_1;
|
|
316
|
+
};
|
|
317
|
+
StreamsSolver.prototype.y1u = function () {
|
|
318
|
+
return this.l4c_1.p4c_1;
|
|
319
|
+
};
|
|
320
|
+
StreamsSolver.prototype.z1u = function () {
|
|
321
|
+
return this.l4c_1.q4c_1;
|
|
322
|
+
};
|
|
323
|
+
StreamsSolver.prototype.a1v = function () {
|
|
324
|
+
return this.l4c_1.s4c_1;
|
|
325
|
+
};
|
|
326
|
+
StreamsSolver.prototype.b1v = function () {
|
|
327
|
+
return this.l4c_1.t4c_1;
|
|
328
|
+
};
|
|
329
|
+
StreamsSolver.prototype.h1v = function () {
|
|
330
|
+
return this.l4c_1.r4c_1;
|
|
331
|
+
};
|
|
332
|
+
function StreamsSolverFactory() {
|
|
333
|
+
StreamsSolverFactory_instance = this;
|
|
334
|
+
}
|
|
335
|
+
StreamsSolverFactory.prototype.d1y = function () {
|
|
336
|
+
return DefaultBuiltins_getInstance();
|
|
337
|
+
};
|
|
338
|
+
StreamsSolverFactory.prototype.t1y = function (unificator, libraries, flags, staticKb, dynamicKb, inputs, outputs) {
|
|
339
|
+
return new StreamsSolver(unificator, libraries, flags, staticKb, dynamicKb, inputs, outputs);
|
|
340
|
+
};
|
|
341
|
+
StreamsSolverFactory.prototype.v1y = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings) {
|
|
342
|
+
return new StreamsSolver(unificator, libraries, flags, staticKb, dynamicKb, Companion_getInstance().p1y(stdIn), Companion_getInstance_0().s1y(stdOut, stdErr, warnings));
|
|
343
|
+
};
|
|
344
|
+
StreamsSolverFactory.prototype.z1y = function (unificator, libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings) {
|
|
345
|
+
// Inline function 'kotlin.TODO' call
|
|
346
|
+
throw new NotImplementedError('An operation is not implemented: Mutable stream solver is not supported yet');
|
|
347
|
+
};
|
|
348
|
+
StreamsSolverFactory.prototype.d1z = function (unificator, libraries, flags, staticKb, dynamicKb, inputs, outputs) {
|
|
349
|
+
// Inline function 'kotlin.TODO' call
|
|
350
|
+
throw new NotImplementedError('An operation is not implemented: Mutable stream solver is not supported yet');
|
|
351
|
+
};
|
|
352
|
+
var StreamsSolverFactory_instance;
|
|
353
|
+
function StreamsSolverFactory_getInstance() {
|
|
354
|
+
if (StreamsSolverFactory_instance == null)
|
|
355
|
+
new StreamsSolverFactory();
|
|
356
|
+
return StreamsSolverFactory_instance;
|
|
357
|
+
}
|
|
358
|
+
function SideEffectManagerImpl_init_$Init$(clauseScopedParents, isChoicePointChild, toCutContextsParent, logicalParentRequests, throwNonSelectableParentContexts, throwRelatedToCutContextsParent, $mask0, $marker, $this) {
|
|
359
|
+
if (!(($mask0 & 1) === 0))
|
|
360
|
+
clauseScopedParents = emptyList();
|
|
361
|
+
if (!(($mask0 & 2) === 0))
|
|
362
|
+
isChoicePointChild = false;
|
|
363
|
+
if (!(($mask0 & 4) === 0))
|
|
364
|
+
toCutContextsParent = emptySequence();
|
|
365
|
+
if (!(($mask0 & 8) === 0))
|
|
366
|
+
logicalParentRequests = emptyList();
|
|
367
|
+
if (!(($mask0 & 16) === 0))
|
|
368
|
+
throwNonSelectableParentContexts = emptySequence();
|
|
369
|
+
if (!(($mask0 & 32) === 0))
|
|
370
|
+
throwRelatedToCutContextsParent = null;
|
|
371
|
+
SideEffectManagerImpl.call($this, clauseScopedParents, isChoicePointChild, toCutContextsParent, logicalParentRequests, throwNonSelectableParentContexts, throwRelatedToCutContextsParent);
|
|
372
|
+
return $this;
|
|
373
|
+
}
|
|
374
|
+
function SideEffectManagerImpl_init_$Create$(clauseScopedParents, isChoicePointChild, toCutContextsParent, logicalParentRequests, throwNonSelectableParentContexts, throwRelatedToCutContextsParent, $mask0, $marker) {
|
|
375
|
+
return SideEffectManagerImpl_init_$Init$(clauseScopedParents, isChoicePointChild, toCutContextsParent, logicalParentRequests, throwNonSelectableParentContexts, throwRelatedToCutContextsParent, $mask0, $marker, Object.create(SideEffectManagerImpl.prototype));
|
|
376
|
+
}
|
|
377
|
+
function getFirstChoicePointContext($this) {
|
|
378
|
+
var tmp$ret$6;
|
|
379
|
+
// Inline function 'kotlin.collections.mapNotNull' call
|
|
380
|
+
var tmp$ret$2;
|
|
381
|
+
// Inline function 'kotlin.collections.filter' call
|
|
382
|
+
var tmp0_filter = $this.b4d_1;
|
|
383
|
+
var tmp$ret$1;
|
|
384
|
+
// Inline function 'kotlin.collections.filterTo' call
|
|
385
|
+
var tmp0_filterTo = ArrayList_init_$Create$();
|
|
386
|
+
var tmp0_iterator = tmp0_filter.j();
|
|
387
|
+
while (tmp0_iterator.m()) {
|
|
388
|
+
var element = tmp0_iterator.p();
|
|
389
|
+
var tmp$ret$0;
|
|
390
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.SideEffectManagerImpl.getFirstChoicePointContext.<anonymous>' call
|
|
391
|
+
tmp$ret$0 = element.z4c_1.c4d_1;
|
|
392
|
+
if (tmp$ret$0) {
|
|
393
|
+
tmp0_filterTo.g(element);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
tmp$ret$1 = tmp0_filterTo;
|
|
397
|
+
tmp$ret$2 = tmp$ret$1;
|
|
398
|
+
var tmp1_mapNotNull = tmp$ret$2;
|
|
399
|
+
var tmp$ret$5;
|
|
400
|
+
// Inline function 'kotlin.collections.mapNotNullTo' call
|
|
401
|
+
var tmp0_mapNotNullTo = ArrayList_init_$Create$();
|
|
402
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
403
|
+
var tmp0_iterator_0 = tmp1_mapNotNull.j();
|
|
404
|
+
while (tmp0_iterator_0.m()) {
|
|
405
|
+
var element_0 = tmp0_iterator_0.p();
|
|
406
|
+
// Inline function 'kotlin.collections.mapNotNullTo.<anonymous>' call
|
|
407
|
+
var tmp$ret$3;
|
|
408
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.SideEffectManagerImpl.getFirstChoicePointContext.<anonymous>' call
|
|
409
|
+
tmp$ret$3 = firstOrNull(element_0.z4c_1.b4d_1);
|
|
410
|
+
var tmp0_safe_receiver = tmp$ret$3;
|
|
411
|
+
if (tmp0_safe_receiver == null)
|
|
412
|
+
null;
|
|
413
|
+
else {
|
|
414
|
+
var tmp$ret$4;
|
|
415
|
+
// Inline function 'kotlin.let' call
|
|
416
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
417
|
+
tmp0_mapNotNullTo.g(tmp0_safe_receiver);
|
|
418
|
+
tmp$ret$4 = Unit_getInstance();
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
tmp$ret$5 = tmp0_mapNotNullTo;
|
|
422
|
+
tmp$ret$6 = tmp$ret$5;
|
|
423
|
+
return tmp$ret$6;
|
|
424
|
+
}
|
|
425
|
+
function SideEffectManagerImpl(clauseScopedParents, isChoicePointChild, toCutContextsParent, logicalParentRequests, throwNonSelectableParentContexts, throwRelatedToCutContextsParent) {
|
|
426
|
+
this.b4d_1 = clauseScopedParents;
|
|
427
|
+
this.c4d_1 = isChoicePointChild;
|
|
428
|
+
this.d4d_1 = toCutContextsParent;
|
|
429
|
+
this.e4d_1 = logicalParentRequests;
|
|
430
|
+
this.f4d_1 = throwNonSelectableParentContexts;
|
|
431
|
+
this.g4d_1 = throwRelatedToCutContextsParent;
|
|
432
|
+
}
|
|
433
|
+
SideEffectManagerImpl.prototype.h4d = function () {
|
|
434
|
+
var tmp = plus(this.d4d_1, getFirstChoicePointContext(this));
|
|
435
|
+
return this.i4d(null, false, tmp, null, null, null, 59, null);
|
|
436
|
+
};
|
|
437
|
+
SideEffectManagerImpl.prototype.cut = function () {
|
|
438
|
+
return this.h4d();
|
|
439
|
+
};
|
|
440
|
+
SideEffectManagerImpl.prototype.j4d = function (currentContext) {
|
|
441
|
+
var tmp$ret$0;
|
|
442
|
+
// Inline function 'kotlin.apply' call
|
|
443
|
+
var tmp0_apply = toMutableList(this.b4d_1);
|
|
444
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
445
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.SideEffectManagerImpl.stateInitInitialize.<anonymous>' call
|
|
446
|
+
tmp0_apply.ua(0, currentContext);
|
|
447
|
+
tmp$ret$0 = tmp0_apply;
|
|
448
|
+
var tmp = tmp$ret$0;
|
|
449
|
+
return this.i4d(tmp, false, null, null, null, null, 60, null);
|
|
450
|
+
};
|
|
451
|
+
SideEffectManagerImpl.prototype.k4d = function (currentContext, isChoicePointChild, logicalParentRequest) {
|
|
452
|
+
var tmp$ret$0;
|
|
453
|
+
// Inline function 'kotlin.apply' call
|
|
454
|
+
var tmp0_apply = toMutableList(this.b4d_1);
|
|
455
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
456
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.SideEffectManagerImpl.creatingNewRequest.<anonymous>' call
|
|
457
|
+
tmp0_apply.ua(0, currentContext);
|
|
458
|
+
tmp$ret$0 = tmp0_apply;
|
|
459
|
+
var tmp = tmp$ret$0;
|
|
460
|
+
var tmp0_subject = logicalParentRequest;
|
|
461
|
+
var tmp_0;
|
|
462
|
+
if (this.e4d_1.v(tmp0_subject)) {
|
|
463
|
+
var tmp$ret$2;
|
|
464
|
+
// Inline function 'kotlin.collections.dropWhile' call
|
|
465
|
+
var tmp1_dropWhile = this.e4d_1;
|
|
466
|
+
var yielding = false;
|
|
467
|
+
var list = ArrayList_init_$Create$();
|
|
468
|
+
var tmp0_iterator = tmp1_dropWhile.j();
|
|
469
|
+
while (tmp0_iterator.m()) {
|
|
470
|
+
var item = tmp0_iterator.p();
|
|
471
|
+
if (yielding) {
|
|
472
|
+
list.g(item);
|
|
473
|
+
} else {
|
|
474
|
+
var tmp$ret$1;
|
|
475
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.SideEffectManagerImpl.creatingNewRequest.<anonymous>' call
|
|
476
|
+
tmp$ret$1 = !item.equals(logicalParentRequest);
|
|
477
|
+
if (!tmp$ret$1) {
|
|
478
|
+
list.g(item);
|
|
479
|
+
yielding = true;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
tmp$ret$2 = list;
|
|
484
|
+
tmp_0 = tmp$ret$2;
|
|
485
|
+
} else {
|
|
486
|
+
var tmp$ret$3;
|
|
487
|
+
// Inline function 'kotlin.apply' call
|
|
488
|
+
var tmp2_apply = toMutableList(this.e4d_1);
|
|
489
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
490
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.SideEffectManagerImpl.creatingNewRequest.<anonymous>' call
|
|
491
|
+
tmp2_apply.ua(0, logicalParentRequest);
|
|
492
|
+
tmp$ret$3 = tmp2_apply;
|
|
493
|
+
tmp_0 = tmp$ret$3;
|
|
494
|
+
}
|
|
495
|
+
var tmp_1 = tmp_0;
|
|
496
|
+
return this.i4d(tmp, isChoicePointChild, null, tmp_1, null, null, 52, null);
|
|
497
|
+
};
|
|
498
|
+
SideEffectManagerImpl.prototype.l4d = function () {
|
|
499
|
+
var tmp = listOf(first_0(this.b4d_1));
|
|
500
|
+
return this.i4d(tmp, false, null, null, null, null, 62, null);
|
|
501
|
+
};
|
|
502
|
+
SideEffectManagerImpl.prototype.m4d = function (upperScopeSideEffectsManager) {
|
|
503
|
+
var tmp$ret$0;
|
|
504
|
+
// Inline function 'kotlin.apply' call
|
|
505
|
+
var tmp0_apply = toMutableList(this.b4d_1);
|
|
506
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
507
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.SideEffectManagerImpl.extendParentScopeWith.<anonymous>' call
|
|
508
|
+
tmp0_apply.t(upperScopeSideEffectsManager.b4d_1);
|
|
509
|
+
tmp$ret$0 = tmp0_apply;
|
|
510
|
+
var tmp = tmp$ret$0;
|
|
511
|
+
return this.i4d(tmp, false, null, null, null, null, 62, null);
|
|
512
|
+
};
|
|
513
|
+
SideEffectManagerImpl.prototype.n4d = function () {
|
|
514
|
+
return contains(this.d4d_1, lastOrNull(this.b4d_1)) ? true : this.o4d();
|
|
515
|
+
};
|
|
516
|
+
SideEffectManagerImpl.prototype.p4d = function (toUnifyArgument) {
|
|
517
|
+
var tmp$ret$5;
|
|
518
|
+
// Inline function 'kotlin.collections.filterNot' call
|
|
519
|
+
var tmp$ret$2;
|
|
520
|
+
// Inline function 'kotlin.collections.filter' call
|
|
521
|
+
var tmp0_filter = this.e4d_1;
|
|
522
|
+
var tmp$ret$1;
|
|
523
|
+
// Inline function 'kotlin.collections.filterTo' call
|
|
524
|
+
var tmp0_filterTo = ArrayList_init_$Create$();
|
|
525
|
+
var tmp0_iterator = tmp0_filter.j();
|
|
526
|
+
while (tmp0_iterator.m()) {
|
|
527
|
+
var element = tmp0_iterator.p();
|
|
528
|
+
var tmp$ret$0;
|
|
529
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.SideEffectManagerImpl.retrieveAncestorCatchRequest.<anonymous>' call
|
|
530
|
+
tmp$ret$0 = element.signature.equals(Catch_getInstance().signature);
|
|
531
|
+
if (tmp$ret$0) {
|
|
532
|
+
tmp0_filterTo.g(element);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
tmp$ret$1 = tmp0_filterTo;
|
|
536
|
+
tmp$ret$2 = tmp$ret$1;
|
|
537
|
+
var tmp1_filterNot = tmp$ret$2;
|
|
538
|
+
var tmp$ret$4;
|
|
539
|
+
// Inline function 'kotlin.collections.filterNotTo' call
|
|
540
|
+
var tmp0_filterNotTo = ArrayList_init_$Create$();
|
|
541
|
+
var tmp0_iterator_0 = tmp1_filterNot.j();
|
|
542
|
+
while (tmp0_iterator_0.m()) {
|
|
543
|
+
var element_0 = tmp0_iterator_0.p();
|
|
544
|
+
var tmp$ret$3;
|
|
545
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.SideEffectManagerImpl.retrieveAncestorCatchRequest.<anonymous>' call
|
|
546
|
+
tmp$ret$3 = contains(this.f4d_1, element_0.context);
|
|
547
|
+
if (!tmp$ret$3) {
|
|
548
|
+
tmp0_filterNotTo.g(element_0);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
tmp$ret$4 = tmp0_filterNotTo;
|
|
552
|
+
tmp$ret$5 = tmp$ret$4;
|
|
553
|
+
var ancestorCatchesRequests = tmp$ret$5;
|
|
554
|
+
var tmp$ret$8;
|
|
555
|
+
// Inline function 'kotlin.collections.find' call
|
|
556
|
+
var tmp$ret$7;
|
|
557
|
+
$l$block: {
|
|
558
|
+
// Inline function 'kotlin.collections.firstOrNull' call
|
|
559
|
+
var tmp0_iterator_1 = ancestorCatchesRequests.j();
|
|
560
|
+
while (tmp0_iterator_1.m()) {
|
|
561
|
+
var element_1 = tmp0_iterator_1.p();
|
|
562
|
+
var tmp$ret$6;
|
|
563
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.SideEffectManagerImpl.retrieveAncestorCatchRequest.<anonymous>' call
|
|
564
|
+
tmp$ret$6 = Companion_getInstance_1().matches(element_1.arguments.n(1), toUnifyArgument);
|
|
565
|
+
if (tmp$ret$6) {
|
|
566
|
+
tmp$ret$7 = element_1;
|
|
567
|
+
break $l$block;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
tmp$ret$7 = null;
|
|
571
|
+
}
|
|
572
|
+
tmp$ret$8 = tmp$ret$7;
|
|
573
|
+
return tmp$ret$8;
|
|
574
|
+
};
|
|
575
|
+
SideEffectManagerImpl.prototype.q4d = function (ancestorCatchContext) {
|
|
576
|
+
return this.i4d(null, false, null, null, null, ancestorCatchContext, 31, null);
|
|
577
|
+
};
|
|
578
|
+
SideEffectManagerImpl.prototype.r4d = function (contextImpl) {
|
|
579
|
+
return equals(this.g4d_1, contextImpl);
|
|
580
|
+
};
|
|
581
|
+
SideEffectManagerImpl.prototype.s4d = function (contextImpl) {
|
|
582
|
+
var tmp = plus_0(this.f4d_1, contextImpl);
|
|
583
|
+
return this.i4d(null, false, null, null, tmp, null, 47, null);
|
|
584
|
+
};
|
|
585
|
+
SideEffectManagerImpl.prototype.t4d = function (toRecoverSituation) {
|
|
586
|
+
return this.i4d(null, false, toRecoverSituation.d4d_1, null, null, null, 59, null);
|
|
587
|
+
};
|
|
588
|
+
SideEffectManagerImpl.prototype.o4d = function () {
|
|
589
|
+
var tmp$ret$0;
|
|
590
|
+
$l$block_0: {
|
|
591
|
+
// Inline function 'kotlin.collections.any' call
|
|
592
|
+
var tmp0_any = this.e4d_1;
|
|
593
|
+
var tmp;
|
|
594
|
+
if (isInterface(tmp0_any, Collection)) {
|
|
595
|
+
tmp = tmp0_any.d();
|
|
596
|
+
} else {
|
|
597
|
+
tmp = false;
|
|
598
|
+
}
|
|
599
|
+
if (tmp) {
|
|
600
|
+
tmp$ret$0 = false;
|
|
601
|
+
break $l$block_0;
|
|
602
|
+
}
|
|
603
|
+
var tmp0_iterator = tmp0_any.j();
|
|
604
|
+
while (tmp0_iterator.m()) {
|
|
605
|
+
var element = tmp0_iterator.p();
|
|
606
|
+
var tmp$ret$1;
|
|
607
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.SideEffectManagerImpl.shouldExecuteThrowCut.<anonymous>' call
|
|
608
|
+
tmp$ret$1 = element.context.equals(this.g4d_1);
|
|
609
|
+
if (tmp$ret$1) {
|
|
610
|
+
tmp$ret$0 = true;
|
|
611
|
+
break $l$block_0;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
tmp$ret$0 = false;
|
|
615
|
+
}
|
|
616
|
+
return tmp$ret$0;
|
|
617
|
+
};
|
|
618
|
+
SideEffectManagerImpl.prototype.u4d = function (clauseScopedParents, isChoicePointChild, toCutContextsParent, logicalParentRequests, throwNonSelectableParentContexts, throwRelatedToCutContextsParent) {
|
|
619
|
+
return new SideEffectManagerImpl(clauseScopedParents, isChoicePointChild, toCutContextsParent, logicalParentRequests, throwNonSelectableParentContexts, throwRelatedToCutContextsParent);
|
|
620
|
+
};
|
|
621
|
+
SideEffectManagerImpl.prototype.i4d = function (clauseScopedParents, isChoicePointChild, toCutContextsParent, logicalParentRequests, throwNonSelectableParentContexts, throwRelatedToCutContextsParent, $mask0, $handler) {
|
|
622
|
+
if (!(($mask0 & 1) === 0))
|
|
623
|
+
clauseScopedParents = this.b4d_1;
|
|
624
|
+
if (!(($mask0 & 2) === 0))
|
|
625
|
+
isChoicePointChild = this.c4d_1;
|
|
626
|
+
if (!(($mask0 & 4) === 0))
|
|
627
|
+
toCutContextsParent = this.d4d_1;
|
|
628
|
+
if (!(($mask0 & 8) === 0))
|
|
629
|
+
logicalParentRequests = this.e4d_1;
|
|
630
|
+
if (!(($mask0 & 16) === 0))
|
|
631
|
+
throwNonSelectableParentContexts = this.f4d_1;
|
|
632
|
+
if (!(($mask0 & 32) === 0))
|
|
633
|
+
throwRelatedToCutContextsParent = this.g4d_1;
|
|
634
|
+
return this.u4d(clauseScopedParents, isChoicePointChild, toCutContextsParent, logicalParentRequests, throwNonSelectableParentContexts, throwRelatedToCutContextsParent);
|
|
635
|
+
};
|
|
636
|
+
SideEffectManagerImpl.prototype.toString = function () {
|
|
637
|
+
return 'SideEffectManagerImpl(clauseScopedParents=' + this.b4d_1 + ', isChoicePointChild=' + this.c4d_1 + ', toCutContextsParent=' + this.d4d_1 + ', logicalParentRequests=' + this.e4d_1 + ', throwNonSelectableParentContexts=' + this.f4d_1 + ', throwRelatedToCutContextsParent=' + this.g4d_1 + ')';
|
|
638
|
+
};
|
|
639
|
+
SideEffectManagerImpl.prototype.hashCode = function () {
|
|
640
|
+
var result = hashCode(this.b4d_1);
|
|
641
|
+
result = imul(result, 31) + (this.c4d_1 | 0) | 0;
|
|
642
|
+
result = imul(result, 31) + hashCode(this.d4d_1) | 0;
|
|
643
|
+
result = imul(result, 31) + hashCode(this.e4d_1) | 0;
|
|
644
|
+
result = imul(result, 31) + hashCode(this.f4d_1) | 0;
|
|
645
|
+
result = imul(result, 31) + (this.g4d_1 == null ? 0 : this.g4d_1.hashCode()) | 0;
|
|
646
|
+
return result;
|
|
647
|
+
};
|
|
648
|
+
SideEffectManagerImpl.prototype.equals = function (other) {
|
|
649
|
+
if (this === other)
|
|
650
|
+
return true;
|
|
651
|
+
if (!(other instanceof SideEffectManagerImpl))
|
|
652
|
+
return false;
|
|
653
|
+
var tmp0_other_with_cast = other instanceof SideEffectManagerImpl ? other : THROW_CCE();
|
|
654
|
+
if (!equals(this.b4d_1, tmp0_other_with_cast.b4d_1))
|
|
655
|
+
return false;
|
|
656
|
+
if (!(this.c4d_1 === tmp0_other_with_cast.c4d_1))
|
|
657
|
+
return false;
|
|
658
|
+
if (!equals(this.d4d_1, tmp0_other_with_cast.d4d_1))
|
|
659
|
+
return false;
|
|
660
|
+
if (!equals(this.e4d_1, tmp0_other_with_cast.e4d_1))
|
|
661
|
+
return false;
|
|
662
|
+
if (!equals(this.f4d_1, tmp0_other_with_cast.f4d_1))
|
|
663
|
+
return false;
|
|
664
|
+
if (!equals(this.g4d_1, tmp0_other_with_cast.g4d_1))
|
|
665
|
+
return false;
|
|
666
|
+
return true;
|
|
667
|
+
};
|
|
668
|
+
function resetCutWorkChanges(_this__u8e3s4, toRecoverSituation) {
|
|
669
|
+
var tmp0_safe_receiver = _this__u8e3s4 instanceof SideEffectManagerImpl ? _this__u8e3s4 : null;
|
|
670
|
+
return tmp0_safe_receiver == null ? null : tmp0_safe_receiver.t4d(toRecoverSituation);
|
|
671
|
+
}
|
|
672
|
+
function isSelectedThrowCatch(_this__u8e3s4, context) {
|
|
673
|
+
var tmp0_safe_receiver = _this__u8e3s4 instanceof SideEffectManagerImpl ? _this__u8e3s4 : null;
|
|
674
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.r4d(context);
|
|
675
|
+
return tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs;
|
|
676
|
+
}
|
|
677
|
+
function shouldExecuteThrowCut(_this__u8e3s4) {
|
|
678
|
+
var tmp0_safe_receiver = _this__u8e3s4 instanceof SideEffectManagerImpl ? _this__u8e3s4 : null;
|
|
679
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.o4d();
|
|
680
|
+
return tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs;
|
|
681
|
+
}
|
|
682
|
+
function shouldCutExecuteInRuleSelection(_this__u8e3s4) {
|
|
683
|
+
var tmp0_safe_receiver = _this__u8e3s4 instanceof SideEffectManagerImpl ? _this__u8e3s4 : null;
|
|
684
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.n4d();
|
|
685
|
+
return tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs;
|
|
686
|
+
}
|
|
687
|
+
function extendParentScopeWith(_this__u8e3s4, upperScopeSideEffectsManager) {
|
|
688
|
+
var tmp0_safe_receiver = _this__u8e3s4 instanceof SideEffectManagerImpl ? _this__u8e3s4 : null;
|
|
689
|
+
return tmp0_safe_receiver == null ? null : tmp0_safe_receiver.m4d(upperScopeSideEffectsManager);
|
|
690
|
+
}
|
|
691
|
+
function isWellFormed(_this__u8e3s4) {
|
|
692
|
+
return _this__u8e3s4.accept(Companion_getInstance_2().bodyWellFormedVisitor);
|
|
693
|
+
}
|
|
694
|
+
function replyWith(_this__u8e3s4, otherResponse) {
|
|
695
|
+
var tmp$ret$2;
|
|
696
|
+
// Inline function 'kotlin.with' call
|
|
697
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
698
|
+
var tmp$ret$1;
|
|
699
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.replyWith.<anonymous>' call
|
|
700
|
+
var tmp0_elvis_lhs = otherResponse.sideEffectManager;
|
|
701
|
+
var tmp = tmp0_elvis_lhs == null ? getSideEffectManager(_this__u8e3s4.context) : tmp0_elvis_lhs;
|
|
702
|
+
var tmp$ret$0;
|
|
703
|
+
// Inline function 'kotlin.collections.toTypedArray' call
|
|
704
|
+
var tmp0_toTypedArray = otherResponse.sideEffects;
|
|
705
|
+
tmp$ret$0 = copyToArray(tmp0_toTypedArray);
|
|
706
|
+
tmp$ret$1 = _this__u8e3s4.v2i(otherResponse.solution, tmp, tmp$ret$0.slice());
|
|
707
|
+
tmp$ret$2 = tmp$ret$1;
|
|
708
|
+
return tmp$ret$2;
|
|
709
|
+
}
|
|
710
|
+
function newSolveRequest(_this__u8e3s4, newGoal, toAddSubstitutions, toPropagateContextData, baseSideEffectManager, requestIssuingInstant, isChoicePointChild) {
|
|
711
|
+
var tmp = extractSignature(newGoal);
|
|
712
|
+
var tmp_0 = newGoal.gw();
|
|
713
|
+
var tmp_1 = toPropagateContextData.w1u();
|
|
714
|
+
var tmp_2 = toPropagateContextData.x1u();
|
|
715
|
+
var tmp_3 = toPropagateContextData.y1u();
|
|
716
|
+
var tmp_4 = toPropagateContextData.z1u();
|
|
717
|
+
var tmp_5 = toPropagateContextData.a1v();
|
|
718
|
+
var tmp_6 = toPropagateContextData.b1v();
|
|
719
|
+
var tmp_7 = _this__u8e3s4.context.v4c_1.plus(toAddSubstitutions);
|
|
720
|
+
var tmp_8 = isInterface(tmp_7, Unifier) ? tmp_7 : THROW_CCE();
|
|
721
|
+
var tmp_9 = new Long(0, 0);
|
|
722
|
+
var tmp_10 = new Long(0, 0);
|
|
723
|
+
var tmp_11 = _this__u8e3s4.context.v4d(null, tmp_1, tmp_2, tmp_3, tmp_4, null, tmp_5, tmp_6, null, tmp_8, tmp_9, tmp_10, null, baseSideEffectManager.k4d(_this__u8e3s4.context, isChoicePointChild, _this__u8e3s4), 7457, null);
|
|
724
|
+
return _this__u8e3s4.g2j(tmp, tmp_0, tmp_11, requestIssuingInstant, new Long(0, 0), 16, null);
|
|
725
|
+
}
|
|
726
|
+
function newSolveRequest$default(_this__u8e3s4, newGoal, toAddSubstitutions, toPropagateContextData, baseSideEffectManager, requestIssuingInstant, isChoicePointChild, $mask0, $handler) {
|
|
727
|
+
if (!(($mask0 & 2) === 0))
|
|
728
|
+
toAddSubstitutions = Companion_getInstance_3().empty();
|
|
729
|
+
if (!(($mask0 & 4) === 0))
|
|
730
|
+
toPropagateContextData = _this__u8e3s4.context;
|
|
731
|
+
if (!(($mask0 & 8) === 0))
|
|
732
|
+
baseSideEffectManager = _this__u8e3s4.context.z4c_1;
|
|
733
|
+
if (!(($mask0 & 16) === 0))
|
|
734
|
+
requestIssuingInstant = _this__u8e3s4.v29_1;
|
|
735
|
+
if (!(($mask0 & 32) === 0))
|
|
736
|
+
isChoicePointChild = false;
|
|
737
|
+
return newSolveRequest(_this__u8e3s4, newGoal, toAddSubstitutions, toPropagateContextData, baseSideEffectManager, requestIssuingInstant, isChoicePointChild);
|
|
738
|
+
}
|
|
739
|
+
function prepareForExecutionAsGoal(_this__u8e3s4) {
|
|
740
|
+
return single(prepareForExecution(Companion_getInstance_4().of(_this__u8e3s4, [])).gw()).zw();
|
|
741
|
+
}
|
|
742
|
+
function orderWithStrategy(_this__u8e3s4, context, selectionStrategy) {
|
|
743
|
+
var tmp0_subject = any(_this__u8e3s4);
|
|
744
|
+
var tmp;
|
|
745
|
+
if (tmp0_subject === true) {
|
|
746
|
+
tmp = sequence(orderWithStrategy$slambda_0(selectionStrategy, _this__u8e3s4, context, null));
|
|
747
|
+
} else {
|
|
748
|
+
tmp = emptySequence();
|
|
749
|
+
}
|
|
750
|
+
return tmp;
|
|
751
|
+
}
|
|
752
|
+
function addWithNoDuplicates(_this__u8e3s4, toAddSideEffects) {
|
|
753
|
+
var duplicatedCount = 0;
|
|
754
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
755
|
+
var tmp0_iterator = _this__u8e3s4.j();
|
|
756
|
+
while (tmp0_iterator.m()) {
|
|
757
|
+
var element = tmp0_iterator.p();
|
|
758
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.addWithNoDuplicates.<anonymous>' call
|
|
759
|
+
var tmp$ret$2;
|
|
760
|
+
// Inline function 'kotlin.collections.find' call
|
|
761
|
+
var tmp$ret$1;
|
|
762
|
+
$l$block: {
|
|
763
|
+
// Inline function 'kotlin.collections.firstOrNull' call
|
|
764
|
+
var tmp0_iterator_0 = toAddSideEffects.j();
|
|
765
|
+
while (tmp0_iterator_0.m()) {
|
|
766
|
+
var element_0 = tmp0_iterator_0.p();
|
|
767
|
+
var tmp$ret$0;
|
|
768
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.addWithNoDuplicates.<anonymous>.<anonymous>' call
|
|
769
|
+
tmp$ret$0 = element === element_0;
|
|
770
|
+
if (tmp$ret$0) {
|
|
771
|
+
tmp$ret$1 = element_0;
|
|
772
|
+
break $l$block;
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
tmp$ret$1 = null;
|
|
776
|
+
}
|
|
777
|
+
tmp$ret$2 = tmp$ret$1;
|
|
778
|
+
if (!(tmp$ret$2 === null)) {
|
|
779
|
+
var tmp0 = duplicatedCount;
|
|
780
|
+
duplicatedCount = tmp0 + 1 | 0;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
return plus_1(_this__u8e3s4, drop(toAddSideEffects, duplicatedCount));
|
|
784
|
+
}
|
|
785
|
+
function moreThanOne(elements) {
|
|
786
|
+
var tmp$ret$1;
|
|
787
|
+
// Inline function 'kotlin.with' call
|
|
788
|
+
var tmp0_with = elements.j();
|
|
789
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
790
|
+
var tmp$ret$0;
|
|
791
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.moreThanOne.<anonymous>' call
|
|
792
|
+
var tmp;
|
|
793
|
+
if (!tmp0_with.m()) {
|
|
794
|
+
tmp = false;
|
|
795
|
+
} else {
|
|
796
|
+
tmp0_with.p();
|
|
797
|
+
tmp = tmp0_with.m();
|
|
798
|
+
}
|
|
799
|
+
tmp$ret$0 = tmp;
|
|
800
|
+
tmp$ret$1 = tmp$ret$0;
|
|
801
|
+
return tmp$ret$1;
|
|
802
|
+
}
|
|
803
|
+
function orderWithStrategy$slambda$lambda($this_orderWithStrategy, $tmp0_let) {
|
|
804
|
+
return function (index, _anonymous_parameter_1__qggqgd) {
|
|
805
|
+
return !(index === indexOf($this_orderWithStrategy, $tmp0_let));
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
function orderWithStrategy$slambda($selectionStrategy, $this_orderWithStrategy, $context, resultContinuation) {
|
|
809
|
+
this.e4e_1 = $selectionStrategy;
|
|
810
|
+
this.f4e_1 = $this_orderWithStrategy;
|
|
811
|
+
this.g4e_1 = $context;
|
|
812
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
813
|
+
}
|
|
814
|
+
orderWithStrategy$slambda.prototype.j4e = function ($this$sequence, $cont) {
|
|
815
|
+
var tmp = this.k4e($this$sequence, $cont);
|
|
816
|
+
tmp.ei_1 = Unit_getInstance();
|
|
817
|
+
tmp.fi_1 = null;
|
|
818
|
+
return tmp.ki();
|
|
819
|
+
};
|
|
820
|
+
orderWithStrategy$slambda.prototype.wi = function (p1, $cont) {
|
|
821
|
+
return this.j4e(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $cont);
|
|
822
|
+
};
|
|
823
|
+
orderWithStrategy$slambda.prototype.ki = function () {
|
|
824
|
+
var suspendResult = this.ei_1;
|
|
825
|
+
$sm: do
|
|
826
|
+
try {
|
|
827
|
+
var tmp = this.ci_1;
|
|
828
|
+
switch (tmp) {
|
|
829
|
+
case 0:
|
|
830
|
+
this.di_1 = 3;
|
|
831
|
+
var tmp_0 = this;
|
|
832
|
+
tmp_0.i4e_1 = this.e4e_1(this.f4e_1, this.g4e_1);
|
|
833
|
+
this.ci_1 = 1;
|
|
834
|
+
suspendResult = this.h4e_1.z4(this.i4e_1, this);
|
|
835
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
836
|
+
return suspendResult;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
continue $sm;
|
|
840
|
+
case 1:
|
|
841
|
+
this.ci_1 = 2;
|
|
842
|
+
suspendResult = this.h4e_1.c5(orderWithStrategy(filterIndexed(this.f4e_1, orderWithStrategy$slambda$lambda(this.f4e_1, this.i4e_1)), this.g4e_1, this.e4e_1), this);
|
|
843
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
844
|
+
return suspendResult;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
continue $sm;
|
|
848
|
+
case 2:
|
|
849
|
+
return Unit_getInstance();
|
|
850
|
+
case 3:
|
|
851
|
+
throw this.fi_1;
|
|
852
|
+
}
|
|
853
|
+
} catch ($p) {
|
|
854
|
+
if (this.di_1 === 3) {
|
|
855
|
+
throw $p;
|
|
856
|
+
} else {
|
|
857
|
+
this.ci_1 = this.di_1;
|
|
858
|
+
this.fi_1 = $p;
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
while (true);
|
|
862
|
+
};
|
|
863
|
+
orderWithStrategy$slambda.prototype.k4e = function ($this$sequence, completion) {
|
|
864
|
+
var i = new orderWithStrategy$slambda(this.e4e_1, this.f4e_1, this.g4e_1, completion);
|
|
865
|
+
i.h4e_1 = $this$sequence;
|
|
866
|
+
return i;
|
|
867
|
+
};
|
|
868
|
+
function orderWithStrategy$slambda_0($selectionStrategy, $this_orderWithStrategy, $context, resultContinuation) {
|
|
869
|
+
var i = new orderWithStrategy$slambda($selectionStrategy, $this_orderWithStrategy, $context, resultContinuation);
|
|
870
|
+
var l = function ($this$sequence, $cont) {
|
|
871
|
+
return i.j4e($this$sequence, $cont);
|
|
872
|
+
};
|
|
873
|
+
l.$arity = 1;
|
|
874
|
+
return l;
|
|
875
|
+
}
|
|
876
|
+
function StreamsExecutionContext_init_$Init$(unificator, libraries, flags, staticKb, dynamicKb, operators, inputChannels, outputChannels, customData, substitution, startTime, maxDuration, solverStrategies, sideEffectManager, $mask0, $marker, $this) {
|
|
877
|
+
if (!(($mask0 & 1) === 0))
|
|
878
|
+
unificator = Companion_getInstance_1().h1l();
|
|
879
|
+
if (!(($mask0 & 2) === 0))
|
|
880
|
+
libraries = Companion_getInstance_5().empty();
|
|
881
|
+
if (!(($mask0 & 4) === 0))
|
|
882
|
+
flags = Companion_getInstance_6().empty();
|
|
883
|
+
if (!(($mask0 & 8) === 0))
|
|
884
|
+
staticKb = Companion_getInstance_7().empty(unificator);
|
|
885
|
+
if (!(($mask0 & 16) === 0))
|
|
886
|
+
dynamicKb = Companion_getInstance_7().empty(unificator);
|
|
887
|
+
if (!(($mask0 & 32) === 0))
|
|
888
|
+
operators = toOperatorSet(getAllOperators(libraries, [staticKb, dynamicKb]));
|
|
889
|
+
if (!(($mask0 & 64) === 0)) {
|
|
890
|
+
var tmp = Companion_getInstance();
|
|
891
|
+
inputChannels = tmp.n1z(null, 1, null);
|
|
892
|
+
}
|
|
893
|
+
if (!(($mask0 & 128) === 0)) {
|
|
894
|
+
var tmp_0 = Companion_getInstance_0();
|
|
895
|
+
outputChannels = tmp_0.o1z(null, null, null, 7, null);
|
|
896
|
+
}
|
|
897
|
+
if (!(($mask0 & 256) === 0))
|
|
898
|
+
customData = Companion_getInstance_8().empty();
|
|
899
|
+
if (!(($mask0 & 512) === 0))
|
|
900
|
+
substitution = Companion_getInstance_3().empty();
|
|
901
|
+
if (!(($mask0 & 1024) === 0))
|
|
902
|
+
startTime = currentTimeInstant();
|
|
903
|
+
if (!(($mask0 & 2048) === 0)) {
|
|
904
|
+
Companion_getInstance_9();
|
|
905
|
+
maxDuration = new Long(-1, 2147483647);
|
|
906
|
+
}
|
|
907
|
+
if (!(($mask0 & 4096) === 0))
|
|
908
|
+
solverStrategies = Companion_getInstance_15().g4c_1;
|
|
909
|
+
if (!(($mask0 & 8192) === 0)) {
|
|
910
|
+
sideEffectManager = SideEffectManagerImpl_init_$Create$(null, false, null, null, null, null, 63, null);
|
|
911
|
+
}
|
|
912
|
+
StreamsExecutionContext.call($this, unificator, libraries, flags, staticKb, dynamicKb, operators, inputChannels, outputChannels, customData, substitution, startTime, maxDuration, solverStrategies, sideEffectManager);
|
|
913
|
+
return $this;
|
|
914
|
+
}
|
|
915
|
+
function StreamsExecutionContext_init_$Create$(unificator, libraries, flags, staticKb, dynamicKb, operators, inputChannels, outputChannels, customData, substitution, startTime, maxDuration, solverStrategies, sideEffectManager, $mask0, $marker) {
|
|
916
|
+
return StreamsExecutionContext_init_$Init$(unificator, libraries, flags, staticKb, dynamicKb, operators, inputChannels, outputChannels, customData, substitution, startTime, maxDuration, solverStrategies, sideEffectManager, $mask0, $marker, Object.create(StreamsExecutionContext.prototype));
|
|
917
|
+
}
|
|
918
|
+
function StreamsExecutionContext_init_$Init$_0(context, newCurrentSubstitution, $this) {
|
|
919
|
+
var tmp = context.k1l();
|
|
920
|
+
var tmp_0 = context.w1u();
|
|
921
|
+
var tmp_1 = context.x1u();
|
|
922
|
+
var tmp_2 = context.y1u();
|
|
923
|
+
var tmp_3 = context.z1u();
|
|
924
|
+
var tmp_4 = context.h1v();
|
|
925
|
+
var tmp_5 = context.a1v();
|
|
926
|
+
var tmp_6 = context.b1v();
|
|
927
|
+
var tmp_7 = context.t1u();
|
|
928
|
+
var tmp_8 = new Long(0, 0);
|
|
929
|
+
var tmp_9 = new Long(0, 0);
|
|
930
|
+
var tmp0_safe_receiver = context instanceof StreamsExecutionContext ? context : null;
|
|
931
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.y4c_1;
|
|
932
|
+
var tmp_10 = tmp1_elvis_lhs == null ? Companion_getInstance_15().g4c_1 : tmp1_elvis_lhs;
|
|
933
|
+
var tmp2_safe_receiver = context instanceof StreamsExecutionContext ? context : null;
|
|
934
|
+
var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.z4c_1;
|
|
935
|
+
var tmp_11;
|
|
936
|
+
if (tmp3_elvis_lhs == null) {
|
|
937
|
+
tmp_11 = SideEffectManagerImpl_init_$Create$(null, false, null, null, null, null, 63, null);
|
|
938
|
+
} else {
|
|
939
|
+
tmp_11 = tmp3_elvis_lhs;
|
|
940
|
+
}
|
|
941
|
+
StreamsExecutionContext_init_$Init$(tmp, tmp_0, tmp_1, tmp_2, tmp_3, tmp_4, tmp_5, tmp_6, tmp_7, newCurrentSubstitution, tmp_8, tmp_9, tmp_10, tmp_11, 3072, null, $this);
|
|
942
|
+
return $this;
|
|
943
|
+
}
|
|
944
|
+
function StreamsExecutionContext_init_$Create$_0(context, newCurrentSubstitution) {
|
|
945
|
+
return StreamsExecutionContext_init_$Init$_0(context, newCurrentSubstitution, Object.create(StreamsExecutionContext.prototype));
|
|
946
|
+
}
|
|
947
|
+
function StreamsExecutionContext$logicStackTrace$delegate$lambda$lambda(it) {
|
|
948
|
+
return it.x1v();
|
|
949
|
+
}
|
|
950
|
+
function StreamsExecutionContext$logicStackTrace$delegate$lambda(this$0) {
|
|
951
|
+
return function () {
|
|
952
|
+
var tmp = asSequence(this$0.z4c_1.e4d_1);
|
|
953
|
+
return toList(map(tmp, StreamsExecutionContext$logicStackTrace$delegate$lambda$lambda));
|
|
954
|
+
};
|
|
955
|
+
}
|
|
956
|
+
function StreamsExecutionContext(unificator, libraries, flags, staticKb, dynamicKb, operators, inputChannels, outputChannels, customData, substitution, startTime, maxDuration, solverStrategies, sideEffectManager) {
|
|
957
|
+
this.m4c_1 = unificator;
|
|
958
|
+
this.n4c_1 = libraries;
|
|
959
|
+
this.o4c_1 = flags;
|
|
960
|
+
this.p4c_1 = staticKb;
|
|
961
|
+
this.q4c_1 = dynamicKb;
|
|
962
|
+
this.r4c_1 = operators;
|
|
963
|
+
this.s4c_1 = inputChannels;
|
|
964
|
+
this.t4c_1 = outputChannels;
|
|
965
|
+
this.u4c_1 = customData;
|
|
966
|
+
this.v4c_1 = substitution;
|
|
967
|
+
this.w4c_1 = startTime;
|
|
968
|
+
this.x4c_1 = maxDuration;
|
|
969
|
+
this.y4c_1 = solverStrategies;
|
|
970
|
+
this.z4c_1 = sideEffectManager;
|
|
971
|
+
var tmp = this;
|
|
972
|
+
tmp.a4d_1 = lazy(StreamsExecutionContext$logicStackTrace$delegate$lambda(this));
|
|
973
|
+
}
|
|
974
|
+
StreamsExecutionContext.prototype.k1l = function () {
|
|
975
|
+
return this.m4c_1;
|
|
976
|
+
};
|
|
977
|
+
StreamsExecutionContext.prototype.w1u = function () {
|
|
978
|
+
return this.n4c_1;
|
|
979
|
+
};
|
|
980
|
+
StreamsExecutionContext.prototype.x1u = function () {
|
|
981
|
+
return this.o4c_1;
|
|
982
|
+
};
|
|
983
|
+
StreamsExecutionContext.prototype.y1u = function () {
|
|
984
|
+
return this.p4c_1;
|
|
985
|
+
};
|
|
986
|
+
StreamsExecutionContext.prototype.z1u = function () {
|
|
987
|
+
return this.q4c_1;
|
|
988
|
+
};
|
|
989
|
+
StreamsExecutionContext.prototype.h1v = function () {
|
|
990
|
+
return this.r4c_1;
|
|
991
|
+
};
|
|
992
|
+
StreamsExecutionContext.prototype.a1v = function () {
|
|
993
|
+
return this.s4c_1;
|
|
994
|
+
};
|
|
995
|
+
StreamsExecutionContext.prototype.b1v = function () {
|
|
996
|
+
return this.t4c_1;
|
|
997
|
+
};
|
|
998
|
+
StreamsExecutionContext.prototype.t1u = function () {
|
|
999
|
+
return this.u4c_1;
|
|
1000
|
+
};
|
|
1001
|
+
StreamsExecutionContext.prototype.r1u = function () {
|
|
1002
|
+
return this.v4c_1;
|
|
1003
|
+
};
|
|
1004
|
+
StreamsExecutionContext.prototype.l1u = function () {
|
|
1005
|
+
return this.w4c_1;
|
|
1006
|
+
};
|
|
1007
|
+
StreamsExecutionContext.prototype.n1u = function () {
|
|
1008
|
+
return this.x4c_1;
|
|
1009
|
+
};
|
|
1010
|
+
StreamsExecutionContext.prototype.q1u = function () {
|
|
1011
|
+
var tmp$ret$2;
|
|
1012
|
+
// Inline function 'kotlin.collections.map' call
|
|
1013
|
+
var tmp0_map = this.z4c_1.e4d_1;
|
|
1014
|
+
var tmp$ret$1;
|
|
1015
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1016
|
+
var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp0_map, 10));
|
|
1017
|
+
var tmp0_iterator = tmp0_map.j();
|
|
1018
|
+
while (tmp0_iterator.m()) {
|
|
1019
|
+
var item = tmp0_iterator.p();
|
|
1020
|
+
var tmp$ret$0;
|
|
1021
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.StreamsExecutionContext.<get-procedure>.<anonymous>' call
|
|
1022
|
+
tmp$ret$0 = item.x1v();
|
|
1023
|
+
tmp0_mapTo.g(tmp$ret$0);
|
|
1024
|
+
}
|
|
1025
|
+
tmp$ret$1 = tmp0_mapTo;
|
|
1026
|
+
tmp$ret$2 = tmp$ret$1;
|
|
1027
|
+
return firstOrNull(tmp$ret$2);
|
|
1028
|
+
};
|
|
1029
|
+
StreamsExecutionContext.prototype.s1u = function () {
|
|
1030
|
+
var tmp$ret$0;
|
|
1031
|
+
// Inline function 'kotlin.getValue' call
|
|
1032
|
+
var tmp0_getValue = logicStackTrace$factory();
|
|
1033
|
+
tmp$ret$0 = this.a4d_1.b1();
|
|
1034
|
+
return tmp$ret$0;
|
|
1035
|
+
};
|
|
1036
|
+
StreamsExecutionContext.prototype.u1u = function (unificator, libraries, flags, staticKb, dynamicKb, inputChannels, outputChannels) {
|
|
1037
|
+
return new StreamsSolver(unificator, libraries, flags, staticKb, dynamicKb, inputChannels, outputChannels);
|
|
1038
|
+
};
|
|
1039
|
+
StreamsExecutionContext.prototype.c1v = function (unificator, libraries, flags, staticKb, dynamicKb, inputChannels, outputChannels) {
|
|
1040
|
+
throw new NotImplementedError('An operation is not implemented: Not yet implemented');
|
|
1041
|
+
};
|
|
1042
|
+
StreamsExecutionContext.prototype.y36 = function (sideEffect) {
|
|
1043
|
+
var tmp = apply.call(this, sideEffect);
|
|
1044
|
+
return tmp instanceof StreamsExecutionContext ? tmp : THROW_CCE();
|
|
1045
|
+
};
|
|
1046
|
+
StreamsExecutionContext.prototype.apply = function (sideEffect) {
|
|
1047
|
+
return this.y36(sideEffect);
|
|
1048
|
+
};
|
|
1049
|
+
StreamsExecutionContext.prototype.z36 = function (sideEffects) {
|
|
1050
|
+
var tmp = applyIterable.call(this, sideEffects);
|
|
1051
|
+
return tmp instanceof StreamsExecutionContext ? tmp : THROW_CCE();
|
|
1052
|
+
};
|
|
1053
|
+
StreamsExecutionContext.prototype.applyIterable = function (sideEffects) {
|
|
1054
|
+
return this.z36(sideEffects);
|
|
1055
|
+
};
|
|
1056
|
+
StreamsExecutionContext.prototype.a37 = function (sideEffects) {
|
|
1057
|
+
var tmp = applySequence.call(this, sideEffects);
|
|
1058
|
+
return tmp instanceof StreamsExecutionContext ? tmp : THROW_CCE();
|
|
1059
|
+
};
|
|
1060
|
+
StreamsExecutionContext.prototype.applySequence = function (sideEffects) {
|
|
1061
|
+
return this.a37(sideEffects);
|
|
1062
|
+
};
|
|
1063
|
+
StreamsExecutionContext.prototype.f1v = function (unificator, libraries, flags, staticKb, dynamicKb, operators, inputChannels, outputChannels, customData) {
|
|
1064
|
+
var tmp = new Long(0, 0);
|
|
1065
|
+
var tmp_0 = new Long(0, 0);
|
|
1066
|
+
return this.v4d(unificator, libraries, flags, staticKb, dynamicKb, operators, inputChannels, outputChannels, customData, null, tmp, tmp_0, null, null, 15872, null);
|
|
1067
|
+
};
|
|
1068
|
+
StreamsExecutionContext.prototype.l4e = function (unificator, libraries, flags, staticKb, dynamicKb, operators, inputChannels, outputChannels, customData, substitution, startTime, maxDuration, solverStrategies, sideEffectManager) {
|
|
1069
|
+
return new StreamsExecutionContext(unificator, libraries, flags, staticKb, dynamicKb, operators, inputChannels, outputChannels, customData, substitution, startTime, maxDuration, solverStrategies, sideEffectManager);
|
|
1070
|
+
};
|
|
1071
|
+
StreamsExecutionContext.prototype.v4d = function (unificator, libraries, flags, staticKb, dynamicKb, operators, inputChannels, outputChannels, customData, substitution, startTime, maxDuration, solverStrategies, sideEffectManager, $mask0, $handler) {
|
|
1072
|
+
if (!(($mask0 & 1) === 0))
|
|
1073
|
+
unificator = this.m4c_1;
|
|
1074
|
+
if (!(($mask0 & 2) === 0))
|
|
1075
|
+
libraries = this.n4c_1;
|
|
1076
|
+
if (!(($mask0 & 4) === 0))
|
|
1077
|
+
flags = this.o4c_1;
|
|
1078
|
+
if (!(($mask0 & 8) === 0))
|
|
1079
|
+
staticKb = this.p4c_1;
|
|
1080
|
+
if (!(($mask0 & 16) === 0))
|
|
1081
|
+
dynamicKb = this.q4c_1;
|
|
1082
|
+
if (!(($mask0 & 32) === 0))
|
|
1083
|
+
operators = this.r4c_1;
|
|
1084
|
+
if (!(($mask0 & 64) === 0))
|
|
1085
|
+
inputChannels = this.s4c_1;
|
|
1086
|
+
if (!(($mask0 & 128) === 0))
|
|
1087
|
+
outputChannels = this.t4c_1;
|
|
1088
|
+
if (!(($mask0 & 256) === 0))
|
|
1089
|
+
customData = this.u4c_1;
|
|
1090
|
+
if (!(($mask0 & 512) === 0))
|
|
1091
|
+
substitution = this.v4c_1;
|
|
1092
|
+
if (!(($mask0 & 1024) === 0))
|
|
1093
|
+
startTime = this.w4c_1;
|
|
1094
|
+
if (!(($mask0 & 2048) === 0))
|
|
1095
|
+
maxDuration = this.x4c_1;
|
|
1096
|
+
if (!(($mask0 & 4096) === 0))
|
|
1097
|
+
solverStrategies = this.y4c_1;
|
|
1098
|
+
if (!(($mask0 & 8192) === 0))
|
|
1099
|
+
sideEffectManager = this.z4c_1;
|
|
1100
|
+
return this.l4e(unificator, libraries, flags, staticKb, dynamicKb, operators, inputChannels, outputChannels, customData, substitution, startTime, maxDuration, solverStrategies, sideEffectManager);
|
|
1101
|
+
};
|
|
1102
|
+
StreamsExecutionContext.prototype.toString = function () {
|
|
1103
|
+
return 'StreamsExecutionContext(unificator=' + this.m4c_1 + ', libraries=' + this.n4c_1 + ', flags=' + this.o4c_1 + ', staticKb=' + this.p4c_1 + ', dynamicKb=' + this.q4c_1 + ', operators=' + this.r4c_1 + ', inputChannels=' + this.s4c_1 + ', outputChannels=' + this.t4c_1 + ', customData=' + this.u4c_1 + ', substitution=' + this.v4c_1 + ', startTime=' + toString(this.w4c_1) + ', maxDuration=' + toString(this.x4c_1) + ', solverStrategies=' + this.y4c_1 + ', sideEffectManager=' + this.z4c_1 + ')';
|
|
1104
|
+
};
|
|
1105
|
+
StreamsExecutionContext.prototype.hashCode = function () {
|
|
1106
|
+
var result = hashCode(this.m4c_1);
|
|
1107
|
+
result = imul(result, 31) + hashCode(this.n4c_1) | 0;
|
|
1108
|
+
result = imul(result, 31) + this.o4c_1.hashCode() | 0;
|
|
1109
|
+
result = imul(result, 31) + hashCode(this.p4c_1) | 0;
|
|
1110
|
+
result = imul(result, 31) + hashCode(this.q4c_1) | 0;
|
|
1111
|
+
result = imul(result, 31) + this.r4c_1.hashCode() | 0;
|
|
1112
|
+
result = imul(result, 31) + hashCode(this.s4c_1) | 0;
|
|
1113
|
+
result = imul(result, 31) + hashCode(this.t4c_1) | 0;
|
|
1114
|
+
result = imul(result, 31) + this.u4c_1.hashCode() | 0;
|
|
1115
|
+
result = imul(result, 31) + hashCode(this.v4c_1) | 0;
|
|
1116
|
+
result = imul(result, 31) + this.w4c_1.hashCode() | 0;
|
|
1117
|
+
result = imul(result, 31) + this.x4c_1.hashCode() | 0;
|
|
1118
|
+
result = imul(result, 31) + hashCode(this.y4c_1) | 0;
|
|
1119
|
+
result = imul(result, 31) + this.z4c_1.hashCode() | 0;
|
|
1120
|
+
return result;
|
|
1121
|
+
};
|
|
1122
|
+
StreamsExecutionContext.prototype.equals = function (other) {
|
|
1123
|
+
if (this === other)
|
|
1124
|
+
return true;
|
|
1125
|
+
if (!(other instanceof StreamsExecutionContext))
|
|
1126
|
+
return false;
|
|
1127
|
+
var tmp0_other_with_cast = other instanceof StreamsExecutionContext ? other : THROW_CCE();
|
|
1128
|
+
if (!equals(this.m4c_1, tmp0_other_with_cast.m4c_1))
|
|
1129
|
+
return false;
|
|
1130
|
+
if (!equals(this.n4c_1, tmp0_other_with_cast.n4c_1))
|
|
1131
|
+
return false;
|
|
1132
|
+
if (!this.o4c_1.equals(tmp0_other_with_cast.o4c_1))
|
|
1133
|
+
return false;
|
|
1134
|
+
if (!equals(this.p4c_1, tmp0_other_with_cast.p4c_1))
|
|
1135
|
+
return false;
|
|
1136
|
+
if (!equals(this.q4c_1, tmp0_other_with_cast.q4c_1))
|
|
1137
|
+
return false;
|
|
1138
|
+
if (!this.r4c_1.equals(tmp0_other_with_cast.r4c_1))
|
|
1139
|
+
return false;
|
|
1140
|
+
if (!equals(this.s4c_1, tmp0_other_with_cast.s4c_1))
|
|
1141
|
+
return false;
|
|
1142
|
+
if (!equals(this.t4c_1, tmp0_other_with_cast.t4c_1))
|
|
1143
|
+
return false;
|
|
1144
|
+
if (!this.u4c_1.equals(tmp0_other_with_cast.u4c_1))
|
|
1145
|
+
return false;
|
|
1146
|
+
if (!equals(this.v4c_1, tmp0_other_with_cast.v4c_1))
|
|
1147
|
+
return false;
|
|
1148
|
+
if (!this.w4c_1.equals(tmp0_other_with_cast.w4c_1))
|
|
1149
|
+
return false;
|
|
1150
|
+
if (!this.x4c_1.equals(tmp0_other_with_cast.x4c_1))
|
|
1151
|
+
return false;
|
|
1152
|
+
if (!equals(this.y4c_1, tmp0_other_with_cast.y4c_1))
|
|
1153
|
+
return false;
|
|
1154
|
+
if (!this.z4c_1.equals(tmp0_other_with_cast.z4c_1))
|
|
1155
|
+
return false;
|
|
1156
|
+
return true;
|
|
1157
|
+
};
|
|
1158
|
+
function getSideEffectManager(_this__u8e3s4) {
|
|
1159
|
+
var tmp0_safe_receiver = _this__u8e3s4 instanceof StreamsExecutionContext ? _this__u8e3s4 : null;
|
|
1160
|
+
return tmp0_safe_receiver == null ? null : tmp0_safe_receiver.z4c_1;
|
|
1161
|
+
}
|
|
1162
|
+
function logicStackTrace$factory() {
|
|
1163
|
+
return getPropertyCallableRef('logicStackTrace', 1, KProperty1, function (receiver) {
|
|
1164
|
+
return receiver.s1u();
|
|
1165
|
+
}, null);
|
|
1166
|
+
}
|
|
1167
|
+
function AbstractState(solve) {
|
|
1168
|
+
this.m4e_1 = solve;
|
|
1169
|
+
this.n4e_1 = false;
|
|
1170
|
+
}
|
|
1171
|
+
AbstractState.prototype.o4e = function () {
|
|
1172
|
+
return this.n4e_1;
|
|
1173
|
+
};
|
|
1174
|
+
function AlreadyExecutedState(wrappedState) {
|
|
1175
|
+
this.q4e_1 = wrappedState;
|
|
1176
|
+
this.r4e_1 = true;
|
|
1177
|
+
}
|
|
1178
|
+
AlreadyExecutedState.prototype.p4e = function () {
|
|
1179
|
+
return this.q4e_1.p4e();
|
|
1180
|
+
};
|
|
1181
|
+
AlreadyExecutedState.prototype.o4e = function () {
|
|
1182
|
+
return this.r4e_1;
|
|
1183
|
+
};
|
|
1184
|
+
AlreadyExecutedState.prototype.toString = function () {
|
|
1185
|
+
return 'AlreadyExecutedState of: ' + this.q4e_1;
|
|
1186
|
+
};
|
|
1187
|
+
function asAlreadyExecuted(_this__u8e3s4) {
|
|
1188
|
+
var tmp0_safe_receiver = _this__u8e3s4 instanceof AlreadyExecutedState ? _this__u8e3s4 : null;
|
|
1189
|
+
var tmp;
|
|
1190
|
+
if (tmp0_safe_receiver == null) {
|
|
1191
|
+
tmp = null;
|
|
1192
|
+
} else {
|
|
1193
|
+
var tmp$ret$1;
|
|
1194
|
+
// Inline function 'kotlin.let' call
|
|
1195
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1196
|
+
var tmp$ret$0;
|
|
1197
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.fsm.asAlreadyExecuted.<anonymous>' call
|
|
1198
|
+
tmp$ret$0 = tmp0_safe_receiver;
|
|
1199
|
+
tmp$ret$1 = tmp$ret$0;
|
|
1200
|
+
tmp = tmp$ret$1;
|
|
1201
|
+
}
|
|
1202
|
+
var tmp1_elvis_lhs = tmp;
|
|
1203
|
+
return tmp1_elvis_lhs == null ? new AlreadyExecutedState(_this__u8e3s4) : tmp1_elvis_lhs;
|
|
1204
|
+
}
|
|
1205
|
+
function FinalState() {
|
|
1206
|
+
}
|
|
1207
|
+
function IntermediateState() {
|
|
1208
|
+
}
|
|
1209
|
+
function internalExecute($this, state) {
|
|
1210
|
+
var tmp;
|
|
1211
|
+
if (state.o4e()) {
|
|
1212
|
+
tmp = sequenceOf([state]);
|
|
1213
|
+
} else {
|
|
1214
|
+
tmp = sequence(StateMachineExecutor$internalExecute$slambda_0(state, null));
|
|
1215
|
+
}
|
|
1216
|
+
return tmp;
|
|
1217
|
+
}
|
|
1218
|
+
function StateMachineExecutor$execute$lambda(it) {
|
|
1219
|
+
return StateMachineExecutor_getInstance().s4e(it);
|
|
1220
|
+
}
|
|
1221
|
+
function StateMachineExecutor$executeWrapping$lambda(it) {
|
|
1222
|
+
return asAlreadyExecuted(it);
|
|
1223
|
+
}
|
|
1224
|
+
function StateMachineExecutor$internalExecute$slambda($state, resultContinuation) {
|
|
1225
|
+
this.b4f_1 = $state;
|
|
1226
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
1227
|
+
}
|
|
1228
|
+
StateMachineExecutor$internalExecute$slambda.prototype.g4f = function ($this$sequence, $cont) {
|
|
1229
|
+
var tmp = this.h4f($this$sequence, $cont);
|
|
1230
|
+
tmp.ei_1 = Unit_getInstance();
|
|
1231
|
+
tmp.fi_1 = null;
|
|
1232
|
+
return tmp.ki();
|
|
1233
|
+
};
|
|
1234
|
+
StateMachineExecutor$internalExecute$slambda.prototype.wi = function (p1, $cont) {
|
|
1235
|
+
return this.g4f(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $cont);
|
|
1236
|
+
};
|
|
1237
|
+
StateMachineExecutor$internalExecute$slambda.prototype.ki = function () {
|
|
1238
|
+
var suspendResult = this.ei_1;
|
|
1239
|
+
$sm: do
|
|
1240
|
+
try {
|
|
1241
|
+
var tmp = this.ci_1;
|
|
1242
|
+
switch (tmp) {
|
|
1243
|
+
case 0:
|
|
1244
|
+
this.di_1 = 5;
|
|
1245
|
+
this.ci_1 = 1;
|
|
1246
|
+
suspendResult = this.c4f_1.z4(this.b4f_1, this);
|
|
1247
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1248
|
+
return suspendResult;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
continue $sm;
|
|
1252
|
+
case 1:
|
|
1253
|
+
var tmp_0 = this;
|
|
1254
|
+
tmp_0.d4f_1 = this.b4f_1.p4e();
|
|
1255
|
+
this.e4f_1 = this.d4f_1.j();
|
|
1256
|
+
this.ci_1 = 2;
|
|
1257
|
+
continue $sm;
|
|
1258
|
+
case 2:
|
|
1259
|
+
if (!this.e4f_1.m()) {
|
|
1260
|
+
this.ci_1 = 4;
|
|
1261
|
+
continue $sm;
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
this.f4f_1 = this.e4f_1.p();
|
|
1265
|
+
this.ci_1 = 3;
|
|
1266
|
+
suspendResult = this.c4f_1.c5(internalExecute(StateMachineExecutor_getInstance(), this.f4f_1), this);
|
|
1267
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1268
|
+
return suspendResult;
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
continue $sm;
|
|
1272
|
+
case 3:
|
|
1273
|
+
this.ci_1 = 2;
|
|
1274
|
+
continue $sm;
|
|
1275
|
+
case 4:
|
|
1276
|
+
return Unit_getInstance();
|
|
1277
|
+
case 5:
|
|
1278
|
+
throw this.fi_1;
|
|
1279
|
+
}
|
|
1280
|
+
} catch ($p) {
|
|
1281
|
+
if (this.di_1 === 5) {
|
|
1282
|
+
throw $p;
|
|
1283
|
+
} else {
|
|
1284
|
+
this.ci_1 = this.di_1;
|
|
1285
|
+
this.fi_1 = $p;
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
while (true);
|
|
1289
|
+
};
|
|
1290
|
+
StateMachineExecutor$internalExecute$slambda.prototype.h4f = function ($this$sequence, completion) {
|
|
1291
|
+
var i = new StateMachineExecutor$internalExecute$slambda(this.b4f_1, completion);
|
|
1292
|
+
i.c4f_1 = $this$sequence;
|
|
1293
|
+
return i;
|
|
1294
|
+
};
|
|
1295
|
+
function StateMachineExecutor$internalExecute$slambda_0($state, resultContinuation) {
|
|
1296
|
+
var i = new StateMachineExecutor$internalExecute$slambda($state, resultContinuation);
|
|
1297
|
+
var l = function ($this$sequence, $cont) {
|
|
1298
|
+
return i.g4f($this$sequence, $cont);
|
|
1299
|
+
};
|
|
1300
|
+
l.$arity = 1;
|
|
1301
|
+
return l;
|
|
1302
|
+
}
|
|
1303
|
+
function StateMachineExecutor() {
|
|
1304
|
+
StateMachineExecutor_instance = this;
|
|
1305
|
+
}
|
|
1306
|
+
StateMachineExecutor.prototype.j4c = function (state) {
|
|
1307
|
+
var tmp;
|
|
1308
|
+
if (state.o4e()) {
|
|
1309
|
+
tmp = emptySequence();
|
|
1310
|
+
} else {
|
|
1311
|
+
var tmp_0 = drop_0(internalExecute(this, state), 1);
|
|
1312
|
+
tmp = map(tmp_0, StateMachineExecutor$execute$lambda);
|
|
1313
|
+
}
|
|
1314
|
+
return tmp;
|
|
1315
|
+
};
|
|
1316
|
+
StateMachineExecutor.prototype.i4f = function (state) {
|
|
1317
|
+
var tmp = this.j4c(state);
|
|
1318
|
+
return map(tmp, StateMachineExecutor$executeWrapping$lambda);
|
|
1319
|
+
};
|
|
1320
|
+
StateMachineExecutor.prototype.s4e = function (_this__u8e3s4) {
|
|
1321
|
+
var tmp0_subject = _this__u8e3s4;
|
|
1322
|
+
var tmp;
|
|
1323
|
+
if (tmp0_subject instanceof AlreadyExecutedState) {
|
|
1324
|
+
tmp = _this__u8e3s4.q4e_1;
|
|
1325
|
+
} else {
|
|
1326
|
+
tmp = _this__u8e3s4;
|
|
1327
|
+
}
|
|
1328
|
+
return tmp;
|
|
1329
|
+
};
|
|
1330
|
+
var StateMachineExecutor_instance;
|
|
1331
|
+
function StateMachineExecutor_getInstance() {
|
|
1332
|
+
if (StateMachineExecutor_instance == null)
|
|
1333
|
+
new StateMachineExecutor();
|
|
1334
|
+
return StateMachineExecutor_instance;
|
|
1335
|
+
}
|
|
1336
|
+
function statEndHaltTimeout(_this__u8e3s4, $this) {
|
|
1337
|
+
var tmp = 'Given time for `' + _this__u8e3s4.h4c().x1v() + '` computation (' + toString(_this__u8e3s4.h4c().w29_1) + ") wasn't enough for completion";
|
|
1338
|
+
var tmp_0 = TimeOutException_init_$Create$(tmp, null, _this__u8e3s4.h4c().context, _this__u8e3s4.h4c().w29_1, 2, null);
|
|
1339
|
+
return stateEndHalt$default(_this__u8e3s4, tmp_0, null, [], 6, null);
|
|
1340
|
+
}
|
|
1341
|
+
function _get_stateCurrentTime__3c8uza($this) {
|
|
1342
|
+
var tmp$ret$0;
|
|
1343
|
+
// Inline function 'kotlin.getValue' call
|
|
1344
|
+
var tmp0_getValue = stateCurrentTime$factory();
|
|
1345
|
+
tmp$ret$0 = $this.m4f_1.b1();
|
|
1346
|
+
return tmp$ret$0;
|
|
1347
|
+
}
|
|
1348
|
+
function timeIsOver($this, currentDuration, maxDuration) {
|
|
1349
|
+
return currentDuration.jd(maxDuration) >= 0;
|
|
1350
|
+
}
|
|
1351
|
+
function Companion_1() {
|
|
1352
|
+
Companion_instance_1 = this;
|
|
1353
|
+
}
|
|
1354
|
+
var Companion_instance_1;
|
|
1355
|
+
function Companion_getInstance_17() {
|
|
1356
|
+
if (Companion_instance_1 == null)
|
|
1357
|
+
new Companion_1();
|
|
1358
|
+
return Companion_instance_1;
|
|
1359
|
+
}
|
|
1360
|
+
function AbstractTimedState$stateCurrentTime$delegate$lambda() {
|
|
1361
|
+
return currentTimeInstant();
|
|
1362
|
+
}
|
|
1363
|
+
function AbstractTimedState(solve) {
|
|
1364
|
+
Companion_getInstance_17();
|
|
1365
|
+
AbstractState.call(this, solve);
|
|
1366
|
+
this.l4f_1 = solve;
|
|
1367
|
+
var tmp = this;
|
|
1368
|
+
tmp.m4f_1 = lazy(AbstractTimedState$stateCurrentTime$delegate$lambda);
|
|
1369
|
+
}
|
|
1370
|
+
AbstractTimedState.prototype.h4c = function () {
|
|
1371
|
+
return this.l4f_1;
|
|
1372
|
+
};
|
|
1373
|
+
AbstractTimedState.prototype.p4e = function () {
|
|
1374
|
+
var tmp;
|
|
1375
|
+
var tmp_0 = this.h4c().w29_1;
|
|
1376
|
+
Companion_getInstance_9();
|
|
1377
|
+
if (tmp_0.equals(new Long(-1, 2147483647))) {
|
|
1378
|
+
tmp = this.n4f();
|
|
1379
|
+
} else {
|
|
1380
|
+
if (timeIsOver(this, _get_stateCurrentTime__3c8uza(this).ch(this.h4c().v29_1), this.h4c().w29_1)) {
|
|
1381
|
+
tmp = sequenceOf([statEndHaltTimeout(this, Companion_getInstance_17())]);
|
|
1382
|
+
} else {
|
|
1383
|
+
tmp = this.n4f();
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
return tmp;
|
|
1387
|
+
};
|
|
1388
|
+
AbstractTimedState.prototype.o4f = function (_this__u8e3s4, toYieldState) {
|
|
1389
|
+
return timeIsOver(this, currentTimeInstant().ch(_this__u8e3s4.h4c().v29_1), _this__u8e3s4.h4c().w29_1) ? statEndHaltTimeout(_this__u8e3s4, Companion_getInstance_17()) : toYieldState;
|
|
1390
|
+
};
|
|
1391
|
+
AbstractTimedState.prototype.toString = function () {
|
|
1392
|
+
return '' + getKClassFromExpression(this) + ' with ' + this.h4c();
|
|
1393
|
+
};
|
|
1394
|
+
function stateCurrentTime$factory() {
|
|
1395
|
+
return getPropertyCallableRef('stateCurrentTime', 1, KProperty1, function (receiver) {
|
|
1396
|
+
return _get_stateCurrentTime__3c8uza(receiver);
|
|
1397
|
+
}, null);
|
|
1398
|
+
}
|
|
1399
|
+
function StateEnd$Halt$exception$delegate$lambda(this$0) {
|
|
1400
|
+
return function () {
|
|
1401
|
+
var tmp = this$0.v4f_1.solution;
|
|
1402
|
+
return (isInterface(tmp, Halt) ? tmp : THROW_CCE()).c1w();
|
|
1403
|
+
};
|
|
1404
|
+
}
|
|
1405
|
+
function True(sourceContext, solve) {
|
|
1406
|
+
StateEnd.call(this, sourceContext, solve);
|
|
1407
|
+
this.c4g_1 = sourceContext;
|
|
1408
|
+
this.d4g_1 = solve;
|
|
1409
|
+
// Inline function 'kotlin.require' call
|
|
1410
|
+
var tmp = this.d4g_1.solution;
|
|
1411
|
+
var tmp0_require = isInterface(tmp, Yes);
|
|
1412
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1413
|
+
if (!tmp0_require) {
|
|
1414
|
+
var tmp$ret$0;
|
|
1415
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.fsm.impl.True.<anonymous>' call
|
|
1416
|
+
tmp$ret$0 = 'True end state can be created only with Solution.Yes. Current: `' + this.d4g_1.solution + '`';
|
|
1417
|
+
var message = tmp$ret$0;
|
|
1418
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
True.prototype.h4c = function () {
|
|
1422
|
+
return this.d4g_1;
|
|
1423
|
+
};
|
|
1424
|
+
True.prototype.toString = function () {
|
|
1425
|
+
return 'True(sourceContext=' + this.c4g_1 + ', solve=' + this.d4g_1 + ')';
|
|
1426
|
+
};
|
|
1427
|
+
True.prototype.hashCode = function () {
|
|
1428
|
+
var result = hashCode(this.c4g_1);
|
|
1429
|
+
result = imul(result, 31) + this.d4g_1.hashCode() | 0;
|
|
1430
|
+
return result;
|
|
1431
|
+
};
|
|
1432
|
+
True.prototype.equals = function (other) {
|
|
1433
|
+
if (this === other)
|
|
1434
|
+
return true;
|
|
1435
|
+
if (!(other instanceof True))
|
|
1436
|
+
return false;
|
|
1437
|
+
var tmp0_other_with_cast = other instanceof True ? other : THROW_CCE();
|
|
1438
|
+
if (!equals(this.c4g_1, tmp0_other_with_cast.c4g_1))
|
|
1439
|
+
return false;
|
|
1440
|
+
if (!this.d4g_1.equals(tmp0_other_with_cast.d4g_1))
|
|
1441
|
+
return false;
|
|
1442
|
+
return true;
|
|
1443
|
+
};
|
|
1444
|
+
function False(sourceContext, solve) {
|
|
1445
|
+
StateEnd.call(this, sourceContext, solve);
|
|
1446
|
+
this.o4g_1 = sourceContext;
|
|
1447
|
+
this.p4g_1 = solve;
|
|
1448
|
+
// Inline function 'kotlin.require' call
|
|
1449
|
+
var tmp = this.p4g_1.solution;
|
|
1450
|
+
var tmp0_require = isInterface(tmp, No);
|
|
1451
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1452
|
+
if (!tmp0_require) {
|
|
1453
|
+
var tmp$ret$0;
|
|
1454
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.fsm.impl.False.<anonymous>' call
|
|
1455
|
+
tmp$ret$0 = 'False end state can be created only with Solution.No. Current: `' + this.p4g_1.solution + '`';
|
|
1456
|
+
var message = tmp$ret$0;
|
|
1457
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
False.prototype.h4c = function () {
|
|
1461
|
+
return this.p4g_1;
|
|
1462
|
+
};
|
|
1463
|
+
False.prototype.toString = function () {
|
|
1464
|
+
return 'False(sourceContext=' + this.o4g_1 + ', solve=' + this.p4g_1 + ')';
|
|
1465
|
+
};
|
|
1466
|
+
False.prototype.hashCode = function () {
|
|
1467
|
+
var result = hashCode(this.o4g_1);
|
|
1468
|
+
result = imul(result, 31) + this.p4g_1.hashCode() | 0;
|
|
1469
|
+
return result;
|
|
1470
|
+
};
|
|
1471
|
+
False.prototype.equals = function (other) {
|
|
1472
|
+
if (this === other)
|
|
1473
|
+
return true;
|
|
1474
|
+
if (!(other instanceof False))
|
|
1475
|
+
return false;
|
|
1476
|
+
var tmp0_other_with_cast = other instanceof False ? other : THROW_CCE();
|
|
1477
|
+
if (!equals(this.o4g_1, tmp0_other_with_cast.o4g_1))
|
|
1478
|
+
return false;
|
|
1479
|
+
if (!this.p4g_1.equals(tmp0_other_with_cast.p4g_1))
|
|
1480
|
+
return false;
|
|
1481
|
+
return true;
|
|
1482
|
+
};
|
|
1483
|
+
function Halt_0(sourceContext, solve) {
|
|
1484
|
+
StateEnd.call(this, sourceContext, solve);
|
|
1485
|
+
this.u4f_1 = sourceContext;
|
|
1486
|
+
this.v4f_1 = solve;
|
|
1487
|
+
// Inline function 'kotlin.require' call
|
|
1488
|
+
var tmp = this.v4f_1.solution;
|
|
1489
|
+
var tmp0_require = isInterface(tmp, Halt);
|
|
1490
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1491
|
+
if (!tmp0_require) {
|
|
1492
|
+
var tmp$ret$0;
|
|
1493
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.fsm.impl.Halt.<anonymous>' call
|
|
1494
|
+
tmp$ret$0 = 'Halt end state can be created only with Solution.Halt. Current: `' + this.v4f_1.solution + '`';
|
|
1495
|
+
var message = tmp$ret$0;
|
|
1496
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
1497
|
+
}
|
|
1498
|
+
var tmp_0 = this;
|
|
1499
|
+
tmp_0.w4f_1 = lazy(StateEnd$Halt$exception$delegate$lambda(this));
|
|
1500
|
+
}
|
|
1501
|
+
Halt_0.prototype.h4c = function () {
|
|
1502
|
+
return this.v4f_1;
|
|
1503
|
+
};
|
|
1504
|
+
Halt_0.prototype.toString = function () {
|
|
1505
|
+
return 'Halt(sourceContext=' + this.u4f_1 + ', solve=' + this.v4f_1 + ')';
|
|
1506
|
+
};
|
|
1507
|
+
Halt_0.prototype.hashCode = function () {
|
|
1508
|
+
var result = hashCode(this.u4f_1);
|
|
1509
|
+
result = imul(result, 31) + this.v4f_1.hashCode() | 0;
|
|
1510
|
+
return result;
|
|
1511
|
+
};
|
|
1512
|
+
Halt_0.prototype.equals = function (other) {
|
|
1513
|
+
if (this === other)
|
|
1514
|
+
return true;
|
|
1515
|
+
if (!(other instanceof Halt_0))
|
|
1516
|
+
return false;
|
|
1517
|
+
var tmp0_other_with_cast = other instanceof Halt_0 ? other : THROW_CCE();
|
|
1518
|
+
if (!equals(this.u4f_1, tmp0_other_with_cast.u4f_1))
|
|
1519
|
+
return false;
|
|
1520
|
+
if (!this.v4f_1.equals(tmp0_other_with_cast.v4f_1))
|
|
1521
|
+
return false;
|
|
1522
|
+
return true;
|
|
1523
|
+
};
|
|
1524
|
+
function StateEnd$context$delegate$lambda(this$0) {
|
|
1525
|
+
return function () {
|
|
1526
|
+
var tmp = this$0.h4c().solution.r1u();
|
|
1527
|
+
var tmp0_elvis_lhs = isInterface(tmp, Unifier) ? tmp : null;
|
|
1528
|
+
return StreamsExecutionContext_init_$Create$_0(this$0.g4g_1, tmp0_elvis_lhs == null ? Companion_getInstance_3().empty() : tmp0_elvis_lhs);
|
|
1529
|
+
};
|
|
1530
|
+
}
|
|
1531
|
+
function StateEnd(sourceContext, solve) {
|
|
1532
|
+
AbstractState.call(this, solve);
|
|
1533
|
+
this.g4g_1 = sourceContext;
|
|
1534
|
+
this.h4g_1 = solve;
|
|
1535
|
+
var tmp = this;
|
|
1536
|
+
tmp.i4g_1 = lazy(StateEnd$context$delegate$lambda(this));
|
|
1537
|
+
}
|
|
1538
|
+
StateEnd.prototype.h4c = function () {
|
|
1539
|
+
return this.h4g_1;
|
|
1540
|
+
};
|
|
1541
|
+
StateEnd.prototype.p4e = function () {
|
|
1542
|
+
return emptySequence();
|
|
1543
|
+
};
|
|
1544
|
+
StateEnd.prototype.j5 = function () {
|
|
1545
|
+
var tmp$ret$0;
|
|
1546
|
+
// Inline function 'kotlin.getValue' call
|
|
1547
|
+
var tmp0_getValue = context$factory();
|
|
1548
|
+
tmp$ret$0 = this.i4g_1.b1();
|
|
1549
|
+
return tmp$ret$0;
|
|
1550
|
+
};
|
|
1551
|
+
function stateEndTrue(_this__u8e3s4, substitution, sideEffectManager, sideEffects) {
|
|
1552
|
+
var tmp = _this__u8e3s4.j5();
|
|
1553
|
+
var tmp_0 = _this__u8e3s4.h4c();
|
|
1554
|
+
var tmp0_elvis_lhs = sideEffectManager;
|
|
1555
|
+
return new True(tmp, tmp_0.m2i(substitution, tmp0_elvis_lhs == null ? getSideEffectManager(_this__u8e3s4.h4c().context) : tmp0_elvis_lhs, sideEffects.slice()));
|
|
1556
|
+
}
|
|
1557
|
+
function stateEndTrue$default(_this__u8e3s4, substitution, sideEffectManager, sideEffects, $mask0, $handler) {
|
|
1558
|
+
if (!(($mask0 & 1) === 0))
|
|
1559
|
+
substitution = Companion_getInstance_3().empty();
|
|
1560
|
+
if (!(($mask0 & 2) === 0))
|
|
1561
|
+
sideEffectManager = null;
|
|
1562
|
+
return stateEndTrue(_this__u8e3s4, substitution, sideEffectManager, sideEffects);
|
|
1563
|
+
}
|
|
1564
|
+
function stateEndFalse(_this__u8e3s4, sideEffectManager, sideEffects) {
|
|
1565
|
+
var tmp = _this__u8e3s4.j5();
|
|
1566
|
+
var tmp_0 = _this__u8e3s4.h4c();
|
|
1567
|
+
var tmp0_elvis_lhs = sideEffectManager;
|
|
1568
|
+
return new False(tmp, tmp_0.n2i(tmp0_elvis_lhs == null ? getSideEffectManager(_this__u8e3s4.h4c().context) : tmp0_elvis_lhs, sideEffects.slice()));
|
|
1569
|
+
}
|
|
1570
|
+
function stateEndFalse$default(_this__u8e3s4, sideEffectManager, sideEffects, $mask0, $handler) {
|
|
1571
|
+
if (!(($mask0 & 1) === 0))
|
|
1572
|
+
sideEffectManager = null;
|
|
1573
|
+
return stateEndFalse(_this__u8e3s4, sideEffectManager, sideEffects);
|
|
1574
|
+
}
|
|
1575
|
+
function stateEndHalt(_this__u8e3s4, exception, sideEffectManager, sideEffects) {
|
|
1576
|
+
var tmp = _this__u8e3s4.j5();
|
|
1577
|
+
var tmp_0 = _this__u8e3s4.h4c();
|
|
1578
|
+
var tmp0_elvis_lhs = sideEffectManager;
|
|
1579
|
+
var tmp1_elvis_lhs = tmp0_elvis_lhs == null ? getSideEffectManager(exception.j5()) : tmp0_elvis_lhs;
|
|
1580
|
+
return new Halt_0(tmp, tmp_0.o2i(exception, tmp1_elvis_lhs == null ? getSideEffectManager(_this__u8e3s4.h4c().context) : tmp1_elvis_lhs, sideEffects.slice()));
|
|
1581
|
+
}
|
|
1582
|
+
function stateEndHalt$default(_this__u8e3s4, exception, sideEffectManager, sideEffects, $mask0, $handler) {
|
|
1583
|
+
if (!(($mask0 & 2) === 0))
|
|
1584
|
+
sideEffectManager = null;
|
|
1585
|
+
return stateEndHalt(_this__u8e3s4, exception, sideEffectManager, sideEffects);
|
|
1586
|
+
}
|
|
1587
|
+
function stateEnd(_this__u8e3s4, response) {
|
|
1588
|
+
var tmp$ret$2;
|
|
1589
|
+
// Inline function 'kotlin.with' call
|
|
1590
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1591
|
+
var tmp$ret$1;
|
|
1592
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.fsm.impl.stateEnd.<anonymous>' call
|
|
1593
|
+
var tmp$ret$0;
|
|
1594
|
+
// Inline function 'kotlin.collections.toTypedArray' call
|
|
1595
|
+
var tmp0_toTypedArray = response.sideEffects;
|
|
1596
|
+
tmp$ret$0 = copyToArray(tmp0_toTypedArray);
|
|
1597
|
+
tmp$ret$1 = stateEnd_0(_this__u8e3s4, response.solution, response.sideEffectManager, tmp$ret$0.slice());
|
|
1598
|
+
tmp$ret$2 = tmp$ret$1;
|
|
1599
|
+
return tmp$ret$2;
|
|
1600
|
+
}
|
|
1601
|
+
function stateEnd_0(_this__u8e3s4, solution, sideEffectManager, sideEffects) {
|
|
1602
|
+
var tmp = stateEnd$lambda(_this__u8e3s4, sideEffectManager, sideEffects);
|
|
1603
|
+
var tmp_0 = stateEnd$lambda_0(_this__u8e3s4, sideEffectManager, sideEffects);
|
|
1604
|
+
var tmp_1 = stateEnd$lambda_1(_this__u8e3s4, sideEffectManager, sideEffects);
|
|
1605
|
+
return solution.h1w(tmp, tmp_0, tmp_1, null, 8, null);
|
|
1606
|
+
}
|
|
1607
|
+
function stateEnd$lambda($this_stateEnd, $sideEffectManager, $sideEffects) {
|
|
1608
|
+
return function (sol) {
|
|
1609
|
+
var tmp$ret$1;
|
|
1610
|
+
// Inline function 'kotlin.takeUnless' call
|
|
1611
|
+
var tmp0_takeUnless = sol.r1u();
|
|
1612
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1613
|
+
var tmp;
|
|
1614
|
+
var tmp$ret$0;
|
|
1615
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.fsm.impl.stateEnd.<anonymous>.<anonymous>' call
|
|
1616
|
+
tmp$ret$0 = tmp0_takeUnless.d();
|
|
1617
|
+
if (!tmp$ret$0) {
|
|
1618
|
+
tmp = tmp0_takeUnless;
|
|
1619
|
+
} else {
|
|
1620
|
+
tmp = null;
|
|
1621
|
+
}
|
|
1622
|
+
tmp$ret$1 = tmp;
|
|
1623
|
+
var tmp0_elvis_lhs = tmp$ret$1;
|
|
1624
|
+
return stateEndTrue($this_stateEnd, tmp0_elvis_lhs == null ? $this_stateEnd.h4c().context.r1u() : tmp0_elvis_lhs, $sideEffectManager, $sideEffects.slice());
|
|
1625
|
+
};
|
|
1626
|
+
}
|
|
1627
|
+
function stateEnd$lambda_0($this_stateEnd, $sideEffectManager, $sideEffects) {
|
|
1628
|
+
return function (it) {
|
|
1629
|
+
return stateEndFalse($this_stateEnd, $sideEffectManager, $sideEffects.slice());
|
|
1630
|
+
};
|
|
1631
|
+
}
|
|
1632
|
+
function stateEnd$lambda_1($this_stateEnd, $sideEffectManager, $sideEffects) {
|
|
1633
|
+
return function (it) {
|
|
1634
|
+
return stateEndHalt($this_stateEnd, it.c1w(), $sideEffectManager, $sideEffects.slice());
|
|
1635
|
+
};
|
|
1636
|
+
}
|
|
1637
|
+
function context$factory() {
|
|
1638
|
+
return getPropertyCallableRef('context', 1, KProperty1, function (receiver) {
|
|
1639
|
+
return receiver.j5();
|
|
1640
|
+
}, null);
|
|
1641
|
+
}
|
|
1642
|
+
function newThrowSolveRequest(_this__u8e3s4, $this, error) {
|
|
1643
|
+
var tmp = Companion_getInstance_10();
|
|
1644
|
+
var tmp$ret$0;
|
|
1645
|
+
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
1646
|
+
var tmp0__get_functor__thl4dk = Throw_getInstance();
|
|
1647
|
+
tmp$ret$0 = tmp0__get_functor__thl4dk.signature.name;
|
|
1648
|
+
var tmp_0 = tmp.of(tmp$ret$0, [error.f25()]);
|
|
1649
|
+
var tmp0_elvis_lhs = getSideEffectManager(error.j5());
|
|
1650
|
+
var tmp_1 = tmp0_elvis_lhs == null ? _this__u8e3s4.context.z4c_1 : tmp0_elvis_lhs;
|
|
1651
|
+
var tmp_2 = currentTimeInstant();
|
|
1652
|
+
return newSolveRequest$default(_this__u8e3s4, tmp_0, null, null, tmp_1, tmp_2, false, 38, null);
|
|
1653
|
+
}
|
|
1654
|
+
function Companion_2() {
|
|
1655
|
+
Companion_instance_2 = this;
|
|
1656
|
+
}
|
|
1657
|
+
var Companion_instance_2;
|
|
1658
|
+
function Companion_getInstance_18() {
|
|
1659
|
+
if (Companion_instance_2 == null)
|
|
1660
|
+
new Companion_2();
|
|
1661
|
+
return Companion_instance_2;
|
|
1662
|
+
}
|
|
1663
|
+
function StateGoalEvaluation$behaveTimed$slambda(this$0, resultContinuation) {
|
|
1664
|
+
this.y4g_1 = this$0;
|
|
1665
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
1666
|
+
}
|
|
1667
|
+
StateGoalEvaluation$behaveTimed$slambda.prototype.g4f = function ($this$sequence, $cont) {
|
|
1668
|
+
var tmp = this.h4f($this$sequence, $cont);
|
|
1669
|
+
tmp.ei_1 = Unit_getInstance();
|
|
1670
|
+
tmp.fi_1 = null;
|
|
1671
|
+
return tmp.ki();
|
|
1672
|
+
};
|
|
1673
|
+
StateGoalEvaluation$behaveTimed$slambda.prototype.wi = function (p1, $cont) {
|
|
1674
|
+
return this.g4f(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $cont);
|
|
1675
|
+
};
|
|
1676
|
+
StateGoalEvaluation$behaveTimed$slambda.prototype.ki = function () {
|
|
1677
|
+
var suspendResult = this.ei_1;
|
|
1678
|
+
$sm: do
|
|
1679
|
+
try {
|
|
1680
|
+
var tmp = this.ci_1;
|
|
1681
|
+
switch (tmp) {
|
|
1682
|
+
case 0:
|
|
1683
|
+
this.di_1 = 11;
|
|
1684
|
+
var tmp_0 = this;
|
|
1685
|
+
var tmp0_with = this.y4g_1.r4h_1;
|
|
1686
|
+
tmp_0.a4h_1 = tmp0_with.context.n4c_1.h2e().a3(tmp0_with.signature);
|
|
1687
|
+
this.b4h_1 = this.a4h_1;
|
|
1688
|
+
if (this.b4h_1 == null) {
|
|
1689
|
+
this.c4h_1 = null;
|
|
1690
|
+
this.ci_1 = 8;
|
|
1691
|
+
continue $sm;
|
|
1692
|
+
} else {
|
|
1693
|
+
this.d4h_1 = null;
|
|
1694
|
+
this.di_1 = 1;
|
|
1695
|
+
this.d4h_1 = this.a4h_1.solve(this.y4g_1.r4h_1);
|
|
1696
|
+
this.di_1 = 11;
|
|
1697
|
+
this.ci_1 = 3;
|
|
1698
|
+
continue $sm;
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
break;
|
|
1702
|
+
case 1:
|
|
1703
|
+
this.di_1 = 11;
|
|
1704
|
+
var tmp_1 = this.fi_1;
|
|
1705
|
+
if (tmp_1 instanceof HaltException) {
|
|
1706
|
+
this.e4h_1 = this.fi_1;
|
|
1707
|
+
this.ci_1 = 2;
|
|
1708
|
+
suspendResult = this.z4g_1.z4(stateEndHalt$default(this.y4g_1, this.e4h_1, null, [], 6, null), this);
|
|
1709
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1710
|
+
return suspendResult;
|
|
1711
|
+
}
|
|
1712
|
+
continue $sm;
|
|
1713
|
+
} else {
|
|
1714
|
+
var tmp_2 = this.fi_1;
|
|
1715
|
+
if (tmp_2 instanceof LogicError) {
|
|
1716
|
+
this.f4h_1 = this.fi_1;
|
|
1717
|
+
this.d4h_1 = Companion_getInstance_16().k4c(newThrowSolveRequest(this.y4g_1.r4h_1, Companion_getInstance_18(), this.f4h_1));
|
|
1718
|
+
this.ci_1 = 3;
|
|
1719
|
+
continue $sm;
|
|
1720
|
+
} else {
|
|
1721
|
+
throw this.fi_1;
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
break;
|
|
1726
|
+
case 2:
|
|
1727
|
+
this.ci_1 = 3;
|
|
1728
|
+
continue $sm;
|
|
1729
|
+
case 3:
|
|
1730
|
+
this.di_1 = 11;
|
|
1731
|
+
this.g4h_1 = emptyList();
|
|
1732
|
+
this.h4h_1 = this.d4h_1;
|
|
1733
|
+
if (this.h4h_1 == null) {
|
|
1734
|
+
this.i4h_1 = null;
|
|
1735
|
+
this.ci_1 = 7;
|
|
1736
|
+
continue $sm;
|
|
1737
|
+
} else {
|
|
1738
|
+
this.j4h_1 = this.h4h_1.j();
|
|
1739
|
+
this.ci_1 = 4;
|
|
1740
|
+
continue $sm;
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
break;
|
|
1744
|
+
case 4:
|
|
1745
|
+
if (!this.j4h_1.m()) {
|
|
1746
|
+
this.ci_1 = 6;
|
|
1747
|
+
continue $sm;
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
this.k4h_1 = this.j4h_1.p();
|
|
1751
|
+
this.g4h_1 = addWithNoDuplicates(this.g4h_1, this.k4h_1.sideEffects);
|
|
1752
|
+
this.ci_1 = 5;
|
|
1753
|
+
suspendResult = this.z4g_1.z4(this.y4g_1.o4f(this.y4g_1, stateEnd(this.y4g_1, this.k4h_1.l2j(null, null, this.g4h_1, 3, null))), this);
|
|
1754
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1755
|
+
return suspendResult;
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
continue $sm;
|
|
1759
|
+
case 5:
|
|
1760
|
+
var tmp_3 = this.k4h_1.solution;
|
|
1761
|
+
if (isInterface(tmp_3, Halt))
|
|
1762
|
+
return Unit_getInstance();
|
|
1763
|
+
this.ci_1 = 4;
|
|
1764
|
+
continue $sm;
|
|
1765
|
+
case 6:
|
|
1766
|
+
this.i4h_1 = Unit_getInstance();
|
|
1767
|
+
this.ci_1 = 7;
|
|
1768
|
+
continue $sm;
|
|
1769
|
+
case 7:
|
|
1770
|
+
;
|
|
1771
|
+
this.c4h_1 = this.b4h_1;
|
|
1772
|
+
this.ci_1 = 8;
|
|
1773
|
+
continue $sm;
|
|
1774
|
+
case 8:
|
|
1775
|
+
this.l4h_1 = this.c4h_1;
|
|
1776
|
+
if (this.l4h_1 == null) {
|
|
1777
|
+
this.ci_1 = 9;
|
|
1778
|
+
suspendResult = this.z4g_1.z4(new StateRuleSelection(this.y4g_1.r4h_1), this);
|
|
1779
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1780
|
+
return suspendResult;
|
|
1781
|
+
}
|
|
1782
|
+
continue $sm;
|
|
1783
|
+
} else {
|
|
1784
|
+
this.m4h_1 = this.l4h_1;
|
|
1785
|
+
this.ci_1 = 10;
|
|
1786
|
+
continue $sm;
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
;
|
|
1790
|
+
break;
|
|
1791
|
+
case 9:
|
|
1792
|
+
var tmp_4 = this;
|
|
1793
|
+
tmp_4.m4h_1 = Unit_getInstance();
|
|
1794
|
+
this.ci_1 = 10;
|
|
1795
|
+
continue $sm;
|
|
1796
|
+
case 10:
|
|
1797
|
+
;
|
|
1798
|
+
return Unit_getInstance();
|
|
1799
|
+
case 11:
|
|
1800
|
+
throw this.fi_1;
|
|
1801
|
+
}
|
|
1802
|
+
} catch ($p) {
|
|
1803
|
+
if (this.di_1 === 11) {
|
|
1804
|
+
throw $p;
|
|
1805
|
+
} else {
|
|
1806
|
+
this.ci_1 = this.di_1;
|
|
1807
|
+
this.fi_1 = $p;
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
while (true);
|
|
1811
|
+
};
|
|
1812
|
+
StateGoalEvaluation$behaveTimed$slambda.prototype.h4f = function ($this$sequence, completion) {
|
|
1813
|
+
var i = new StateGoalEvaluation$behaveTimed$slambda(this.y4g_1, completion);
|
|
1814
|
+
i.z4g_1 = $this$sequence;
|
|
1815
|
+
return i;
|
|
1816
|
+
};
|
|
1817
|
+
function StateGoalEvaluation$behaveTimed$slambda_0(this$0, resultContinuation) {
|
|
1818
|
+
var i = new StateGoalEvaluation$behaveTimed$slambda(this$0, resultContinuation);
|
|
1819
|
+
var l = function ($this$sequence, $cont) {
|
|
1820
|
+
return i.g4f($this$sequence, $cont);
|
|
1821
|
+
};
|
|
1822
|
+
l.$arity = 1;
|
|
1823
|
+
return l;
|
|
1824
|
+
}
|
|
1825
|
+
function StateGoalEvaluation(solve) {
|
|
1826
|
+
Companion_getInstance_18();
|
|
1827
|
+
AbstractTimedState.call(this, solve);
|
|
1828
|
+
this.r4h_1 = solve;
|
|
1829
|
+
}
|
|
1830
|
+
StateGoalEvaluation.prototype.h4c = function () {
|
|
1831
|
+
return this.r4h_1;
|
|
1832
|
+
};
|
|
1833
|
+
StateGoalEvaluation.prototype.n4f = function () {
|
|
1834
|
+
return sequence(StateGoalEvaluation$behaveTimed$slambda_0(this, null));
|
|
1835
|
+
};
|
|
1836
|
+
function StateInit$behaveTimed$slambda(this$0, resultContinuation) {
|
|
1837
|
+
this.a4i_1 = this$0;
|
|
1838
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
1839
|
+
}
|
|
1840
|
+
StateInit$behaveTimed$slambda.prototype.g4f = function ($this$sequence, $cont) {
|
|
1841
|
+
var tmp = this.h4f($this$sequence, $cont);
|
|
1842
|
+
tmp.ei_1 = Unit_getInstance();
|
|
1843
|
+
tmp.fi_1 = null;
|
|
1844
|
+
return tmp.ki();
|
|
1845
|
+
};
|
|
1846
|
+
StateInit$behaveTimed$slambda.prototype.wi = function (p1, $cont) {
|
|
1847
|
+
return this.g4f(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $cont);
|
|
1848
|
+
};
|
|
1849
|
+
StateInit$behaveTimed$slambda.prototype.ki = function () {
|
|
1850
|
+
var suspendResult = this.ei_1;
|
|
1851
|
+
$sm: do
|
|
1852
|
+
try {
|
|
1853
|
+
var tmp = this.ci_1;
|
|
1854
|
+
switch (tmp) {
|
|
1855
|
+
case 0:
|
|
1856
|
+
this.di_1 = 6;
|
|
1857
|
+
var tmp_0 = this;
|
|
1858
|
+
var tmp0_with = this.a4i_1.j4i_1.context;
|
|
1859
|
+
tmp_0.c4i_1 = tmp0_with.z4c_1.j4d(tmp0_with);
|
|
1860
|
+
this.d4i_1 = this.a4i_1.j4i_1.x1v();
|
|
1861
|
+
var tmp1_with = this.a4i_1.j4i_1.context;
|
|
1862
|
+
if (tmp1_with.y4c_1.f4c(this.d4i_1, tmp1_with)) {
|
|
1863
|
+
this.ci_1 = 4;
|
|
1864
|
+
suspendResult = this.b4i_1.z4(this.a4i_1.o4f(this.a4i_1, stateEndTrue$default(this.a4i_1, this.a4i_1.j4i_1.context.v4c_1, this.c4i_1, [], 4, null)), this);
|
|
1865
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1866
|
+
return suspendResult;
|
|
1867
|
+
}
|
|
1868
|
+
continue $sm;
|
|
1869
|
+
} else {
|
|
1870
|
+
if (isWellFormed(this.d4i_1)) {
|
|
1871
|
+
var tmp_1 = this;
|
|
1872
|
+
tmp_1.e4i_1 = prepareForExecutionAsGoal(this.d4i_1);
|
|
1873
|
+
this.ci_1 = 2;
|
|
1874
|
+
var tmp_2 = extractSignature(this.e4i_1);
|
|
1875
|
+
var tmp_3 = this.e4i_1.gw();
|
|
1876
|
+
var tmp0_with_0 = this.a4i_1.j4i_1.context;
|
|
1877
|
+
var tmp_4 = new Long(0, 0);
|
|
1878
|
+
var tmp_5 = new Long(0, 0);
|
|
1879
|
+
var tmp_6 = tmp0_with_0.v4d(null, null, null, null, null, null, null, null, null, null, tmp_4, tmp_5, null, this.c4i_1, 8191, null);
|
|
1880
|
+
var tmp_7 = new Long(0, 0);
|
|
1881
|
+
suspendResult = this.b4i_1.z4(new StateGoalEvaluation(this.a4i_1.j4i_1.g2j(tmp_2, tmp_3, tmp_6, tmp_7, new Long(0, 0), 24, null)), this);
|
|
1882
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1883
|
+
return suspendResult;
|
|
1884
|
+
}
|
|
1885
|
+
continue $sm;
|
|
1886
|
+
} else {
|
|
1887
|
+
this.ci_1 = 1;
|
|
1888
|
+
suspendResult = this.b4i_1.z4(stateEndFalse$default(this.a4i_1, this.c4i_1, [], 2, null), this);
|
|
1889
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1890
|
+
return suspendResult;
|
|
1891
|
+
}
|
|
1892
|
+
continue $sm;
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
break;
|
|
1897
|
+
case 1:
|
|
1898
|
+
this.ci_1 = 3;
|
|
1899
|
+
continue $sm;
|
|
1900
|
+
case 2:
|
|
1901
|
+
;
|
|
1902
|
+
this.ci_1 = 3;
|
|
1903
|
+
continue $sm;
|
|
1904
|
+
case 3:
|
|
1905
|
+
this.ci_1 = 5;
|
|
1906
|
+
continue $sm;
|
|
1907
|
+
case 4:
|
|
1908
|
+
this.ci_1 = 5;
|
|
1909
|
+
continue $sm;
|
|
1910
|
+
case 5:
|
|
1911
|
+
return Unit_getInstance();
|
|
1912
|
+
case 6:
|
|
1913
|
+
throw this.fi_1;
|
|
1914
|
+
}
|
|
1915
|
+
} catch ($p) {
|
|
1916
|
+
if (this.di_1 === 6) {
|
|
1917
|
+
throw $p;
|
|
1918
|
+
} else {
|
|
1919
|
+
this.ci_1 = this.di_1;
|
|
1920
|
+
this.fi_1 = $p;
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
while (true);
|
|
1924
|
+
};
|
|
1925
|
+
StateInit$behaveTimed$slambda.prototype.h4f = function ($this$sequence, completion) {
|
|
1926
|
+
var i = new StateInit$behaveTimed$slambda(this.a4i_1, completion);
|
|
1927
|
+
i.b4i_1 = $this$sequence;
|
|
1928
|
+
return i;
|
|
1929
|
+
};
|
|
1930
|
+
function StateInit$behaveTimed$slambda_0(this$0, resultContinuation) {
|
|
1931
|
+
var i = new StateInit$behaveTimed$slambda(this$0, resultContinuation);
|
|
1932
|
+
var l = function ($this$sequence, $cont) {
|
|
1933
|
+
return i.g4f($this$sequence, $cont);
|
|
1934
|
+
};
|
|
1935
|
+
l.$arity = 1;
|
|
1936
|
+
return l;
|
|
1937
|
+
}
|
|
1938
|
+
function StateInit(solve) {
|
|
1939
|
+
AbstractTimedState.call(this, solve);
|
|
1940
|
+
this.j4i_1 = solve;
|
|
1941
|
+
}
|
|
1942
|
+
StateInit.prototype.h4c = function () {
|
|
1943
|
+
return this.j4i_1;
|
|
1944
|
+
};
|
|
1945
|
+
StateInit.prototype.n4f = function () {
|
|
1946
|
+
return sequence(StateInit$behaveTimed$slambda_0(this, null));
|
|
1947
|
+
};
|
|
1948
|
+
function retrieveRulesMatching(_this__u8e3s4, $this, currentGoal) {
|
|
1949
|
+
var tmp$ret$3;
|
|
1950
|
+
// Inline function 'kotlin.let' call
|
|
1951
|
+
var tmp0_let = currentGoal.iw();
|
|
1952
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1953
|
+
var tmp$ret$2;
|
|
1954
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.fsm.impl.Companion.retrieveRulesMatching.<anonymous>' call
|
|
1955
|
+
var tmp$ret$1;
|
|
1956
|
+
// Inline function 'kotlin.takeIf' call
|
|
1957
|
+
var tmp0_takeIf = _this__u8e3s4.w1u().asTheory(_this__u8e3s4.k1l()).getByHead(tmp0_let);
|
|
1958
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1959
|
+
var tmp;
|
|
1960
|
+
var tmp$ret$0;
|
|
1961
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.fsm.impl.Companion.retrieveRulesMatching.<anonymous>.<anonymous>' call
|
|
1962
|
+
tmp$ret$0 = any(tmp0_takeIf);
|
|
1963
|
+
if (tmp$ret$0) {
|
|
1964
|
+
tmp = tmp0_takeIf;
|
|
1965
|
+
} else {
|
|
1966
|
+
tmp = null;
|
|
1967
|
+
}
|
|
1968
|
+
tmp$ret$1 = tmp;
|
|
1969
|
+
var tmp0_elvis_lhs = tmp$ret$1;
|
|
1970
|
+
var tmp_0;
|
|
1971
|
+
if (tmp0_elvis_lhs == null) {
|
|
1972
|
+
var tmp_1 = sequenceOf([_this__u8e3s4.y1u(), _this__u8e3s4.z1u()]);
|
|
1973
|
+
tmp_0 = flatMap(tmp_1, StateRuleSelection$Companion$retrieveRulesMatching$lambda(tmp0_let));
|
|
1974
|
+
} else {
|
|
1975
|
+
tmp_0 = tmp0_elvis_lhs;
|
|
1976
|
+
}
|
|
1977
|
+
tmp$ret$2 = tmp_0;
|
|
1978
|
+
tmp$ret$3 = tmp$ret$2;
|
|
1979
|
+
return tmp$ret$3;
|
|
1980
|
+
}
|
|
1981
|
+
function initializeForSubRuleScope(_this__u8e3s4, $this) {
|
|
1982
|
+
var tmp$ret$1;
|
|
1983
|
+
// Inline function 'kotlin.with' call
|
|
1984
|
+
var tmp0_with = _this__u8e3s4.context;
|
|
1985
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
1986
|
+
var tmp$ret$0;
|
|
1987
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.solver.fsm.impl.Companion.initializeForSubRuleScope.<anonymous>' call
|
|
1988
|
+
var tmp = new Long(0, 0);
|
|
1989
|
+
var tmp_0 = new Long(0, 0);
|
|
1990
|
+
tmp$ret$0 = tmp0_with.v4d(null, null, null, null, null, null, null, null, null, null, tmp, tmp_0, null, tmp0_with.z4c_1.l4d(), 8191, null);
|
|
1991
|
+
tmp$ret$1 = tmp$ret$0;
|
|
1992
|
+
var tmp_1 = tmp$ret$1;
|
|
1993
|
+
var tmp_2 = new Long(0, 0);
|
|
1994
|
+
return _this__u8e3s4.g2j(null, null, tmp_1, tmp_2, new Long(0, 0), 27, null);
|
|
1995
|
+
}
|
|
1996
|
+
function removeSubstitutionFor(_this__u8e3s4, $this, unusedVariables) {
|
|
1997
|
+
var tmp0_subject = _this__u8e3s4;
|
|
1998
|
+
var tmp;
|
|
1999
|
+
if (isInterface(tmp0_subject, Yes)) {
|
|
2000
|
+
tmp = _this__u8e3s4.z1v(null, _this__u8e3s4.r1u().i12(asIterable(unusedVariables)), 1, null);
|
|
2001
|
+
} else {
|
|
2002
|
+
tmp = _this__u8e3s4;
|
|
2003
|
+
}
|
|
2004
|
+
return tmp;
|
|
2005
|
+
}
|
|
2006
|
+
function StateRuleSelection$Companion$retrieveRulesMatching$lambda($tmp0_let) {
|
|
2007
|
+
return function (it) {
|
|
2008
|
+
return it.getByHead($tmp0_let);
|
|
2009
|
+
};
|
|
2010
|
+
}
|
|
2011
|
+
function SolverStrategies$clauseChoiceStrategy$ref($boundThis) {
|
|
2012
|
+
var l = function (p0, p1) {
|
|
2013
|
+
return $boundThis.e4c(p0, p1);
|
|
2014
|
+
};
|
|
2015
|
+
l.callableName = 'clauseChoiceStrategy';
|
|
2016
|
+
return l;
|
|
2017
|
+
}
|
|
2018
|
+
function StateRuleSelection$behaveTimed$slambda$lambda(it) {
|
|
2019
|
+
var tmp = prepareForExecution(it).iw();
|
|
2020
|
+
return isInterface(tmp, Rule) ? tmp : THROW_CCE();
|
|
2021
|
+
}
|
|
2022
|
+
function Companion_3() {
|
|
2023
|
+
Companion_instance_3 = this;
|
|
2024
|
+
}
|
|
2025
|
+
var Companion_instance_3;
|
|
2026
|
+
function Companion_getInstance_19() {
|
|
2027
|
+
if (Companion_instance_3 == null)
|
|
2028
|
+
new Companion_3();
|
|
2029
|
+
return Companion_instance_3;
|
|
2030
|
+
}
|
|
2031
|
+
function StateMachineExecutor$executeWrapping$ref($boundThis) {
|
|
2032
|
+
var l = function (p0) {
|
|
2033
|
+
return $boundThis.i4f(p0);
|
|
2034
|
+
};
|
|
2035
|
+
l.callableName = 'executeWrapping';
|
|
2036
|
+
return l;
|
|
2037
|
+
}
|
|
2038
|
+
function StateRuleSelection$behaveTimed$slambda(this$0, resultContinuation) {
|
|
2039
|
+
this.s4i_1 = this$0;
|
|
2040
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
2041
|
+
}
|
|
2042
|
+
StateRuleSelection$behaveTimed$slambda.prototype.g4f = function ($this$sequence, $cont) {
|
|
2043
|
+
var tmp = this.h4f($this$sequence, $cont);
|
|
2044
|
+
tmp.ei_1 = Unit_getInstance();
|
|
2045
|
+
tmp.fi_1 = null;
|
|
2046
|
+
return tmp.ki();
|
|
2047
|
+
};
|
|
2048
|
+
StateRuleSelection$behaveTimed$slambda.prototype.wi = function (p1, $cont) {
|
|
2049
|
+
return this.g4f(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $cont);
|
|
2050
|
+
};
|
|
2051
|
+
StateRuleSelection$behaveTimed$slambda.prototype.ki = function () {
|
|
2052
|
+
var suspendResult = this.ei_1;
|
|
2053
|
+
$sm: do
|
|
2054
|
+
try {
|
|
2055
|
+
var tmp = this.ci_1;
|
|
2056
|
+
switch (tmp) {
|
|
2057
|
+
case 0:
|
|
2058
|
+
this.di_1 = 12;
|
|
2059
|
+
this.u4i_1 = this.s4i_1.q4j_1.x1v();
|
|
2060
|
+
this.v4i_1 = retrieveRulesMatching(this.s4i_1.q4j_1.context, Companion_getInstance_19(), this.u4i_1);
|
|
2061
|
+
this.w4i_1 = moreThanOne(this.v4i_1);
|
|
2062
|
+
if (none(this.v4i_1)) {
|
|
2063
|
+
this.ci_1 = 10;
|
|
2064
|
+
suspendResult = this.t4i_1.z4(stateEndFalse$default(this.s4i_1, null, [], 3, null), this);
|
|
2065
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2066
|
+
return suspendResult;
|
|
2067
|
+
}
|
|
2068
|
+
continue $sm;
|
|
2069
|
+
} else {
|
|
2070
|
+
var tmp_0 = this;
|
|
2071
|
+
var tmp0_with = this.s4i_1.q4j_1.context;
|
|
2072
|
+
var tmp_1 = orderWithStrategy(this.v4i_1, tmp0_with, SolverStrategies$clauseChoiceStrategy$ref(tmp0_with.y4c_1));
|
|
2073
|
+
tmp_0.x4i_1 = map(tmp_1, StateRuleSelection$behaveTimed$slambda$lambda);
|
|
2074
|
+
var tmp_2 = this;
|
|
2075
|
+
tmp_2.y4i_1 = this.x4i_1.j();
|
|
2076
|
+
this.ci_1 = 1;
|
|
2077
|
+
continue $sm;
|
|
2078
|
+
}
|
|
2079
|
+
|
|
2080
|
+
break;
|
|
2081
|
+
case 1:
|
|
2082
|
+
if (!this.y4i_1.m()) {
|
|
2083
|
+
this.ci_1 = 9;
|
|
2084
|
+
continue $sm;
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
var tmp_3 = this;
|
|
2088
|
+
tmp_3.z4i_1 = this.y4i_1.p();
|
|
2089
|
+
var tmp_4 = this;
|
|
2090
|
+
tmp_4.a4j_1 = this.y4i_1.m();
|
|
2091
|
+
this.b4j_1 = this.s4i_1.j5().m4c_1.mgu(this.u4i_1, this.z4i_1.ly());
|
|
2092
|
+
var tmp_5 = this;
|
|
2093
|
+
var tmp_6 = this.z4i_1.my().applySubstitution(this.b4j_1);
|
|
2094
|
+
tmp_5.c4j_1 = isInterface(tmp_6, Struct) ? tmp_6 : THROW_CCE();
|
|
2095
|
+
var tmp_7 = this;
|
|
2096
|
+
var tmp0_$receiver = this.s4i_1.q4j_1;
|
|
2097
|
+
var tmp1_requestIssuingInstant = currentTimeInstant();
|
|
2098
|
+
tmp_7.d4j_1 = newSolveRequest$default(tmp0_$receiver, this.c4j_1, this.b4j_1, null, null, tmp1_requestIssuingInstant, this.w4i_1, 12, null);
|
|
2099
|
+
var tmp_8 = this;
|
|
2100
|
+
tmp_8.e4j_1 = new StateInit(initializeForSubRuleScope(this.d4j_1, Companion_getInstance_19()));
|
|
2101
|
+
this.ci_1 = 2;
|
|
2102
|
+
suspendResult = this.t4i_1.z4(asAlreadyExecuted(this.e4j_1), this);
|
|
2103
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2104
|
+
return suspendResult;
|
|
2105
|
+
}
|
|
2106
|
+
|
|
2107
|
+
continue $sm;
|
|
2108
|
+
case 2:
|
|
2109
|
+
this.f4j_1 = this.e4j_1;
|
|
2110
|
+
this.g4j_1 = false;
|
|
2111
|
+
var tmp_9 = this;
|
|
2112
|
+
tmp_9.h4j_1 = this.s4i_1.r4j_1(this.f4j_1);
|
|
2113
|
+
this.i4j_1 = this.h4j_1.j();
|
|
2114
|
+
this.ci_1 = 3;
|
|
2115
|
+
continue $sm;
|
|
2116
|
+
case 3:
|
|
2117
|
+
if (!this.i4j_1.m()) {
|
|
2118
|
+
this.ci_1 = 8;
|
|
2119
|
+
continue $sm;
|
|
2120
|
+
}
|
|
2121
|
+
|
|
2122
|
+
this.j4j_1 = this.i4j_1.p();
|
|
2123
|
+
this.k4j_1 = this.j4j_1.q4e_1;
|
|
2124
|
+
var tmp_10;
|
|
2125
|
+
var tmp_11 = this.k4j_1;
|
|
2126
|
+
if (isInterface(tmp_11, FinalState)) {
|
|
2127
|
+
tmp_10 = this.k4j_1.h4c().solution.x1v().equals(this.d4j_1.x1v());
|
|
2128
|
+
} else {
|
|
2129
|
+
tmp_10 = false;
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
if (tmp_10) {
|
|
2133
|
+
if (shouldCutExecuteInRuleSelection(this.k4j_1.h4c().sideEffectManager)) {
|
|
2134
|
+
this.g4j_1 = true;
|
|
2135
|
+
}
|
|
2136
|
+
var tmp_12;
|
|
2137
|
+
var tmp_13;
|
|
2138
|
+
var tmp_14 = this.k4j_1;
|
|
2139
|
+
if (!(tmp_14 instanceof False)) {
|
|
2140
|
+
tmp_13 = true;
|
|
2141
|
+
} else {
|
|
2142
|
+
tmp_13 = !this.a4j_1;
|
|
2143
|
+
}
|
|
2144
|
+
if (tmp_13) {
|
|
2145
|
+
tmp_12 = true;
|
|
2146
|
+
} else {
|
|
2147
|
+
tmp_12 = this.g4j_1;
|
|
2148
|
+
}
|
|
2149
|
+
if (tmp_12) {
|
|
2150
|
+
this.l4j_1 = extendParentScopeWith(this.k4j_1.h4c().sideEffectManager, this.s4i_1.q4j_1.context.z4c_1);
|
|
2151
|
+
this.ci_1 = 5;
|
|
2152
|
+
var tmp_15 = this.k4j_1.h4c();
|
|
2153
|
+
var tmp_16 = removeSubstitutionFor(this.k4j_1.h4c().solution, Companion_getInstance_19(), this.z4i_1.hw());
|
|
2154
|
+
suspendResult = this.t4i_1.z4(stateEnd(this.s4i_1, tmp_15.l2j(tmp_16, this.l4j_1, null, 4, null)), this);
|
|
2155
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2156
|
+
return suspendResult;
|
|
2157
|
+
}
|
|
2158
|
+
continue $sm;
|
|
2159
|
+
} else {
|
|
2160
|
+
this.ci_1 = 6;
|
|
2161
|
+
continue $sm;
|
|
2162
|
+
}
|
|
2163
|
+
} else {
|
|
2164
|
+
this.ci_1 = 4;
|
|
2165
|
+
suspendResult = this.t4i_1.z4(this.j4j_1, this);
|
|
2166
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2167
|
+
return suspendResult;
|
|
2168
|
+
}
|
|
2169
|
+
continue $sm;
|
|
2170
|
+
}
|
|
2171
|
+
|
|
2172
|
+
break;
|
|
2173
|
+
case 4:
|
|
2174
|
+
this.ci_1 = 7;
|
|
2175
|
+
continue $sm;
|
|
2176
|
+
case 5:
|
|
2177
|
+
this.ci_1 = 6;
|
|
2178
|
+
continue $sm;
|
|
2179
|
+
case 6:
|
|
2180
|
+
var tmp_17 = this.k4j_1;
|
|
2181
|
+
if (tmp_17 instanceof Halt_0)
|
|
2182
|
+
return Unit_getInstance();
|
|
2183
|
+
this.ci_1 = 7;
|
|
2184
|
+
continue $sm;
|
|
2185
|
+
case 7:
|
|
2186
|
+
this.ci_1 = 3;
|
|
2187
|
+
continue $sm;
|
|
2188
|
+
case 8:
|
|
2189
|
+
if (this.g4j_1)
|
|
2190
|
+
return Unit_getInstance();
|
|
2191
|
+
this.ci_1 = 1;
|
|
2192
|
+
continue $sm;
|
|
2193
|
+
case 9:
|
|
2194
|
+
this.ci_1 = 11;
|
|
2195
|
+
continue $sm;
|
|
2196
|
+
case 10:
|
|
2197
|
+
this.ci_1 = 11;
|
|
2198
|
+
continue $sm;
|
|
2199
|
+
case 11:
|
|
2200
|
+
return Unit_getInstance();
|
|
2201
|
+
case 12:
|
|
2202
|
+
throw this.fi_1;
|
|
2203
|
+
}
|
|
2204
|
+
} catch ($p) {
|
|
2205
|
+
if (this.di_1 === 12) {
|
|
2206
|
+
throw $p;
|
|
2207
|
+
} else {
|
|
2208
|
+
this.ci_1 = this.di_1;
|
|
2209
|
+
this.fi_1 = $p;
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2212
|
+
while (true);
|
|
2213
|
+
};
|
|
2214
|
+
StateRuleSelection$behaveTimed$slambda.prototype.h4f = function ($this$sequence, completion) {
|
|
2215
|
+
var i = new StateRuleSelection$behaveTimed$slambda(this.s4i_1, completion);
|
|
2216
|
+
i.t4i_1 = $this$sequence;
|
|
2217
|
+
return i;
|
|
2218
|
+
};
|
|
2219
|
+
function StateRuleSelection$behaveTimed$slambda_0(this$0, resultContinuation) {
|
|
2220
|
+
var i = new StateRuleSelection$behaveTimed$slambda(this$0, resultContinuation);
|
|
2221
|
+
var l = function ($this$sequence, $cont) {
|
|
2222
|
+
return i.g4f($this$sequence, $cont);
|
|
2223
|
+
};
|
|
2224
|
+
l.$arity = 1;
|
|
2225
|
+
return l;
|
|
2226
|
+
}
|
|
2227
|
+
function StateRuleSelection(solve) {
|
|
2228
|
+
Companion_getInstance_19();
|
|
2229
|
+
AbstractTimedState.call(this, solve);
|
|
2230
|
+
this.q4j_1 = solve;
|
|
2231
|
+
var tmp = this;
|
|
2232
|
+
tmp.r4j_1 = StateMachineExecutor$executeWrapping$ref(StateMachineExecutor_getInstance());
|
|
2233
|
+
}
|
|
2234
|
+
StateRuleSelection.prototype.h4c = function () {
|
|
2235
|
+
return this.q4j_1;
|
|
2236
|
+
};
|
|
2237
|
+
StateRuleSelection.prototype.n4f = function () {
|
|
2238
|
+
return sequence(StateRuleSelection$behaveTimed$slambda_0(this, null));
|
|
2239
|
+
};
|
|
2240
|
+
function DefaultBuiltins() {
|
|
2241
|
+
DefaultBuiltins_instance = this;
|
|
2242
|
+
ExtensionLibrary.call(this, CommonBuiltins_getInstance());
|
|
2243
|
+
}
|
|
2244
|
+
DefaultBuiltins.prototype.y2e = function () {
|
|
2245
|
+
return listOf_0([Call_getInstance(), Catch_getInstance(), Conjunction_getInstance(), Cut_getInstance(), Throw_getInstance(), Not_getInstance()]);
|
|
2246
|
+
};
|
|
2247
|
+
var DefaultBuiltins_instance;
|
|
2248
|
+
function DefaultBuiltins_getInstance() {
|
|
2249
|
+
if (DefaultBuiltins_instance == null)
|
|
2250
|
+
new DefaultBuiltins();
|
|
2251
|
+
return DefaultBuiltins_instance;
|
|
2252
|
+
}
|
|
2253
|
+
function Call$uncheckedImplementation$lambda($request) {
|
|
2254
|
+
return function (it) {
|
|
2255
|
+
var tmp = resetCutWorkChanges(it.sideEffectManager, $request.context.z4c_1);
|
|
2256
|
+
return replyWith($request, it.l2j(null, tmp, null, 5, null));
|
|
2257
|
+
};
|
|
2258
|
+
}
|
|
2259
|
+
function Call() {
|
|
2260
|
+
Call_instance = this;
|
|
2261
|
+
PrimitiveWrapper_init_$Init$('call', 1, false, 4, null, this);
|
|
2262
|
+
}
|
|
2263
|
+
Call.prototype.z4j = function (request) {
|
|
2264
|
+
var tmp$ret$1;
|
|
2265
|
+
// Inline function 'kotlin.let' call
|
|
2266
|
+
var tmp0_let = single(Companion_getInstance_11().y2f(request).arguments);
|
|
2267
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
2268
|
+
var tmp$ret$0;
|
|
2269
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.stdlib.primitive.Call.uncheckedImplementation.<anonymous>' call
|
|
2270
|
+
var tmp;
|
|
2271
|
+
if (isWellFormed(tmp0_let)) {
|
|
2272
|
+
var tmp_0 = Companion_getInstance_16();
|
|
2273
|
+
var tmp_1 = prepareForExecutionAsGoal(tmp0_let);
|
|
2274
|
+
var tmp_2 = new Long(0, 0);
|
|
2275
|
+
var tmp_3 = tmp_0.k4c(newSolveRequest$default(request, tmp_1, null, null, null, tmp_2, false, 62, null));
|
|
2276
|
+
tmp = map(tmp_3, Call$uncheckedImplementation$lambda(request));
|
|
2277
|
+
} else {
|
|
2278
|
+
var tmp_4 = Expected_CALLABLE_getInstance();
|
|
2279
|
+
throw TypeError_init_$Create$('call/1 argument is neither a Variable nor a well-formed goal', null, request.context, tmp_4, tmp0_let, null, 34, null);
|
|
2280
|
+
}
|
|
2281
|
+
tmp$ret$0 = tmp;
|
|
2282
|
+
tmp$ret$1 = tmp$ret$0;
|
|
2283
|
+
return tmp$ret$1;
|
|
2284
|
+
};
|
|
2285
|
+
Call.prototype.n2g = function (request) {
|
|
2286
|
+
return this.z4j(request);
|
|
2287
|
+
};
|
|
2288
|
+
var Call_instance;
|
|
2289
|
+
function Call_getInstance() {
|
|
2290
|
+
if (Call_instance == null)
|
|
2291
|
+
new Call();
|
|
2292
|
+
return Call_instance;
|
|
2293
|
+
}
|
|
2294
|
+
function Catch$uncheckedImplementation$slambda$lambda($request) {
|
|
2295
|
+
return function (it) {
|
|
2296
|
+
return replyWith($request, it);
|
|
2297
|
+
};
|
|
2298
|
+
}
|
|
2299
|
+
function call($this, goal) {
|
|
2300
|
+
var tmp = Companion_getInstance_10();
|
|
2301
|
+
var tmp$ret$0;
|
|
2302
|
+
// Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.functor' call
|
|
2303
|
+
var tmp0__get_functor__thl4dk = Call_getInstance();
|
|
2304
|
+
tmp$ret$0 = tmp0__get_functor__thl4dk.signature.name;
|
|
2305
|
+
return tmp.of(tmp$ret$0, [goal]);
|
|
2306
|
+
}
|
|
2307
|
+
function ensureNoMoreSelectableCatch(_this__u8e3s4, $this, notSelectableContext) {
|
|
2308
|
+
var tmp = new Long(0, 0);
|
|
2309
|
+
var tmp_0 = new Long(0, 0);
|
|
2310
|
+
var tmp_1 = _this__u8e3s4.context.v4d(null, null, null, null, null, null, null, null, null, null, tmp, tmp_0, null, _this__u8e3s4.context.z4c_1.s4d(notSelectableContext), 8191, null);
|
|
2311
|
+
var tmp_2 = new Long(0, 0);
|
|
2312
|
+
return _this__u8e3s4.g2j(null, null, tmp_1, tmp_2, new Long(0, 0), 27, null);
|
|
2313
|
+
}
|
|
2314
|
+
function Catch$uncheckedImplementation$slambda($request, resultContinuation) {
|
|
2315
|
+
this.i4k_1 = $request;
|
|
2316
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
2317
|
+
}
|
|
2318
|
+
Catch$uncheckedImplementation$slambda.prototype.b2t = function ($this$sequence, $cont) {
|
|
2319
|
+
var tmp = this.c2t($this$sequence, $cont);
|
|
2320
|
+
tmp.ei_1 = Unit_getInstance();
|
|
2321
|
+
tmp.fi_1 = null;
|
|
2322
|
+
return tmp.ki();
|
|
2323
|
+
};
|
|
2324
|
+
Catch$uncheckedImplementation$slambda.prototype.wi = function (p1, $cont) {
|
|
2325
|
+
return this.b2t(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $cont);
|
|
2326
|
+
};
|
|
2327
|
+
Catch$uncheckedImplementation$slambda.prototype.ki = function () {
|
|
2328
|
+
var suspendResult = this.ei_1;
|
|
2329
|
+
$sm: do
|
|
2330
|
+
try {
|
|
2331
|
+
var tmp = this.ci_1;
|
|
2332
|
+
switch (tmp) {
|
|
2333
|
+
case 0:
|
|
2334
|
+
this.di_1 = 6;
|
|
2335
|
+
this.k4k_1 = first_0(this.i4k_1.arguments);
|
|
2336
|
+
var tmp_0 = this;
|
|
2337
|
+
var tmp_1 = Companion_getInstance_16();
|
|
2338
|
+
var tmp_2 = call(Catch_getInstance(), this.k4k_1);
|
|
2339
|
+
var tmp_3 = new Long(0, 0);
|
|
2340
|
+
tmp_0.l4k_1 = tmp_1.k4c(newSolveRequest$default(this.i4k_1, tmp_2, null, null, null, tmp_3, false, 62, null));
|
|
2341
|
+
this.m4k_1 = this.l4k_1.j();
|
|
2342
|
+
this.ci_1 = 1;
|
|
2343
|
+
continue $sm;
|
|
2344
|
+
case 1:
|
|
2345
|
+
if (!this.m4k_1.m()) {
|
|
2346
|
+
this.ci_1 = 5;
|
|
2347
|
+
continue $sm;
|
|
2348
|
+
}
|
|
2349
|
+
|
|
2350
|
+
this.n4k_1 = this.m4k_1.p();
|
|
2351
|
+
if (isSelectedThrowCatch(this.n4k_1.sideEffectManager, this.i4k_1.context)) {
|
|
2352
|
+
this.o4k_1 = last(this.i4k_1.arguments).applySubstitution(this.n4k_1.solution.r1u());
|
|
2353
|
+
var tmp_4 = this;
|
|
2354
|
+
var tmp_5 = call(Catch_getInstance(), this.o4k_1);
|
|
2355
|
+
var tmp_6 = this.n4k_1.solution.r1u().minus(this.i4k_1.context.v4c_1);
|
|
2356
|
+
var tmp_7 = currentTimeInstant();
|
|
2357
|
+
tmp_4.p4k_1 = ensureNoMoreSelectableCatch(newSolveRequest$default(this.i4k_1, tmp_5, tmp_6, null, null, tmp_7, false, 44, null), Catch_getInstance(), this.i4k_1.context);
|
|
2358
|
+
this.ci_1 = 3;
|
|
2359
|
+
var tmp_8 = Companion_getInstance_16().k4c(this.p4k_1);
|
|
2360
|
+
suspendResult = this.j4k_1.c5(map(tmp_8, Catch$uncheckedImplementation$slambda$lambda(this.i4k_1)), this);
|
|
2361
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2362
|
+
return suspendResult;
|
|
2363
|
+
}
|
|
2364
|
+
continue $sm;
|
|
2365
|
+
} else {
|
|
2366
|
+
this.ci_1 = 2;
|
|
2367
|
+
suspendResult = this.j4k_1.z4(replyWith(this.i4k_1, this.n4k_1), this);
|
|
2368
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2369
|
+
return suspendResult;
|
|
2370
|
+
}
|
|
2371
|
+
continue $sm;
|
|
2372
|
+
}
|
|
2373
|
+
|
|
2374
|
+
break;
|
|
2375
|
+
case 2:
|
|
2376
|
+
this.ci_1 = 4;
|
|
2377
|
+
continue $sm;
|
|
2378
|
+
case 3:
|
|
2379
|
+
this.ci_1 = 4;
|
|
2380
|
+
continue $sm;
|
|
2381
|
+
case 4:
|
|
2382
|
+
this.ci_1 = 1;
|
|
2383
|
+
continue $sm;
|
|
2384
|
+
case 5:
|
|
2385
|
+
return Unit_getInstance();
|
|
2386
|
+
case 6:
|
|
2387
|
+
throw this.fi_1;
|
|
2388
|
+
}
|
|
2389
|
+
} catch ($p) {
|
|
2390
|
+
if (this.di_1 === 6) {
|
|
2391
|
+
throw $p;
|
|
2392
|
+
} else {
|
|
2393
|
+
this.ci_1 = this.di_1;
|
|
2394
|
+
this.fi_1 = $p;
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2397
|
+
while (true);
|
|
2398
|
+
};
|
|
2399
|
+
Catch$uncheckedImplementation$slambda.prototype.c2t = function ($this$sequence, completion) {
|
|
2400
|
+
var i = new Catch$uncheckedImplementation$slambda(this.i4k_1, completion);
|
|
2401
|
+
i.j4k_1 = $this$sequence;
|
|
2402
|
+
return i;
|
|
2403
|
+
};
|
|
2404
|
+
function Catch$uncheckedImplementation$slambda_0($request, resultContinuation) {
|
|
2405
|
+
var i = new Catch$uncheckedImplementation$slambda($request, resultContinuation);
|
|
2406
|
+
var l = function ($this$sequence, $cont) {
|
|
2407
|
+
return i.b2t($this$sequence, $cont);
|
|
2408
|
+
};
|
|
2409
|
+
l.$arity = 1;
|
|
2410
|
+
return l;
|
|
2411
|
+
}
|
|
2412
|
+
function Catch() {
|
|
2413
|
+
Catch_instance = this;
|
|
2414
|
+
PrimitiveWrapper_init_$Init$('catch', 3, false, 4, null, this);
|
|
2415
|
+
}
|
|
2416
|
+
Catch.prototype.z4j = function (request) {
|
|
2417
|
+
return sequence(Catch$uncheckedImplementation$slambda_0(request, null));
|
|
2418
|
+
};
|
|
2419
|
+
Catch.prototype.n2g = function (request) {
|
|
2420
|
+
return this.z4j(request);
|
|
2421
|
+
};
|
|
2422
|
+
var Catch_instance;
|
|
2423
|
+
function Catch_getInstance() {
|
|
2424
|
+
if (Catch_instance == null)
|
|
2425
|
+
new Catch();
|
|
2426
|
+
return Catch_instance;
|
|
2427
|
+
}
|
|
2428
|
+
function SolverStrategies$predicationChoiceStrategy$ref($boundThis) {
|
|
2429
|
+
var l = function (p0, p1) {
|
|
2430
|
+
return $boundThis.d4c(p0, p1);
|
|
2431
|
+
};
|
|
2432
|
+
l.callableName = 'predicationChoiceStrategy';
|
|
2433
|
+
return l;
|
|
2434
|
+
}
|
|
2435
|
+
function solveConjunctionGoals(_this__u8e3s4, $this, mainRequest, goals, toPropagateContext, accumulatedSubstitutions, accumulatedSideEffects, previousResponseSideEffectManager, previousGoalsHadAlternatives, $cont) {
|
|
2436
|
+
var tmp = new $solveConjunctionGoalsCOROUTINE$0($this, _this__u8e3s4, mainRequest, goals, toPropagateContext, accumulatedSubstitutions, accumulatedSideEffects, previousResponseSideEffectManager, previousGoalsHadAlternatives, $cont);
|
|
2437
|
+
tmp.ei_1 = Unit_getInstance();
|
|
2438
|
+
tmp.fi_1 = null;
|
|
2439
|
+
return tmp.ki();
|
|
2440
|
+
}
|
|
2441
|
+
function Conjunction$uncheckedImplementation$slambda($request, resultContinuation) {
|
|
2442
|
+
this.z4l_1 = $request;
|
|
2443
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
2444
|
+
}
|
|
2445
|
+
Conjunction$uncheckedImplementation$slambda.prototype.b2t = function ($this$sequence, $cont) {
|
|
2446
|
+
var tmp = this.c2t($this$sequence, $cont);
|
|
2447
|
+
tmp.ei_1 = Unit_getInstance();
|
|
2448
|
+
tmp.fi_1 = null;
|
|
2449
|
+
return tmp.ki();
|
|
2450
|
+
};
|
|
2451
|
+
Conjunction$uncheckedImplementation$slambda.prototype.wi = function (p1, $cont) {
|
|
2452
|
+
return this.b2t(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $cont);
|
|
2453
|
+
};
|
|
2454
|
+
Conjunction$uncheckedImplementation$slambda.prototype.ki = function () {
|
|
2455
|
+
var suspendResult = this.ei_1;
|
|
2456
|
+
$sm: do
|
|
2457
|
+
try {
|
|
2458
|
+
var tmp = this.ci_1;
|
|
2459
|
+
switch (tmp) {
|
|
2460
|
+
case 0:
|
|
2461
|
+
this.di_1 = 2;
|
|
2462
|
+
var tmp_0 = this;
|
|
2463
|
+
var tmp_1 = this.z4l_1.x1v().castToTuple().ju();
|
|
2464
|
+
tmp_0.b4m_1 = toList(orderWithStrategy(tmp_1, this.z4l_1.context, SolverStrategies$predicationChoiceStrategy$ref(this.z4l_1.context.y4c_1)));
|
|
2465
|
+
this.ci_1 = 1;
|
|
2466
|
+
suspendResult = solveConjunctionGoals(this.a4m_1, Conjunction_getInstance(), this.z4l_1, this.b4m_1, this.z4l_1.context, Companion_getInstance_3().empty(), emptyList(), this.z4l_1.context.z4c_1, false, this);
|
|
2467
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2468
|
+
return suspendResult;
|
|
2469
|
+
}
|
|
2470
|
+
|
|
2471
|
+
continue $sm;
|
|
2472
|
+
case 1:
|
|
2473
|
+
;
|
|
2474
|
+
return Unit_getInstance();
|
|
2475
|
+
case 2:
|
|
2476
|
+
throw this.fi_1;
|
|
2477
|
+
}
|
|
2478
|
+
} catch ($p) {
|
|
2479
|
+
if (this.di_1 === 2) {
|
|
2480
|
+
throw $p;
|
|
2481
|
+
} else {
|
|
2482
|
+
this.ci_1 = this.di_1;
|
|
2483
|
+
this.fi_1 = $p;
|
|
2484
|
+
}
|
|
2485
|
+
}
|
|
2486
|
+
while (true);
|
|
2487
|
+
};
|
|
2488
|
+
Conjunction$uncheckedImplementation$slambda.prototype.c2t = function ($this$sequence, completion) {
|
|
2489
|
+
var i = new Conjunction$uncheckedImplementation$slambda(this.z4l_1, completion);
|
|
2490
|
+
i.a4m_1 = $this$sequence;
|
|
2491
|
+
return i;
|
|
2492
|
+
};
|
|
2493
|
+
function Conjunction$uncheckedImplementation$slambda_0($request, resultContinuation) {
|
|
2494
|
+
var i = new Conjunction$uncheckedImplementation$slambda($request, resultContinuation);
|
|
2495
|
+
var l = function ($this$sequence, $cont) {
|
|
2496
|
+
return i.b2t($this$sequence, $cont);
|
|
2497
|
+
};
|
|
2498
|
+
l.$arity = 1;
|
|
2499
|
+
return l;
|
|
2500
|
+
}
|
|
2501
|
+
function $solveConjunctionGoalsCOROUTINE$0(_this__u8e3s4, _this__u8e3s4_0, mainRequest, goals, toPropagateContext, accumulatedSubstitutions, accumulatedSideEffects, previousResponseSideEffectManager, previousGoalsHadAlternatives, resultContinuation) {
|
|
2502
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
2503
|
+
this.z4k_1 = _this__u8e3s4;
|
|
2504
|
+
this.a4l_1 = _this__u8e3s4_0;
|
|
2505
|
+
this.b4l_1 = mainRequest;
|
|
2506
|
+
this.c4l_1 = goals;
|
|
2507
|
+
this.d4l_1 = toPropagateContext;
|
|
2508
|
+
this.e4l_1 = accumulatedSubstitutions;
|
|
2509
|
+
this.f4l_1 = accumulatedSideEffects;
|
|
2510
|
+
this.g4l_1 = previousResponseSideEffectManager;
|
|
2511
|
+
this.h4l_1 = previousGoalsHadAlternatives;
|
|
2512
|
+
}
|
|
2513
|
+
$solveConjunctionGoalsCOROUTINE$0.prototype.ki = function () {
|
|
2514
|
+
var suspendResult = this.ei_1;
|
|
2515
|
+
$sm: do
|
|
2516
|
+
try {
|
|
2517
|
+
var tmp = this.ci_1;
|
|
2518
|
+
switch (tmp) {
|
|
2519
|
+
case 0:
|
|
2520
|
+
this.di_1 = 7;
|
|
2521
|
+
this.i4l_1 = prepareForExecutionAsGoal(first_1(this.c4l_1).applySubstitution(this.e4l_1));
|
|
2522
|
+
var tmp_0 = this;
|
|
2523
|
+
var tmp0_elvis_lhs = this.g4l_1;
|
|
2524
|
+
var tmp_1 = tmp0_elvis_lhs == null ? this.b4l_1.context.z4c_1 : tmp0_elvis_lhs;
|
|
2525
|
+
var tmp_2 = new Long(0, 0);
|
|
2526
|
+
tmp_0.j4l_1 = newSolveRequest$default(this.b4l_1, this.i4l_1, this.e4l_1, this.d4l_1, tmp_1, tmp_2, false, 48, null);
|
|
2527
|
+
this.k4l_1 = false;
|
|
2528
|
+
this.l4l_1 = emptyList();
|
|
2529
|
+
var tmp_3 = this;
|
|
2530
|
+
tmp_3.m4l_1 = Companion_getInstance_16().i4c(this.j4l_1);
|
|
2531
|
+
var tmp_4 = this;
|
|
2532
|
+
tmp_4.n4l_1 = this.m4l_1.j();
|
|
2533
|
+
this.ci_1 = 1;
|
|
2534
|
+
continue $sm;
|
|
2535
|
+
case 1:
|
|
2536
|
+
if (!this.n4l_1.m()) {
|
|
2537
|
+
this.ci_1 = 6;
|
|
2538
|
+
continue $sm;
|
|
2539
|
+
}
|
|
2540
|
+
|
|
2541
|
+
var tmp_5 = this;
|
|
2542
|
+
tmp_5.o4l_1 = this.n4l_1.p();
|
|
2543
|
+
var tmp_6 = this;
|
|
2544
|
+
tmp_6.p4l_1 = this.n4l_1.m();
|
|
2545
|
+
this.q4l_1 = this.o4l_1.h4c();
|
|
2546
|
+
var tmp_7;
|
|
2547
|
+
var tmp0__get_functor__thl4dk = Cut_getInstance();
|
|
2548
|
+
if (tmp0__get_functor__thl4dk.signature.name === this.i4l_1.fw()) {
|
|
2549
|
+
tmp_7 = true;
|
|
2550
|
+
} else {
|
|
2551
|
+
var tmp0_safe_receiver = this.q4l_1.sideEffectManager;
|
|
2552
|
+
tmp_7 = (tmp0_safe_receiver == null ? null : shouldExecuteThrowCut(tmp0_safe_receiver)) === true;
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
if (tmp_7) {
|
|
2556
|
+
this.k4l_1 = true;
|
|
2557
|
+
}
|
|
2558
|
+
|
|
2559
|
+
this.l4l_1 = addWithNoDuplicates(this.l4l_1, this.q4l_1.sideEffects);
|
|
2560
|
+
var tmp_8;
|
|
2561
|
+
var tmp_9;
|
|
2562
|
+
var tmp1_safe_receiver = this.q4l_1.sideEffectManager;
|
|
2563
|
+
if ((tmp1_safe_receiver == null ? null : shouldExecuteThrowCut(tmp1_safe_receiver)) === false) {
|
|
2564
|
+
var tmp_10 = this.q4l_1.solution;
|
|
2565
|
+
tmp_9 = isInterface(tmp_10, Yes);
|
|
2566
|
+
} else {
|
|
2567
|
+
tmp_9 = false;
|
|
2568
|
+
}
|
|
2569
|
+
|
|
2570
|
+
if (tmp_9) {
|
|
2571
|
+
tmp_8 = moreThanOne(asSequence(this.c4l_1));
|
|
2572
|
+
} else {
|
|
2573
|
+
tmp_8 = false;
|
|
2574
|
+
}
|
|
2575
|
+
|
|
2576
|
+
if (tmp_8) {
|
|
2577
|
+
this.ci_1 = 4;
|
|
2578
|
+
var tmp_11 = Conjunction_getInstance();
|
|
2579
|
+
var tmp_12 = drop(this.c4l_1, 1);
|
|
2580
|
+
var tmp_13 = this.o4l_1.j5().z36(this.l4l_1);
|
|
2581
|
+
var tmp_14 = this.q4l_1.solution.r1u().minus(this.b4l_1.context.v4c_1);
|
|
2582
|
+
var tmp_15 = this.l4l_1;
|
|
2583
|
+
var tmp_16 = this.q4l_1.sideEffectManager;
|
|
2584
|
+
suspendResult = solveConjunctionGoals(this.a4l_1, tmp_11, this.b4l_1, tmp_12, tmp_13, tmp_14, tmp_15, tmp_16 instanceof SideEffectManagerImpl ? tmp_16 : null, this.h4l_1 ? true : this.p4l_1, this);
|
|
2585
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2586
|
+
return suspendResult;
|
|
2587
|
+
}
|
|
2588
|
+
continue $sm;
|
|
2589
|
+
} else {
|
|
2590
|
+
var tmp_17;
|
|
2591
|
+
var tmp_18;
|
|
2592
|
+
var tmp_19 = this.q4l_1.solution;
|
|
2593
|
+
if (!isInterface(tmp_19, No)) {
|
|
2594
|
+
tmp_18 = true;
|
|
2595
|
+
} else {
|
|
2596
|
+
tmp_18 = !this.h4l_1 ? !this.p4l_1 : false;
|
|
2597
|
+
}
|
|
2598
|
+
if (tmp_18) {
|
|
2599
|
+
tmp_17 = true;
|
|
2600
|
+
} else {
|
|
2601
|
+
tmp_17 = this.k4l_1;
|
|
2602
|
+
}
|
|
2603
|
+
if (tmp_17) {
|
|
2604
|
+
this.ci_1 = 2;
|
|
2605
|
+
suspendResult = this.a4l_1.z4(replyWith(this.b4l_1, this.q4l_1.l2j(null, null, plus_1(this.f4l_1, this.l4l_1), 3, null)), this);
|
|
2606
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2607
|
+
return suspendResult;
|
|
2608
|
+
}
|
|
2609
|
+
continue $sm;
|
|
2610
|
+
} else {
|
|
2611
|
+
this.ci_1 = 3;
|
|
2612
|
+
continue $sm;
|
|
2613
|
+
}
|
|
2614
|
+
}
|
|
2615
|
+
|
|
2616
|
+
break;
|
|
2617
|
+
case 2:
|
|
2618
|
+
this.ci_1 = 3;
|
|
2619
|
+
continue $sm;
|
|
2620
|
+
case 3:
|
|
2621
|
+
this.ci_1 = 5;
|
|
2622
|
+
continue $sm;
|
|
2623
|
+
case 4:
|
|
2624
|
+
var sideEffectPair = suspendResult;
|
|
2625
|
+
if (sideEffectPair.g4_1) {
|
|
2626
|
+
this.k4l_1 = true;
|
|
2627
|
+
}
|
|
2628
|
+
|
|
2629
|
+
this.l4l_1 = sideEffectPair.h4_1;
|
|
2630
|
+
this.ci_1 = 5;
|
|
2631
|
+
continue $sm;
|
|
2632
|
+
case 5:
|
|
2633
|
+
var tmp_20;
|
|
2634
|
+
if (this.k4l_1) {
|
|
2635
|
+
tmp_20 = true;
|
|
2636
|
+
} else {
|
|
2637
|
+
var tmp_21 = this.q4l_1.solution;
|
|
2638
|
+
tmp_20 = isInterface(tmp_21, Halt);
|
|
2639
|
+
}
|
|
2640
|
+
|
|
2641
|
+
if (tmp_20) {
|
|
2642
|
+
return new Pair(true, plus_1(this.f4l_1, this.l4l_1));
|
|
2643
|
+
}
|
|
2644
|
+
|
|
2645
|
+
this.ci_1 = 1;
|
|
2646
|
+
continue $sm;
|
|
2647
|
+
case 6:
|
|
2648
|
+
return new Pair(this.k4l_1, plus_1(this.f4l_1, this.l4l_1));
|
|
2649
|
+
case 7:
|
|
2650
|
+
throw this.fi_1;
|
|
2651
|
+
}
|
|
2652
|
+
} catch ($p) {
|
|
2653
|
+
if (this.di_1 === 7) {
|
|
2654
|
+
throw $p;
|
|
2655
|
+
} else {
|
|
2656
|
+
this.ci_1 = this.di_1;
|
|
2657
|
+
this.fi_1 = $p;
|
|
2658
|
+
}
|
|
2659
|
+
}
|
|
2660
|
+
while (true);
|
|
2661
|
+
};
|
|
2662
|
+
function Conjunction() {
|
|
2663
|
+
Conjunction_instance = this;
|
|
2664
|
+
Companion_getInstance_12();
|
|
2665
|
+
PrimitiveWrapper_init_$Init$(',', 2, false, 4, null, this);
|
|
2666
|
+
}
|
|
2667
|
+
Conjunction.prototype.z4j = function (request) {
|
|
2668
|
+
return sequence(Conjunction$uncheckedImplementation$slambda_0(request, null));
|
|
2669
|
+
};
|
|
2670
|
+
Conjunction.prototype.n2g = function (request) {
|
|
2671
|
+
return this.z4j(request);
|
|
2672
|
+
};
|
|
2673
|
+
var Conjunction_instance;
|
|
2674
|
+
function Conjunction_getInstance() {
|
|
2675
|
+
if (Conjunction_instance == null)
|
|
2676
|
+
new Conjunction();
|
|
2677
|
+
return Conjunction_instance;
|
|
2678
|
+
}
|
|
2679
|
+
function Cut() {
|
|
2680
|
+
Cut_instance = this;
|
|
2681
|
+
PrimitiveWrapper_init_$Init$('!', 0, false, 4, null, this);
|
|
2682
|
+
}
|
|
2683
|
+
Cut.prototype.z4j = function (request) {
|
|
2684
|
+
var tmp$ret$1;
|
|
2685
|
+
// Inline function 'kotlin.with' call
|
|
2686
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
2687
|
+
var tmp$ret$0;
|
|
2688
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.stdlib.primitive.Cut.uncheckedImplementation.<anonymous>' call
|
|
2689
|
+
tmp$ret$0 = sequenceOf([request.m2g(request.context.v4c_1, request.context.z4c_1.h4d(), [], 4, null)]);
|
|
2690
|
+
tmp$ret$1 = tmp$ret$0;
|
|
2691
|
+
return tmp$ret$1;
|
|
2692
|
+
};
|
|
2693
|
+
Cut.prototype.n2g = function (request) {
|
|
2694
|
+
return this.z4j(request);
|
|
2695
|
+
};
|
|
2696
|
+
var Cut_instance;
|
|
2697
|
+
function Cut_getInstance() {
|
|
2698
|
+
if (Cut_instance == null)
|
|
2699
|
+
new Cut();
|
|
2700
|
+
return Cut_instance;
|
|
2701
|
+
}
|
|
2702
|
+
function Not$uncheckedImplementation$slambda($request, resultContinuation) {
|
|
2703
|
+
this.m4m_1 = $request;
|
|
2704
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
2705
|
+
}
|
|
2706
|
+
Not$uncheckedImplementation$slambda.prototype.b2t = function ($this$sequence, $cont) {
|
|
2707
|
+
var tmp = this.c2t($this$sequence, $cont);
|
|
2708
|
+
tmp.ei_1 = Unit_getInstance();
|
|
2709
|
+
tmp.fi_1 = null;
|
|
2710
|
+
return tmp.ki();
|
|
2711
|
+
};
|
|
2712
|
+
Not$uncheckedImplementation$slambda.prototype.wi = function (p1, $cont) {
|
|
2713
|
+
return this.b2t(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $cont);
|
|
2714
|
+
};
|
|
2715
|
+
Not$uncheckedImplementation$slambda.prototype.ki = function () {
|
|
2716
|
+
var suspendResult = this.ei_1;
|
|
2717
|
+
$sm: do
|
|
2718
|
+
try {
|
|
2719
|
+
var tmp = this.ci_1;
|
|
2720
|
+
switch (tmp) {
|
|
2721
|
+
case 0:
|
|
2722
|
+
this.di_1 = 7;
|
|
2723
|
+
this.o4m_1 = single(this.m4m_1.arguments);
|
|
2724
|
+
var tmp_0 = this;
|
|
2725
|
+
var tmp_1 = Companion_getInstance_16();
|
|
2726
|
+
var tmp_2 = Companion_getInstance_10();
|
|
2727
|
+
var tmp0__get_functor__thl4dk = Call_getInstance();
|
|
2728
|
+
var tmp_3 = tmp_2.of(tmp0__get_functor__thl4dk.signature.name, [this.o4m_1]);
|
|
2729
|
+
var tmp_4 = new Long(0, 0);
|
|
2730
|
+
tmp_0.p4m_1 = tmp_1.k4c(newSolveRequest$default(this.m4m_1, tmp_3, null, null, null, tmp_4, false, 62, null));
|
|
2731
|
+
this.q4m_1 = this.p4m_1.j();
|
|
2732
|
+
this.ci_1 = 1;
|
|
2733
|
+
continue $sm;
|
|
2734
|
+
case 1:
|
|
2735
|
+
if (!this.q4m_1.m()) {
|
|
2736
|
+
this.ci_1 = 6;
|
|
2737
|
+
continue $sm;
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2740
|
+
this.r4m_1 = this.q4m_1.p();
|
|
2741
|
+
this.s4m_1 = this.r4m_1.solution;
|
|
2742
|
+
var tmp_5 = this.s4m_1;
|
|
2743
|
+
if (isInterface(tmp_5, Yes)) {
|
|
2744
|
+
this.ci_1 = 5;
|
|
2745
|
+
suspendResult = this.n4m_1.z4(this.m4m_1.l2g(null, [], 3, null), this);
|
|
2746
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2747
|
+
return suspendResult;
|
|
2748
|
+
}
|
|
2749
|
+
continue $sm;
|
|
2750
|
+
} else {
|
|
2751
|
+
var tmp_6 = this.s4m_1;
|
|
2752
|
+
if (isInterface(tmp_6, No)) {
|
|
2753
|
+
this.ci_1 = 3;
|
|
2754
|
+
suspendResult = this.n4m_1.z4(this.m4m_1.m2g(this.m4m_1.context.v4c_1, null, [], 6, null), this);
|
|
2755
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2756
|
+
return suspendResult;
|
|
2757
|
+
}
|
|
2758
|
+
continue $sm;
|
|
2759
|
+
} else {
|
|
2760
|
+
this.ci_1 = 2;
|
|
2761
|
+
suspendResult = this.n4m_1.z4(replyWith(this.m4m_1, this.r4m_1), this);
|
|
2762
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2763
|
+
return suspendResult;
|
|
2764
|
+
}
|
|
2765
|
+
continue $sm;
|
|
2766
|
+
}
|
|
2767
|
+
}
|
|
2768
|
+
|
|
2769
|
+
break;
|
|
2770
|
+
case 2:
|
|
2771
|
+
this.ci_1 = 4;
|
|
2772
|
+
continue $sm;
|
|
2773
|
+
case 3:
|
|
2774
|
+
this.ci_1 = 4;
|
|
2775
|
+
continue $sm;
|
|
2776
|
+
case 4:
|
|
2777
|
+
this.ci_1 = 1;
|
|
2778
|
+
continue $sm;
|
|
2779
|
+
case 5:
|
|
2780
|
+
return Unit_getInstance();
|
|
2781
|
+
case 6:
|
|
2782
|
+
return Unit_getInstance();
|
|
2783
|
+
case 7:
|
|
2784
|
+
throw this.fi_1;
|
|
2785
|
+
}
|
|
2786
|
+
} catch ($p) {
|
|
2787
|
+
if (this.di_1 === 7) {
|
|
2788
|
+
throw $p;
|
|
2789
|
+
} else {
|
|
2790
|
+
this.ci_1 = this.di_1;
|
|
2791
|
+
this.fi_1 = $p;
|
|
2792
|
+
}
|
|
2793
|
+
}
|
|
2794
|
+
while (true);
|
|
2795
|
+
};
|
|
2796
|
+
Not$uncheckedImplementation$slambda.prototype.c2t = function ($this$sequence, completion) {
|
|
2797
|
+
var i = new Not$uncheckedImplementation$slambda(this.m4m_1, completion);
|
|
2798
|
+
i.n4m_1 = $this$sequence;
|
|
2799
|
+
return i;
|
|
2800
|
+
};
|
|
2801
|
+
function Not$uncheckedImplementation$slambda_0($request, resultContinuation) {
|
|
2802
|
+
var i = new Not$uncheckedImplementation$slambda($request, resultContinuation);
|
|
2803
|
+
var l = function ($this$sequence, $cont) {
|
|
2804
|
+
return i.b2t($this$sequence, $cont);
|
|
2805
|
+
};
|
|
2806
|
+
l.$arity = 1;
|
|
2807
|
+
return l;
|
|
2808
|
+
}
|
|
2809
|
+
function Not() {
|
|
2810
|
+
Not_instance = this;
|
|
2811
|
+
PrimitiveWrapper_init_$Init$('\\+', 1, false, 4, null, this);
|
|
2812
|
+
}
|
|
2813
|
+
Not.prototype.z4j = function (request) {
|
|
2814
|
+
return sequence(Not$uncheckedImplementation$slambda_0(request, null));
|
|
2815
|
+
};
|
|
2816
|
+
Not.prototype.n2g = function (request) {
|
|
2817
|
+
return this.z4j(request);
|
|
2818
|
+
};
|
|
2819
|
+
var Not_instance;
|
|
2820
|
+
function Not_getInstance() {
|
|
2821
|
+
if (Not_instance == null)
|
|
2822
|
+
new Not();
|
|
2823
|
+
return Not_instance;
|
|
2824
|
+
}
|
|
2825
|
+
function extractErrorTypeAndExtra(_this__u8e3s4, $this) {
|
|
2826
|
+
var tmp$ret$3;
|
|
2827
|
+
// Inline function 'kotlin.with' call
|
|
2828
|
+
var tmp0_with = isInterface(_this__u8e3s4, Struct) ? _this__u8e3s4 : null;
|
|
2829
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
2830
|
+
var tmp$ret$2;
|
|
2831
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.stdlib.primitive.Throw.extractErrorTypeAndExtra.<anonymous>' call
|
|
2832
|
+
var tmp;
|
|
2833
|
+
var tmp_0;
|
|
2834
|
+
var tmp0_safe_receiver = tmp0_with;
|
|
2835
|
+
var tmp_1 = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.fw();
|
|
2836
|
+
ErrorUtils_getInstance();
|
|
2837
|
+
if (tmp_1 === 'error') {
|
|
2838
|
+
tmp_0 = tmp0_with.zv() === 2;
|
|
2839
|
+
} else {
|
|
2840
|
+
tmp_0 = false;
|
|
2841
|
+
}
|
|
2842
|
+
if (tmp_0) {
|
|
2843
|
+
var tmp_2 = firstOrNull(tmp0_with.gw());
|
|
2844
|
+
var tmp1_safe_receiver = (!(tmp_2 == null) ? isInterface(tmp_2, Struct) : false) ? tmp_2 : null;
|
|
2845
|
+
var tmp_3;
|
|
2846
|
+
if (tmp1_safe_receiver == null) {
|
|
2847
|
+
tmp_3 = null;
|
|
2848
|
+
} else {
|
|
2849
|
+
var tmp$ret$1;
|
|
2850
|
+
// Inline function 'kotlin.let' call
|
|
2851
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
2852
|
+
var tmp$ret$0;
|
|
2853
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.stdlib.primitive.Throw.extractErrorTypeAndExtra.<anonymous>.<anonymous>' call
|
|
2854
|
+
tmp$ret$0 = new Pair(tmp1_safe_receiver, tmp0_with.gw().n(1));
|
|
2855
|
+
tmp$ret$1 = tmp$ret$0;
|
|
2856
|
+
tmp_3 = tmp$ret$1;
|
|
2857
|
+
}
|
|
2858
|
+
tmp = tmp_3;
|
|
2859
|
+
} else {
|
|
2860
|
+
tmp = null;
|
|
2861
|
+
}
|
|
2862
|
+
tmp$ret$2 = tmp;
|
|
2863
|
+
tmp$ret$3 = tmp$ret$2;
|
|
2864
|
+
return tmp$ret$3;
|
|
2865
|
+
}
|
|
2866
|
+
function extractErrorCauseChain(_this__u8e3s4, $this, withContext) {
|
|
2867
|
+
var tmp0_safe_receiver = extractErrorTypeAndExtra(_this__u8e3s4, $this);
|
|
2868
|
+
var tmp;
|
|
2869
|
+
if (tmp0_safe_receiver == null) {
|
|
2870
|
+
tmp = null;
|
|
2871
|
+
} else {
|
|
2872
|
+
var tmp$ret$1;
|
|
2873
|
+
// Inline function 'kotlin.let' call
|
|
2874
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
2875
|
+
var tmp$ret$0;
|
|
2876
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.stdlib.primitive.Throw.extractErrorCauseChain.<anonymous>' call
|
|
2877
|
+
var type = tmp0_safe_receiver.n3();
|
|
2878
|
+
var extra = tmp0_safe_receiver.o3();
|
|
2879
|
+
var tmp0_$this = Companion_getInstance_13();
|
|
2880
|
+
var tmp1_cause = extractErrorCauseChain(extra, Throw_getInstance(), withContext);
|
|
2881
|
+
tmp$ret$0 = tmp0_$this.m25(null, tmp1_cause, withContext, type, extra, 1, null);
|
|
2882
|
+
tmp$ret$1 = tmp$ret$0;
|
|
2883
|
+
tmp = tmp$ret$1;
|
|
2884
|
+
}
|
|
2885
|
+
return tmp;
|
|
2886
|
+
}
|
|
2887
|
+
function Throw() {
|
|
2888
|
+
Throw_instance = this;
|
|
2889
|
+
NonBacktrackable.call(this, 'throw');
|
|
2890
|
+
}
|
|
2891
|
+
Throw.prototype.v4m = function (_this__u8e3s4, first) {
|
|
2892
|
+
var tmp;
|
|
2893
|
+
try {
|
|
2894
|
+
var tmp$ret$3;
|
|
2895
|
+
// Inline function 'kotlin.let' call
|
|
2896
|
+
var tmp0_let = single(Companion_getInstance_11().y2f(_this__u8e3s4).arguments).freshCopy();
|
|
2897
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
2898
|
+
var tmp$ret$2;
|
|
2899
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.stdlib.primitive.Throw.computeOne.<anonymous>' call
|
|
2900
|
+
var ancestorCatch = _this__u8e3s4.context.z4c_1.p4d(tmp0_let);
|
|
2901
|
+
var tmp0_safe_receiver = ancestorCatch;
|
|
2902
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.arguments;
|
|
2903
|
+
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.n(1);
|
|
2904
|
+
var tmp_0;
|
|
2905
|
+
if (tmp2_safe_receiver == null) {
|
|
2906
|
+
tmp_0 = null;
|
|
2907
|
+
} else {
|
|
2908
|
+
var tmp$ret$1;
|
|
2909
|
+
// Inline function 'kotlin.let' call
|
|
2910
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
2911
|
+
var tmp$ret$0;
|
|
2912
|
+
// Inline function 'it.unibo.tuprolog.solve.streams.stdlib.primitive.Throw.computeOne.<anonymous>.<anonymous>' call
|
|
2913
|
+
tmp$ret$0 = Companion_getInstance_11().b2h(_this__u8e3s4, tmp2_safe_receiver, tmp0_let);
|
|
2914
|
+
tmp$ret$1 = tmp$ret$0;
|
|
2915
|
+
tmp_0 = tmp$ret$1;
|
|
2916
|
+
}
|
|
2917
|
+
var catcher = tmp_0;
|
|
2918
|
+
var tmp_1;
|
|
2919
|
+
if (!(catcher == null) ? isInterface(catcher, Unifier) : false) {
|
|
2920
|
+
var tmp_2 = _this__u8e3s4.context.v4c_1.plus(catcher);
|
|
2921
|
+
var newSubstitution = isInterface(tmp_2, Unifier) ? tmp_2 : THROW_CCE();
|
|
2922
|
+
tmp_1 = _this__u8e3s4.m2g(newSubstitution, _this__u8e3s4.context.z4c_1.q4d(ancestorCatch.context), [], 4, null);
|
|
2923
|
+
} else {
|
|
2924
|
+
var errorCause = extractErrorCauseChain(tmp0_let, Throw_getInstance(), _this__u8e3s4.context);
|
|
2925
|
+
var tmp_3;
|
|
2926
|
+
if (!(errorCause == null)) {
|
|
2927
|
+
throw errorCause;
|
|
2928
|
+
} else {
|
|
2929
|
+
throw Companion_getInstance_14().forUncaughtException(_this__u8e3s4.context, tmp0_let);
|
|
2930
|
+
}
|
|
2931
|
+
tmp_1 = tmp_3;
|
|
2932
|
+
}
|
|
2933
|
+
tmp$ret$2 = tmp_1;
|
|
2934
|
+
tmp$ret$3 = tmp$ret$2;
|
|
2935
|
+
tmp = tmp$ret$3;
|
|
2936
|
+
} catch ($p) {
|
|
2937
|
+
var tmp_4;
|
|
2938
|
+
if ($p instanceof LogicError) {
|
|
2939
|
+
tmp_4 = _this__u8e3s4.c2j($p, null, [], 6, null);
|
|
2940
|
+
} else {
|
|
2941
|
+
throw $p;
|
|
2942
|
+
}
|
|
2943
|
+
tmp = tmp_4;
|
|
2944
|
+
}
|
|
2945
|
+
return tmp;
|
|
2946
|
+
};
|
|
2947
|
+
Throw.prototype.a2k = function (_this__u8e3s4, first) {
|
|
2948
|
+
return this.v4m(_this__u8e3s4, first);
|
|
2949
|
+
};
|
|
2950
|
+
var Throw_instance;
|
|
2951
|
+
function Throw_getInstance() {
|
|
2952
|
+
if (Throw_instance == null)
|
|
2953
|
+
new Throw();
|
|
2954
|
+
return Throw_instance;
|
|
2955
|
+
}
|
|
2956
|
+
//region block: post-declaration
|
|
2957
|
+
StreamsSolver.prototype.x1x = copy$default;
|
|
2958
|
+
StreamsSolver.prototype.solveWithTimeout = solveWithTimeout;
|
|
2959
|
+
StreamsSolver.prototype.solve = solve;
|
|
2960
|
+
StreamsSolver.prototype.solveListWithTimeout = solveListWithTimeout;
|
|
2961
|
+
StreamsSolver.prototype.solveList = solveList;
|
|
2962
|
+
StreamsSolver.prototype.solveListWithOptions = solveListWithOptions;
|
|
2963
|
+
StreamsSolver.prototype.solveOnceWithTimeout = solveOnceWithTimeout;
|
|
2964
|
+
StreamsSolver.prototype.solveOnce = solveOnce;
|
|
2965
|
+
StreamsSolver.prototype.solveOnceWithOptions = solveOnceWithOptions;
|
|
2966
|
+
StreamsSolver.prototype.clone = clone;
|
|
2967
|
+
StreamsSolver.prototype.i1v = get_standardInput;
|
|
2968
|
+
StreamsSolver.prototype.k1v = get_standardOutput;
|
|
2969
|
+
StreamsSolver.prototype.m1v = get_standardError;
|
|
2970
|
+
StreamsSolver.prototype.o1v = get_warnings;
|
|
2971
|
+
StreamsSolverFactory.prototype.u1y = solverOf$default;
|
|
2972
|
+
StreamsSolverFactory.prototype.w1y = solverOf$default_0;
|
|
2973
|
+
StreamsSolverFactory.prototype.a1z = mutableSolverOf$default;
|
|
2974
|
+
StreamsSolverFactory.prototype.e1z = mutableSolverOf$default_0;
|
|
2975
|
+
StreamsSolverFactory.prototype.newBuilder = newBuilder;
|
|
2976
|
+
StreamsSolverFactory.prototype.c1y = get_defaultRuntime;
|
|
2977
|
+
StreamsSolverFactory.prototype.e1y = get_defaultUnificator;
|
|
2978
|
+
StreamsSolverFactory.prototype.f1y = get_defaultFlags;
|
|
2979
|
+
StreamsSolverFactory.prototype.i1y = get_defaultStaticKb;
|
|
2980
|
+
StreamsSolverFactory.prototype.j1y = get_defaultDynamicKb;
|
|
2981
|
+
StreamsSolverFactory.prototype.k1y = get_defaultInputChannel;
|
|
2982
|
+
StreamsSolverFactory.prototype.l1y = get_defaultOutputChannel;
|
|
2983
|
+
StreamsSolverFactory.prototype.m1y = get_defaultErrorChannel;
|
|
2984
|
+
StreamsSolverFactory.prototype.n1y = get_defaultWarningsChannel;
|
|
2985
|
+
StreamsSolverFactory.prototype.x1y = solverWithDefaultBuiltins;
|
|
2986
|
+
StreamsSolverFactory.prototype.y1y = solverWithDefaultBuiltins$default;
|
|
2987
|
+
StreamsSolverFactory.prototype.b1z = mutableSolverWithDefaultBuiltins;
|
|
2988
|
+
StreamsSolverFactory.prototype.c1z = mutableSolverWithDefaultBuiltins$default;
|
|
2989
|
+
StreamsExecutionContext.prototype.v1u = createSolver$default;
|
|
2990
|
+
StreamsExecutionContext.prototype.d1v = createMutableSolver$default;
|
|
2991
|
+
StreamsExecutionContext.prototype.g1v = update$default;
|
|
2992
|
+
StreamsExecutionContext.prototype.i1v = get_standardInput;
|
|
2993
|
+
StreamsExecutionContext.prototype.k1v = get_standardOutput;
|
|
2994
|
+
StreamsExecutionContext.prototype.m1v = get_standardError;
|
|
2995
|
+
StreamsExecutionContext.prototype.o1v = get_warnings;
|
|
2996
|
+
StreamsExecutionContext.prototype.m1u = get_endTime;
|
|
2997
|
+
StreamsExecutionContext.prototype.o1u = get_remainingTime;
|
|
2998
|
+
StreamsExecutionContext.prototype.p1u = get_elapsedTime;
|
|
2999
|
+
AbstractTimedState.prototype.j5 = get_context;
|
|
3000
|
+
StateGoalEvaluation.prototype.j5 = get_context;
|
|
3001
|
+
StateInit.prototype.j5 = get_context;
|
|
3002
|
+
StateRuleSelection.prototype.j5 = get_context;
|
|
3003
|
+
DefaultBuiltins.prototype.containsSignature = containsSignature;
|
|
3004
|
+
DefaultBuiltins.prototype.containsOperator = containsOperator;
|
|
3005
|
+
DefaultBuiltins.prototype.hasPrimitive = hasPrimitive;
|
|
3006
|
+
DefaultBuiltins.prototype.hasFunction = hasFunction;
|
|
3007
|
+
DefaultBuiltins.prototype.j2e = get_ruleSignatures;
|
|
3008
|
+
DefaultBuiltins.prototype.hasProtected = hasProtected;
|
|
3009
|
+
//endregion
|
|
3010
|
+
//region block: exports
|
|
3011
|
+
function $jsExportAll$(_) {
|
|
3012
|
+
var $it = _.it || (_.it = {});
|
|
3013
|
+
var $it$unibo = $it.unibo || ($it.unibo = {});
|
|
3014
|
+
var $it$unibo$tuprolog = $it$unibo.tuprolog || ($it$unibo.tuprolog = {});
|
|
3015
|
+
var $it$unibo$tuprolog$solve = $it$unibo$tuprolog.solve || ($it$unibo$tuprolog.solve = {});
|
|
3016
|
+
var $it$unibo$tuprolog$solve$streams = $it$unibo$tuprolog$solve.streams || ($it$unibo$tuprolog$solve.streams = {});
|
|
3017
|
+
Object.defineProperty($it$unibo$tuprolog$solve$streams, 'StreamsSolverFactory', {
|
|
3018
|
+
configurable: true,
|
|
3019
|
+
get: StreamsSolverFactory_getInstance
|
|
3020
|
+
});
|
|
3021
|
+
}
|
|
3022
|
+
$jsExportAll$(_);
|
|
3023
|
+
_.$jsExportAll$ = $jsExportAll$;
|
|
3024
|
+
//endregion
|
|
3025
|
+
return _;
|
|
3026
|
+
}(module.exports, require('./kotlin-kotlin-stdlib-js-ir.js'), require('./2p-solve.js'), require('./2p-utils.js'), require('./2p-unify.js'), require('./2p-core.js'), require('./2p-theory.js')));
|
|
3027
|
+
|
|
3028
|
+
//# sourceMappingURL=2p-solve-streams.js.map
|