prolog-trace-viz 1.1.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -30
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/analyzer.js +268 -96
- package/dist/analyzer.js.map +1 -1
- package/dist/build-info.d.ts +3 -3
- package/dist/build-info.js +3 -3
- package/dist/clauses.d.ts +11 -0
- package/dist/clauses.d.ts.map +1 -1
- package/dist/clauses.js +12 -0
- package/dist/clauses.js.map +1 -1
- package/dist/cli.d.ts +4 -6
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +2 -25
- package/dist/cli.js.map +1 -1
- package/dist/index.js +80 -22
- package/dist/index.js.map +1 -1
- package/dist/markdown-generator.d.ts +24 -0
- package/dist/markdown-generator.d.ts.map +1 -0
- package/dist/markdown-generator.js +124 -0
- package/dist/markdown-generator.js.map +1 -0
- package/dist/parser.d.ts +12 -1
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +67 -35
- package/dist/parser.js.map +1 -1
- package/dist/timeline-formatter.d.ts +9 -0
- package/dist/timeline-formatter.d.ts.map +1 -0
- package/dist/timeline-formatter.js +149 -0
- package/dist/timeline-formatter.js.map +1 -0
- package/dist/timeline.d.ts +148 -0
- package/dist/timeline.d.ts.map +1 -0
- package/dist/timeline.js +601 -0
- package/dist/timeline.js.map +1 -0
- package/dist/tree-formatter.d.ts +13 -0
- package/dist/tree-formatter.d.ts.map +1 -0
- package/dist/tree-formatter.js +136 -0
- package/dist/tree-formatter.js.map +1 -0
- package/dist/tree.d.ts +75 -0
- package/dist/tree.d.ts.map +1 -0
- package/dist/tree.js +267 -0
- package/dist/tree.js.map +1 -0
- package/dist/wrapper.d.ts +8 -1
- package/dist/wrapper.d.ts.map +1 -1
- package/dist/wrapper.js +41 -17
- package/dist/wrapper.js.map +1 -1
- package/package.json +1 -1
- package/tracer.pl +127 -16
package/dist/timeline.js
ADDED
|
@@ -0,0 +1,601 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Timeline Builder - Constructs a flat, sequential timeline from trace events
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Timeline Builder class - processes trace events into timeline steps
|
|
6
|
+
*/
|
|
7
|
+
export class TimelineBuilder {
|
|
8
|
+
events;
|
|
9
|
+
sourceClauseMap;
|
|
10
|
+
steps = [];
|
|
11
|
+
stepCounter = 0;
|
|
12
|
+
callStack = new Map(); // level -> step number
|
|
13
|
+
subgoalMap = new Map(); // level -> subgoal info
|
|
14
|
+
parentSubgoals = new Map(); // step number -> subgoals
|
|
15
|
+
completedSubgoals = new Map(); // parent step -> count of completed subgoals
|
|
16
|
+
constructor(events, sourceClauseMap) {
|
|
17
|
+
this.events = events;
|
|
18
|
+
this.sourceClauseMap = sourceClauseMap;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Check if a predicate is part of tracer infrastructure and should be filtered
|
|
22
|
+
*/
|
|
23
|
+
isTracerPredicate(predicate) {
|
|
24
|
+
const tracerPredicates = [
|
|
25
|
+
'catch/3',
|
|
26
|
+
'export_trace_json/1',
|
|
27
|
+
'run_trace/0',
|
|
28
|
+
'install_tracer/1',
|
|
29
|
+
'remove_tracer/0',
|
|
30
|
+
];
|
|
31
|
+
return tracerPredicates.includes(predicate);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Build the complete timeline from trace events
|
|
35
|
+
*/
|
|
36
|
+
build() {
|
|
37
|
+
// First pass: process all events
|
|
38
|
+
for (const event of this.events) {
|
|
39
|
+
// Filter out tracer infrastructure
|
|
40
|
+
if (!this.isTracerPredicate(event.predicate)) {
|
|
41
|
+
this.processEvent(event);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// Second pass: backfill clause info from EXIT to CALL steps
|
|
45
|
+
this.backfillClauseInfo();
|
|
46
|
+
// Third pass: update subgoal tracking based on execution flow
|
|
47
|
+
this.updateSubgoalTracking();
|
|
48
|
+
// Fourth pass: add variable flow tracking notes
|
|
49
|
+
this.addVariableFlowNotes();
|
|
50
|
+
return this.steps;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Backfill clause information from EXIT events to their corresponding CALL events
|
|
54
|
+
*/
|
|
55
|
+
backfillClauseInfo() {
|
|
56
|
+
// For each CALL step without clause info, find its matching EXIT
|
|
57
|
+
for (let i = 0; i < this.steps.length; i++) {
|
|
58
|
+
const callStep = this.steps[i];
|
|
59
|
+
if (callStep.port === 'call' && !callStep.clause) {
|
|
60
|
+
// Find the matching EXIT for this CALL
|
|
61
|
+
// It should be at the same level and have the same predicate
|
|
62
|
+
const exitStep = this.findMatchingExit(callStep, i);
|
|
63
|
+
if (exitStep && exitStep.clause) {
|
|
64
|
+
// Use source clause if available, otherwise use runtime clause
|
|
65
|
+
const sourceClause = this.getSourceClause(exitStep.clause.line);
|
|
66
|
+
if (sourceClause) {
|
|
67
|
+
callStep.clause = {
|
|
68
|
+
head: sourceClause.head,
|
|
69
|
+
body: sourceClause.body || 'true',
|
|
70
|
+
line: sourceClause.number,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
callStep.clause = exitStep.clause;
|
|
75
|
+
}
|
|
76
|
+
// Extract pattern match bindings using source clause head
|
|
77
|
+
const patternBindings = this.extractPatternMatchBindings(callStep.goal, callStep.clause.head);
|
|
78
|
+
callStep.unifications = patternBindings;
|
|
79
|
+
// Re-extract subgoals now that we have clause info
|
|
80
|
+
if (callStep.clause.body && callStep.clause.body !== 'true') {
|
|
81
|
+
const subgoalGoals = this.extractSubgoals(callStep.clause.body);
|
|
82
|
+
callStep.subgoals = subgoalGoals.map((goal, index) => ({
|
|
83
|
+
label: `[${callStep.stepNumber}.${index + 1}]`,
|
|
84
|
+
goal,
|
|
85
|
+
}));
|
|
86
|
+
// Update parent subgoals map
|
|
87
|
+
if (callStep.subgoals.length > 0) {
|
|
88
|
+
this.parentSubgoals.set(callStep.stepNumber, callStep.subgoals);
|
|
89
|
+
this.completedSubgoals.set(callStep.stepNumber, 0);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Update subgoal tracking markers based on execution flow
|
|
98
|
+
* This must run after backfillClauseInfo so we have all subgoals defined
|
|
99
|
+
*/
|
|
100
|
+
updateSubgoalTracking() {
|
|
101
|
+
// Track which subgoal is currently active at each level
|
|
102
|
+
const activeSubgoalMap = new Map();
|
|
103
|
+
for (const step of this.steps) {
|
|
104
|
+
if (step.port === 'call') {
|
|
105
|
+
// Check if this CALL is solving a subgoal
|
|
106
|
+
const subgoalInfo = activeSubgoalMap.get(step.level);
|
|
107
|
+
if (subgoalInfo) {
|
|
108
|
+
step.subgoalLabel = `[${subgoalInfo.parentStep}.${subgoalInfo.subgoalIndex}]`;
|
|
109
|
+
}
|
|
110
|
+
// If this CALL has subgoals, set up tracking for the first one
|
|
111
|
+
if (step.subgoals.length > 0) {
|
|
112
|
+
activeSubgoalMap.set(step.level + 1, {
|
|
113
|
+
parentStep: step.stepNumber,
|
|
114
|
+
subgoalIndex: 1,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else if (step.port === 'exit') {
|
|
119
|
+
// Check if this EXIT completes a subgoal
|
|
120
|
+
const subgoalInfo = activeSubgoalMap.get(step.level);
|
|
121
|
+
if (subgoalInfo) {
|
|
122
|
+
step.subgoalLabel = `[${subgoalInfo.parentStep}.${subgoalInfo.subgoalIndex}]`;
|
|
123
|
+
// Check if there's a next subgoal
|
|
124
|
+
const parentSubgoals = this.parentSubgoals.get(subgoalInfo.parentStep);
|
|
125
|
+
if (parentSubgoals && subgoalInfo.subgoalIndex < parentSubgoals.length) {
|
|
126
|
+
// Move to next subgoal
|
|
127
|
+
const nextSubgoalIndex = subgoalInfo.subgoalIndex + 1;
|
|
128
|
+
const nextSubgoalData = parentSubgoals[nextSubgoalIndex - 1];
|
|
129
|
+
step.nextSubgoal = `Subgoal ${nextSubgoalData.label}`;
|
|
130
|
+
// Update active subgoal for this level
|
|
131
|
+
activeSubgoalMap.set(step.level, {
|
|
132
|
+
parentStep: subgoalInfo.parentStep,
|
|
133
|
+
subgoalIndex: nextSubgoalIndex,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
// All subgoals completed
|
|
138
|
+
activeSubgoalMap.delete(step.level);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Add variable flow tracking notes to steps
|
|
146
|
+
* This shows how variables from parent clauses flow into child goals
|
|
147
|
+
*/
|
|
148
|
+
addVariableFlowNotes() {
|
|
149
|
+
// Track variable bindings: step number -> variable name -> value
|
|
150
|
+
const bindingMap = new Map();
|
|
151
|
+
for (const step of this.steps) {
|
|
152
|
+
// Record bindings from this step
|
|
153
|
+
if (step.unifications.length > 0) {
|
|
154
|
+
const stepBindings = new Map();
|
|
155
|
+
for (const unif of step.unifications) {
|
|
156
|
+
stepBindings.set(unif.variable, unif.value);
|
|
157
|
+
}
|
|
158
|
+
bindingMap.set(step.stepNumber, stepBindings);
|
|
159
|
+
}
|
|
160
|
+
// For EXIT steps, add notes about which variables got bound
|
|
161
|
+
if (step.port === 'exit' && step.returnsTo) {
|
|
162
|
+
const callStep = this.steps.find(s => s.stepNumber === step.returnsTo);
|
|
163
|
+
if (callStep && callStep.unifications.length > 0) {
|
|
164
|
+
const notes = [];
|
|
165
|
+
for (const unif of callStep.unifications) {
|
|
166
|
+
// Check if this variable was unbound at CALL and is now bound at EXIT
|
|
167
|
+
if (unif.value.startsWith('_') && !step.goal.includes(unif.value)) {
|
|
168
|
+
// Variable was unbound, now it's bound - extract the new value from EXIT goal
|
|
169
|
+
const exitValue = this.extractVariableValueFromGoal(step.goal, unif.variable, callStep.clause?.head);
|
|
170
|
+
if (exitValue && exitValue !== unif.value) {
|
|
171
|
+
notes.push(`${unif.variable} from Step ${callStep.stepNumber} is now bound to ${exitValue}`);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (notes.length > 0) {
|
|
176
|
+
step.variableFlowNotes = notes;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Extract the value of a variable from a goal based on its position in the clause head
|
|
184
|
+
*/
|
|
185
|
+
extractVariableValueFromGoal(goal, variable, clauseHead) {
|
|
186
|
+
if (!clauseHead) {
|
|
187
|
+
return null;
|
|
188
|
+
}
|
|
189
|
+
// Find the position of the variable in the clause head
|
|
190
|
+
const headMatch = clauseHead.match(/^([^(]+)\((.*)\)$/);
|
|
191
|
+
const goalMatch = goal.match(/^([^(]+)\((.*)\)$/);
|
|
192
|
+
if (!headMatch || !goalMatch) {
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
const headArgs = this.splitArguments(headMatch[2]);
|
|
196
|
+
const goalArgs = this.splitArguments(goalMatch[2]);
|
|
197
|
+
// Find which argument position contains the variable
|
|
198
|
+
for (let i = 0; i < headArgs.length; i++) {
|
|
199
|
+
if (headArgs[i].trim() === variable) {
|
|
200
|
+
return goalArgs[i]?.trim() || null;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Get source clause from the source clause map
|
|
207
|
+
*/
|
|
208
|
+
getSourceClause(lineNumber) {
|
|
209
|
+
if (!this.sourceClauseMap) {
|
|
210
|
+
return null;
|
|
211
|
+
}
|
|
212
|
+
const clause = this.sourceClauseMap[lineNumber];
|
|
213
|
+
if (!clause) {
|
|
214
|
+
return null;
|
|
215
|
+
}
|
|
216
|
+
return {
|
|
217
|
+
head: clause.head,
|
|
218
|
+
body: clause.body,
|
|
219
|
+
number: clause.number,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Find the matching EXIT step for a CALL step
|
|
224
|
+
*/
|
|
225
|
+
findMatchingExit(callStep, startIndex) {
|
|
226
|
+
// Look forward from the CALL to find the matching EXIT
|
|
227
|
+
// The EXIT should be at the same level and return to this CALL
|
|
228
|
+
for (let i = startIndex + 1; i < this.steps.length; i++) {
|
|
229
|
+
const step = this.steps[i];
|
|
230
|
+
if (step.port === 'exit' &&
|
|
231
|
+
step.level === callStep.level &&
|
|
232
|
+
step.returnsTo === callStep.stepNumber) {
|
|
233
|
+
return step;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return null;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Process a single trace event
|
|
240
|
+
*/
|
|
241
|
+
processEvent(event) {
|
|
242
|
+
switch (event.port) {
|
|
243
|
+
case 'call':
|
|
244
|
+
this.processCall(event);
|
|
245
|
+
break;
|
|
246
|
+
case 'exit':
|
|
247
|
+
this.processExit(event);
|
|
248
|
+
break;
|
|
249
|
+
case 'redo':
|
|
250
|
+
this.processRedo(event);
|
|
251
|
+
break;
|
|
252
|
+
case 'fail':
|
|
253
|
+
this.processFail(event);
|
|
254
|
+
break;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Extract subgoals from a clause body
|
|
259
|
+
*/
|
|
260
|
+
extractSubgoals(clauseBody) {
|
|
261
|
+
if (!clauseBody || clauseBody === 'true') {
|
|
262
|
+
return [];
|
|
263
|
+
}
|
|
264
|
+
// Split on commas, respecting parentheses depth
|
|
265
|
+
const subgoals = [];
|
|
266
|
+
let current = '';
|
|
267
|
+
let depth = 0;
|
|
268
|
+
for (const char of clauseBody) {
|
|
269
|
+
if (char === '(') {
|
|
270
|
+
depth++;
|
|
271
|
+
current += char;
|
|
272
|
+
}
|
|
273
|
+
else if (char === ')') {
|
|
274
|
+
depth--;
|
|
275
|
+
current += char;
|
|
276
|
+
}
|
|
277
|
+
else if (char === ',' && depth === 0) {
|
|
278
|
+
subgoals.push(current.trim());
|
|
279
|
+
current = '';
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
current += char;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
if (current.trim()) {
|
|
286
|
+
subgoals.push(current.trim());
|
|
287
|
+
}
|
|
288
|
+
return subgoals;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Process CALL event
|
|
292
|
+
*/
|
|
293
|
+
processCall(event) {
|
|
294
|
+
this.stepCounter++;
|
|
295
|
+
const stepNumber = this.stepCounter;
|
|
296
|
+
// Track this call in the stack
|
|
297
|
+
this.callStack.set(event.level, stepNumber);
|
|
298
|
+
// Use source clause if available
|
|
299
|
+
let clauseInfo = event.clause;
|
|
300
|
+
if (clauseInfo && this.sourceClauseMap) {
|
|
301
|
+
const sourceClause = this.getSourceClause(clauseInfo.line);
|
|
302
|
+
if (sourceClause) {
|
|
303
|
+
clauseInfo = {
|
|
304
|
+
head: sourceClause.head,
|
|
305
|
+
body: sourceClause.body || 'true',
|
|
306
|
+
line: sourceClause.number,
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
// Extract subgoals from clause body if available
|
|
311
|
+
const subgoals = [];
|
|
312
|
+
if (clauseInfo && clauseInfo.body) {
|
|
313
|
+
const subgoalGoals = this.extractSubgoals(clauseInfo.body);
|
|
314
|
+
subgoalGoals.forEach((goal, index) => {
|
|
315
|
+
subgoals.push({
|
|
316
|
+
label: `[${stepNumber}.${index + 1}]`,
|
|
317
|
+
goal,
|
|
318
|
+
});
|
|
319
|
+
});
|
|
320
|
+
// Store subgoals for this step
|
|
321
|
+
if (subgoals.length > 0) {
|
|
322
|
+
this.parentSubgoals.set(stepNumber, subgoals);
|
|
323
|
+
this.completedSubgoals.set(stepNumber, 0);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
// Determine if this call is solving a subgoal (will be set during backfill)
|
|
327
|
+
let subgoalLabel;
|
|
328
|
+
// Extract pattern match bindings if clause available
|
|
329
|
+
const unifications = [];
|
|
330
|
+
if (clauseInfo) {
|
|
331
|
+
const patternBindings = this.extractPatternMatchBindings(event.goal, clauseInfo.head);
|
|
332
|
+
unifications.push(...patternBindings);
|
|
333
|
+
}
|
|
334
|
+
const step = {
|
|
335
|
+
stepNumber,
|
|
336
|
+
port: 'call',
|
|
337
|
+
level: event.level,
|
|
338
|
+
goal: event.goal,
|
|
339
|
+
clause: clauseInfo,
|
|
340
|
+
unifications,
|
|
341
|
+
subgoals,
|
|
342
|
+
subgoalLabel,
|
|
343
|
+
};
|
|
344
|
+
this.steps.push(step);
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Extract pattern match bindings by comparing goal with clause head
|
|
348
|
+
* Uses structural decomposition - not heuristics, just comparing known data
|
|
349
|
+
*/
|
|
350
|
+
extractPatternMatchBindings(goal, clauseHead) {
|
|
351
|
+
const bindings = [];
|
|
352
|
+
// Parse both goal and clause head
|
|
353
|
+
const goalMatch = goal.match(/^([^(]+)\((.*)\)$/);
|
|
354
|
+
const headMatch = clauseHead.match(/^([^(]+)\((.*)\)$/);
|
|
355
|
+
if (!goalMatch || !headMatch) {
|
|
356
|
+
return bindings;
|
|
357
|
+
}
|
|
358
|
+
const goalArgs = this.splitArguments(goalMatch[2]);
|
|
359
|
+
const headArgs = this.splitArguments(headMatch[2]);
|
|
360
|
+
// Match arguments positionally with structural decomposition
|
|
361
|
+
for (let i = 0; i < Math.min(goalArgs.length, headArgs.length); i++) {
|
|
362
|
+
const goalArg = goalArgs[i].trim();
|
|
363
|
+
const headArg = headArgs[i].trim();
|
|
364
|
+
// Recursively extract bindings from this argument pair
|
|
365
|
+
this.extractBindingsFromTermPair(headArg, goalArg, bindings);
|
|
366
|
+
}
|
|
367
|
+
return bindings;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Recursively extract bindings by comparing pattern term with value term
|
|
371
|
+
* This is structural decomposition, not unification - we're just comparing strings
|
|
372
|
+
*/
|
|
373
|
+
extractBindingsFromTermPair(pattern, value, bindings) {
|
|
374
|
+
// If pattern is a simple variable (single uppercase/underscore identifier)
|
|
375
|
+
if (this.isSimpleVariable(pattern)) {
|
|
376
|
+
bindings.push({ variable: pattern, value });
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
// If pattern and value are identical, no binding needed
|
|
380
|
+
if (pattern === value) {
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
// Try to decompose as compound term with operators
|
|
384
|
+
// e.g., "X+1+1" vs "0+1+1" -> extract X=0
|
|
385
|
+
const patternOp = this.findOperator(pattern);
|
|
386
|
+
const valueOp = this.findOperator(value);
|
|
387
|
+
if (patternOp && valueOp && patternOp.op === valueOp.op) {
|
|
388
|
+
// Same operator - recursively match operands
|
|
389
|
+
this.extractBindingsFromTermPair(patternOp.left, valueOp.left, bindings);
|
|
390
|
+
this.extractBindingsFromTermPair(patternOp.right, valueOp.right, bindings);
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
// Try to decompose as list
|
|
394
|
+
// e.g., "[H|T]" vs "[1,2,3]" -> extract H=1, T=[2,3]
|
|
395
|
+
if (pattern.startsWith('[') && value.startsWith('[')) {
|
|
396
|
+
const patternList = this.parseListPattern(pattern);
|
|
397
|
+
const valueList = this.parseListPattern(value);
|
|
398
|
+
if (patternList && valueList) {
|
|
399
|
+
if (patternList.head && valueList.head) {
|
|
400
|
+
this.extractBindingsFromTermPair(patternList.head, valueList.head, bindings);
|
|
401
|
+
}
|
|
402
|
+
if (patternList.tail && valueList.tail) {
|
|
403
|
+
this.extractBindingsFromTermPair(patternList.tail, valueList.tail, bindings);
|
|
404
|
+
}
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
// If we can't decompose further, no binding
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Check if a term is a simple variable
|
|
412
|
+
*/
|
|
413
|
+
isSimpleVariable(term) {
|
|
414
|
+
return /^[A-Z_][A-Za-z0-9_]*$/.test(term);
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Find the main operator in a term
|
|
418
|
+
* Returns null if no operator found
|
|
419
|
+
*/
|
|
420
|
+
findOperator(term) {
|
|
421
|
+
const operators = ['+', '-', '*', '/'];
|
|
422
|
+
// Find operator at depth 0 (not inside parentheses)
|
|
423
|
+
let depth = 0;
|
|
424
|
+
for (let i = term.length - 1; i >= 0; i--) {
|
|
425
|
+
const char = term[i];
|
|
426
|
+
if (char === ')' || char === ']') {
|
|
427
|
+
depth++;
|
|
428
|
+
}
|
|
429
|
+
else if (char === '(' || char === '[') {
|
|
430
|
+
depth--;
|
|
431
|
+
}
|
|
432
|
+
else if (depth === 0 && operators.includes(char)) {
|
|
433
|
+
return {
|
|
434
|
+
op: char,
|
|
435
|
+
left: term.slice(0, i).trim(),
|
|
436
|
+
right: term.slice(i + 1).trim(),
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
return null;
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Parse a list pattern
|
|
444
|
+
*/
|
|
445
|
+
parseListPattern(list) {
|
|
446
|
+
if (!list.startsWith('[') || !list.endsWith(']')) {
|
|
447
|
+
return null;
|
|
448
|
+
}
|
|
449
|
+
const content = list.slice(1, -1).trim();
|
|
450
|
+
// Check for [H|T] pattern
|
|
451
|
+
const pipeIndex = content.indexOf('|');
|
|
452
|
+
if (pipeIndex !== -1) {
|
|
453
|
+
return {
|
|
454
|
+
head: content.slice(0, pipeIndex).trim(),
|
|
455
|
+
tail: content.slice(pipeIndex + 1).trim(),
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
// Check for [H, ...] pattern
|
|
459
|
+
const commaIndex = content.indexOf(',');
|
|
460
|
+
if (commaIndex !== -1) {
|
|
461
|
+
return {
|
|
462
|
+
head: content.slice(0, commaIndex).trim(),
|
|
463
|
+
tail: `[${content.slice(commaIndex + 1).trim()}]`,
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
// Single element or empty list
|
|
467
|
+
if (content) {
|
|
468
|
+
return { head: content, tail: '[]' };
|
|
469
|
+
}
|
|
470
|
+
return null;
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* Extract unifications by comparing CALL and EXIT goals
|
|
474
|
+
*/
|
|
475
|
+
extractUnifications(callGoal, exitGoal) {
|
|
476
|
+
const unifications = [];
|
|
477
|
+
// Simple structural comparison - extract arguments
|
|
478
|
+
const callMatch = callGoal.match(/^([^(]+)\((.*)\)$/);
|
|
479
|
+
const exitMatch = exitGoal.match(/^([^(]+)\((.*)\)$/);
|
|
480
|
+
if (!callMatch || !exitMatch) {
|
|
481
|
+
return unifications;
|
|
482
|
+
}
|
|
483
|
+
const callArgs = this.splitArguments(callMatch[2]);
|
|
484
|
+
const exitArgs = this.splitArguments(exitMatch[2]);
|
|
485
|
+
// Compare arguments positionally
|
|
486
|
+
for (let i = 0; i < Math.min(callArgs.length, exitArgs.length); i++) {
|
|
487
|
+
const callArg = callArgs[i].trim();
|
|
488
|
+
const exitArg = exitArgs[i].trim();
|
|
489
|
+
// If call arg is a variable (starts with _ or uppercase) and exit arg is different
|
|
490
|
+
if (callArg !== exitArg && /^[A-Z_]/.test(callArg)) {
|
|
491
|
+
unifications.push({
|
|
492
|
+
variable: callArg,
|
|
493
|
+
value: exitArg,
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
return unifications;
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* Split arguments respecting parentheses and brackets
|
|
501
|
+
*/
|
|
502
|
+
splitArguments(argsStr) {
|
|
503
|
+
const args = [];
|
|
504
|
+
let current = '';
|
|
505
|
+
let depth = 0;
|
|
506
|
+
for (const char of argsStr) {
|
|
507
|
+
if (char === '(' || char === '[') {
|
|
508
|
+
depth++;
|
|
509
|
+
current += char;
|
|
510
|
+
}
|
|
511
|
+
else if (char === ')' || char === ']') {
|
|
512
|
+
depth--;
|
|
513
|
+
current += char;
|
|
514
|
+
}
|
|
515
|
+
else if (char === ',' && depth === 0) {
|
|
516
|
+
args.push(current.trim());
|
|
517
|
+
current = '';
|
|
518
|
+
}
|
|
519
|
+
else {
|
|
520
|
+
current += char;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
if (current.trim()) {
|
|
524
|
+
args.push(current.trim());
|
|
525
|
+
}
|
|
526
|
+
return args;
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Process EXIT event
|
|
530
|
+
*/
|
|
531
|
+
processExit(event) {
|
|
532
|
+
this.stepCounter++;
|
|
533
|
+
const stepNumber = this.stepCounter;
|
|
534
|
+
// Find the matching CALL step
|
|
535
|
+
const callStep = this.callStack.get(event.level);
|
|
536
|
+
// Extract unifications by comparing with CALL goal
|
|
537
|
+
let unifications = [];
|
|
538
|
+
if (callStep) {
|
|
539
|
+
const callStepData = this.steps.find(s => s.stepNumber === callStep);
|
|
540
|
+
if (callStepData) {
|
|
541
|
+
unifications = this.extractUnifications(callStepData.goal, event.goal);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
// Subgoal tracking will be updated in updateSubgoalTracking pass
|
|
545
|
+
const step = {
|
|
546
|
+
stepNumber,
|
|
547
|
+
port: 'exit',
|
|
548
|
+
level: event.level,
|
|
549
|
+
goal: event.goal,
|
|
550
|
+
clause: event.clause,
|
|
551
|
+
unifications,
|
|
552
|
+
subgoals: [],
|
|
553
|
+
returnsTo: callStep,
|
|
554
|
+
};
|
|
555
|
+
// Remove from call stack
|
|
556
|
+
this.callStack.delete(event.level);
|
|
557
|
+
this.steps.push(step);
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* Process REDO event
|
|
561
|
+
*/
|
|
562
|
+
processRedo(event) {
|
|
563
|
+
this.stepCounter++;
|
|
564
|
+
const stepNumber = this.stepCounter;
|
|
565
|
+
// Find the step being retried
|
|
566
|
+
const retriedStep = this.callStack.get(event.level);
|
|
567
|
+
const step = {
|
|
568
|
+
stepNumber,
|
|
569
|
+
port: 'redo',
|
|
570
|
+
level: event.level,
|
|
571
|
+
goal: event.goal,
|
|
572
|
+
unifications: [],
|
|
573
|
+
subgoals: [],
|
|
574
|
+
note: retriedStep ? `Retrying Step ${retriedStep}` : undefined,
|
|
575
|
+
};
|
|
576
|
+
this.steps.push(step);
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* Process FAIL event
|
|
580
|
+
*/
|
|
581
|
+
processFail(event) {
|
|
582
|
+
this.stepCounter++;
|
|
583
|
+
const stepNumber = this.stepCounter;
|
|
584
|
+
// Find parent step
|
|
585
|
+
const parentLevel = event.level - 1;
|
|
586
|
+
const parentStep = this.callStack.get(parentLevel);
|
|
587
|
+
const step = {
|
|
588
|
+
stepNumber,
|
|
589
|
+
port: 'fail',
|
|
590
|
+
level: event.level,
|
|
591
|
+
goal: event.goal,
|
|
592
|
+
unifications: [],
|
|
593
|
+
subgoals: [],
|
|
594
|
+
note: parentStep ? `Returns to Step ${parentStep}` : undefined,
|
|
595
|
+
};
|
|
596
|
+
// Remove from call stack
|
|
597
|
+
this.callStack.delete(event.level);
|
|
598
|
+
this.steps.push(step);
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
//# sourceMappingURL=timeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline.js","sourceRoot":"","sources":["../src/timeline.ts"],"names":[],"mappings":"AAAA;;GAEG;AA8CH;;GAEG;AACH,MAAM,OAAO,eAAe;IAQN;IAA8B;IAP1C,KAAK,GAAmB,EAAE,CAAC;IAC3B,WAAW,GAAG,CAAC,CAAC;IAChB,SAAS,GAAwB,IAAI,GAAG,EAAE,CAAC,CAAC,uBAAuB;IACnE,UAAU,GAA8D,IAAI,GAAG,EAAE,CAAC,CAAC,wBAAwB;IAC3G,cAAc,GAAwD,IAAI,GAAG,EAAE,CAA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I;YAChB,YAAY,EAAE,EAAE;YAChB,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,mBAAmB,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS;SAC/D,CAAC;QAEF,yBAAyB;QACzB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAEnC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tree Formatter - Generates Mermaid diagram from tree structure
|
|
3
|
+
*/
|
|
4
|
+
import { TreeNode } from './tree.js';
|
|
5
|
+
/**
|
|
6
|
+
* Format tree as Mermaid diagram
|
|
7
|
+
*/
|
|
8
|
+
export declare function formatTreeAsMermaid(root: TreeNode | null): string;
|
|
9
|
+
/**
|
|
10
|
+
* Handle backtracking visualization in tree
|
|
11
|
+
*/
|
|
12
|
+
export declare function markBacktrackingPaths(root: TreeNode): void;
|
|
13
|
+
//# sourceMappingURL=tree-formatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-formatter.d.ts","sourceRoot":"","sources":["../src/tree-formatter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,GAAG,MAAM,CA+BjE;AA2GD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAe1D"}
|