@dxos/datalog 0.14.0 → 0.15.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/dist/lib/Ast.mjs CHANGED
@@ -1,72 +1 @@
1
- import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
- //#region src/Ast.ts
3
- var Ast_exports = /* @__PURE__ */ __exportAll({
4
- atom: () => atom,
5
- constant: () => constant,
6
- format: () => format,
7
- formatAtom: () => formatAtom,
8
- formatLiteral: () => formatLiteral,
9
- formatRule: () => formatRule,
10
- formatTerm: () => formatTerm,
11
- formatValue: () => formatValue,
12
- literalVariables: () => literalVariables,
13
- variable: () => variable,
14
- variablesOf: () => variablesOf
15
- });
16
- /** Creates a variable term. */
17
- var variable = (name) => ({
18
- type: "variable",
19
- name
20
- });
21
- /** Creates a constant term. */
22
- var constant = (value) => ({
23
- type: "constant",
24
- value
25
- });
26
- /** Creates an atom. */
27
- var atom = (predicate, terms) => ({
28
- predicate,
29
- terms
30
- });
31
- /** Named (non-anonymous) variables of a term list, in order of first occurrence. */
32
- var variablesOf = (terms) => {
33
- const names = [];
34
- for (const term of terms) if (term.type === "variable" && !term.anonymous && !names.includes(term.name)) names.push(term.name);
35
- return names;
36
- };
37
- /** Named variables a literal mentions, including those inside an aggregate body. */
38
- var literalVariables = (literal) => {
39
- switch (literal.type) {
40
- case "atom": return variablesOf(literal.atom.terms);
41
- case "comparison": return variablesOf([literal.left, literal.right]);
42
- case "aggregate": {
43
- const terms = [literal.result, ...literal.target ? [literal.target] : []];
44
- return [.../* @__PURE__ */ new Set([...variablesOf(terms), ...literal.body.flatMap(literalVariables)])];
45
- }
46
- }
47
- };
48
- /** Formats a value as dialect source. */
49
- var formatValue = (value) => typeof value === "number" ? String(value) : /^[a-z][A-Za-z0-9_]*$/.test(value) ? value : JSON.stringify(value);
50
- /** Formats a term as dialect source. */
51
- var formatTerm = (term) => term.type === "constant" ? formatValue(term.value) : term.anonymous ? "_" : term.name;
52
- /** Formats an atom as dialect source. */
53
- var formatAtom = (atom) => atom.terms.length === 0 ? atom.predicate : `${atom.predicate}(${atom.terms.map(formatTerm).join(", ")})`;
54
- /** Formats a literal as dialect source. */
55
- var formatLiteral = (literal) => {
56
- switch (literal.type) {
57
- case "atom": return `${literal.negated ? "not " : ""}${formatAtom(literal.atom)}`;
58
- case "comparison": return `${formatTerm(literal.left)} ${literal.operator} ${formatTerm(literal.right)}`;
59
- case "aggregate": {
60
- const target = literal.target ? ` ${formatTerm(literal.target)}` : "";
61
- return `${formatTerm(literal.result)} = ${literal.function}${target} : { ${literal.body.map(formatLiteral).join(", ")} }`;
62
- }
63
- }
64
- };
65
- /** Formats a rule as dialect source. */
66
- var formatRule = (rule) => rule.body.length === 0 ? `${formatAtom(rule.head)}.` : `${formatAtom(rule.head)} :- ${rule.body.map(formatLiteral).join(", ")}.`;
67
- /** Formats a program as dialect source, one rule per line. */
68
- var format = (program) => program.rules.map(formatRule).join("\n");
69
- //#endregion
70
- export { atom, constant, format, formatAtom, formatLiteral, formatRule, formatTerm, formatValue, literalVariables, Ast_exports as t, variable, variablesOf };
71
-
72
- //# sourceMappingURL=Ast.mjs.map
1
+ export { n as atom, r as constant, i as format, a as formatAtom, o as formatLiteral, s as formatRule, c as formatTerm, l as formatValue, u as literalVariables, d as variable, f as variablesOf } from "./chunk-Ast.mjs";
@@ -1,37 +1 @@
1
- import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
- //#region src/Builtin.ts
3
- var Builtin_exports = /* @__PURE__ */ __exportAll({
4
- acceptsBinding: () => acceptsBinding,
5
- make: () => make,
6
- predicate: () => predicate,
7
- registry: () => registry
8
- });
9
- /** Defines a built-in. */
10
- var make = (builtin) => builtin;
11
- /** Defines a test-only built-in: holds iff `test` returns true for its fully bound arguments. */
12
- var predicate = (name, arity, test, options = {}) => ({
13
- name,
14
- arity,
15
- modes: ["b".repeat(arity)],
16
- volatile: options.volatile,
17
- evaluate: (args) => {
18
- const bound = args.filter((arg) => arg !== void 0);
19
- return bound.length === arity && test(bound) ? [bound] : [];
20
- }
21
- });
22
- /** Builds a registry, rejecting duplicate names. */
23
- var registry = (...builtins) => {
24
- const entries = /* @__PURE__ */ new Map();
25
- for (const builtin of builtins) {
26
- if (entries.has(builtin.name)) throw new Error(`Duplicate built-in: ${builtin.name}`);
27
- if (builtin.modes.some((mode) => mode.length !== builtin.arity || /[^bf]/.test(mode))) throw new Error(`Invalid mode for built-in ${builtin.name}/${builtin.arity}`);
28
- entries.set(builtin.name, builtin);
29
- }
30
- return entries;
31
- };
32
- /** True if `builtin` can be called with exactly the `bound` argument positions bound. */
33
- var acceptsBinding = (builtin, bound) => bound.every(Boolean) || builtin.modes.some((mode) => [...mode].every((flag, index) => flag === "f" || bound[index]));
34
- //#endregion
35
- export { acceptsBinding, make, predicate, registry, Builtin_exports as t };
36
-
37
- //# sourceMappingURL=Builtin.mjs.map
1
+ export { n as acceptsBinding, r as make, i as predicate, a as registry } from "./chunk-Builtin.mjs";
@@ -1,3 +1,2 @@
1
- import "./Ast.mjs";
2
- import { i as formatDiagnostic, r as check, t as CheckError } from "./chunk-Checker.mjs";
3
- export { CheckError, check, formatDiagnostic };
1
+ import "./chunk-Ast.mjs";
2
+ export { t as CheckError, r as check, i as formatDiagnostic } from "./chunk-Checker.mjs";
@@ -1,3 +1,2 @@
1
- import "./Ast.mjs";
2
- import { r as make, t as Engine } from "./chunk-Engine.mjs";
3
- export { Engine, make };
1
+ import "./chunk-Ast.mjs";
2
+ export { t as Engine, r as make } from "./chunk-Engine.mjs";
@@ -1,2 +1 @@
1
- import { r as parse, t as ParseError } from "./chunk-Parser.mjs";
2
- export { ParseError, parse };
1
+ export { t as ParseError, r as parse } from "./chunk-Parser.mjs";
@@ -0,0 +1,72 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ //#region src/Ast.ts
3
+ var Ast_exports = /* @__PURE__ */ __exportAll({
4
+ atom: () => atom,
5
+ constant: () => constant,
6
+ format: () => format,
7
+ formatAtom: () => formatAtom,
8
+ formatLiteral: () => formatLiteral,
9
+ formatRule: () => formatRule,
10
+ formatTerm: () => formatTerm,
11
+ formatValue: () => formatValue,
12
+ literalVariables: () => literalVariables,
13
+ variable: () => variable,
14
+ variablesOf: () => variablesOf
15
+ });
16
+ /** Creates a variable term. */
17
+ var variable = (name) => ({
18
+ type: "variable",
19
+ name
20
+ });
21
+ /** Creates a constant term. */
22
+ var constant = (value) => ({
23
+ type: "constant",
24
+ value
25
+ });
26
+ /** Creates an atom. */
27
+ var atom = (predicate, terms) => ({
28
+ predicate,
29
+ terms
30
+ });
31
+ /** Named (non-anonymous) variables of a term list, in order of first occurrence. */
32
+ var variablesOf = (terms) => {
33
+ const names = [];
34
+ for (const term of terms) if (term.type === "variable" && !term.anonymous && !names.includes(term.name)) names.push(term.name);
35
+ return names;
36
+ };
37
+ /** Named variables a literal mentions, including those inside an aggregate body. */
38
+ var literalVariables = (literal) => {
39
+ switch (literal.type) {
40
+ case "atom": return variablesOf(literal.atom.terms);
41
+ case "comparison": return variablesOf([literal.left, literal.right]);
42
+ case "aggregate": {
43
+ const terms = [literal.result, ...literal.target ? [literal.target] : []];
44
+ return [.../* @__PURE__ */ new Set([...variablesOf(terms), ...literal.body.flatMap(literalVariables)])];
45
+ }
46
+ }
47
+ };
48
+ /** Formats a value as dialect source. */
49
+ var formatValue = (value) => typeof value === "number" ? String(value) : /^[a-z][A-Za-z0-9_]*$/.test(value) ? value : JSON.stringify(value);
50
+ /** Formats a term as dialect source. */
51
+ var formatTerm = (term) => term.type === "constant" ? formatValue(term.value) : term.anonymous ? "_" : term.name;
52
+ /** Formats an atom as dialect source. */
53
+ var formatAtom = (atom) => atom.terms.length === 0 ? atom.predicate : `${atom.predicate}(${atom.terms.map(formatTerm).join(", ")})`;
54
+ /** Formats a literal as dialect source. */
55
+ var formatLiteral = (literal) => {
56
+ switch (literal.type) {
57
+ case "atom": return `${literal.negated ? "not " : ""}${formatAtom(literal.atom)}`;
58
+ case "comparison": return `${formatTerm(literal.left)} ${literal.operator} ${formatTerm(literal.right)}`;
59
+ case "aggregate": {
60
+ const target = literal.target ? ` ${formatTerm(literal.target)}` : "";
61
+ return `${formatTerm(literal.result)} = ${literal.function}${target} : { ${literal.body.map(formatLiteral).join(", ")} }`;
62
+ }
63
+ }
64
+ };
65
+ /** Formats a rule as dialect source. */
66
+ var formatRule = (rule) => rule.body.length === 0 ? `${formatAtom(rule.head)}.` : `${formatAtom(rule.head)} :- ${rule.body.map(formatLiteral).join(", ")}.`;
67
+ /** Formats a program as dialect source, one rule per line. */
68
+ var format = (program) => program.rules.map(formatRule).join("\n");
69
+ //#endregion
70
+ export { formatAtom as a, formatTerm as c, variable as d, variablesOf as f, format as i, formatValue as l, atom as n, formatLiteral as o, constant as r, formatRule as s, Ast_exports as t, literalVariables as u };
71
+
72
+ //# sourceMappingURL=chunk-Ast.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-Ast.mjs","names":[],"sources":["../../src/Ast.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\n/** A ground value; symbols (`dima`) and strings (`\"dima\"`) are the same value. */\nexport type Value = string | number;\n\n/** A ground row of a relation. */\nexport type Tuple = ReadonlyArray<Value>;\n\n/** Source location (1-based line and column). */\nexport type Position = { readonly line: number; readonly column: number };\n\nexport type Variable = {\n readonly type: 'variable';\n readonly name: string;\n /** Set for `_`; each occurrence is a distinct, never-joined variable. */\n readonly anonymous?: boolean;\n};\n\nexport type Constant = { readonly type: 'constant'; readonly value: Value };\n\nexport type Term = Variable | Constant;\n\nexport type Atom = { readonly predicate: string; readonly terms: ReadonlyArray<Term> };\n\nexport type ComparisonOperator = '=' | '!=' | '<' | '<=' | '>' | '>=';\n\nexport type AggregateFunction = 'count' | 'min' | 'max' | 'sum';\n\nexport type AtomLiteral = {\n readonly type: 'atom';\n readonly atom: Atom;\n readonly negated: boolean;\n readonly position?: Position;\n};\n\nexport type ComparisonLiteral = {\n readonly type: 'comparison';\n readonly operator: ComparisonOperator;\n readonly left: Term;\n readonly right: Term;\n readonly position?: Position;\n};\n\n/** `Result = fn Target : { body }`; `Target` is absent for `count`. */\nexport type AggregateLiteral = {\n readonly type: 'aggregate';\n readonly function: AggregateFunction;\n readonly result: Term;\n readonly target?: Term;\n readonly body: ReadonlyArray<Literal>;\n readonly position?: Position;\n};\n\nexport type Literal = AtomLiteral | ComparisonLiteral | AggregateLiteral;\n\n/** A rule; a fact is a rule with an empty body. */\nexport type Rule = {\n readonly head: Atom;\n readonly body: ReadonlyArray<Literal>;\n readonly position?: Position;\n};\n\nexport type Program = { readonly rules: ReadonlyArray<Rule> };\n\n/** Creates a variable term. */\nexport const variable = (name: string): Variable => ({ type: 'variable', name });\n\n/** Creates a constant term. */\nexport const constant = (value: Value): Constant => ({ type: 'constant', value });\n\n/** Creates an atom. */\nexport const atom = (predicate: string, terms: ReadonlyArray<Term>): Atom => ({ predicate, terms });\n\n/** Named (non-anonymous) variables of a term list, in order of first occurrence. */\nexport const variablesOf = (terms: ReadonlyArray<Term>): string[] => {\n const names: string[] = [];\n for (const term of terms) {\n if (term.type === 'variable' && !term.anonymous && !names.includes(term.name)) {\n names.push(term.name);\n }\n }\n return names;\n};\n\n/** Named variables a literal mentions, including those inside an aggregate body. */\nexport const literalVariables = (literal: Literal): string[] => {\n switch (literal.type) {\n case 'atom':\n return variablesOf(literal.atom.terms);\n case 'comparison':\n return variablesOf([literal.left, literal.right]);\n case 'aggregate': {\n const terms = [literal.result, ...(literal.target ? [literal.target] : [])];\n return [...new Set([...variablesOf(terms), ...literal.body.flatMap(literalVariables)])];\n }\n }\n};\n\n/** Formats a value as dialect source. */\nexport const formatValue = (value: Value): string =>\n typeof value === 'number' ? String(value) : /^[a-z][A-Za-z0-9_]*$/.test(value) ? value : JSON.stringify(value);\n\n/** Formats a term as dialect source. */\nexport const formatTerm = (term: Term): string =>\n term.type === 'constant' ? formatValue(term.value) : term.anonymous ? '_' : term.name;\n\n/** Formats an atom as dialect source. */\nexport const formatAtom = (atom: Atom): string =>\n atom.terms.length === 0 ? atom.predicate : `${atom.predicate}(${atom.terms.map(formatTerm).join(', ')})`;\n\n/** Formats a literal as dialect source. */\nexport const formatLiteral = (literal: Literal): string => {\n switch (literal.type) {\n case 'atom':\n return `${literal.negated ? 'not ' : ''}${formatAtom(literal.atom)}`;\n case 'comparison':\n return `${formatTerm(literal.left)} ${literal.operator} ${formatTerm(literal.right)}`;\n case 'aggregate': {\n const target = literal.target ? ` ${formatTerm(literal.target)}` : '';\n return `${formatTerm(literal.result)} = ${literal.function}${target} : { ${literal.body.map(formatLiteral).join(', ')} }`;\n }\n }\n};\n\n/** Formats a rule as dialect source. */\nexport const formatRule = (rule: Rule): string =>\n rule.body.length === 0\n ? `${formatAtom(rule.head)}.`\n : `${formatAtom(rule.head)} :- ${rule.body.map(formatLiteral).join(', ')}.`;\n\n/** Formats a program as dialect source, one rule per line. */\nexport const format = (program: Program): string => program.rules.map(formatRule).join('\\n');\n"],"mappings":";;;;;;;;;;;;;;;;AAqEA,IAAa,YAAY,UAA4B;CAAE,MAAM;CAAY;AAAK;;AAG9E,IAAa,YAAY,WAA4B;CAAE,MAAM;CAAY;AAAM;;AAG/E,IAAa,QAAQ,WAAmB,WAAsC;CAAE;CAAW;AAAM;;AAGjG,IAAa,eAAe,UAAyC;CACnE,MAAM,QAAkB,CAAC;CACzB,KAAK,MAAM,QAAQ,OACjB,IAAI,KAAK,SAAS,cAAc,CAAC,KAAK,aAAa,CAAC,MAAM,SAAS,KAAK,IAAI,GAC1E,MAAM,KAAK,KAAK,IAAI;CAGxB,OAAO;AACT;;AAGA,IAAa,oBAAoB,YAA+B;CAC9D,QAAQ,QAAQ,MAAhB;EACE,KAAK,QACH,OAAO,YAAY,QAAQ,KAAK,KAAK;EACvC,KAAK,cACH,OAAO,YAAY,CAAC,QAAQ,MAAM,QAAQ,KAAK,CAAC;EAClD,KAAK,aAAa;GAChB,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,QAAQ,MAAM,IAAI,UAAU,CAAC,CAAC,KAAK,IAAI"}
@@ -0,0 +1,37 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ //#region src/Builtin.ts
3
+ var Builtin_exports = /* @__PURE__ */ __exportAll({
4
+ acceptsBinding: () => acceptsBinding,
5
+ make: () => make,
6
+ predicate: () => predicate,
7
+ registry: () => registry
8
+ });
9
+ /** Defines a built-in. */
10
+ var make = (builtin) => builtin;
11
+ /** Defines a test-only built-in: holds iff `test` returns true for its fully bound arguments. */
12
+ var predicate = (name, arity, test, options = {}) => ({
13
+ name,
14
+ arity,
15
+ modes: ["b".repeat(arity)],
16
+ volatile: options.volatile,
17
+ evaluate: (args) => {
18
+ const bound = args.filter((arg) => arg !== void 0);
19
+ return bound.length === arity && test(bound) ? [bound] : [];
20
+ }
21
+ });
22
+ /** Builds a registry, rejecting duplicate names. */
23
+ var registry = (...builtins) => {
24
+ const entries = /* @__PURE__ */ new Map();
25
+ for (const builtin of builtins) {
26
+ if (entries.has(builtin.name)) throw new Error(`Duplicate built-in: ${builtin.name}`);
27
+ if (builtin.modes.some((mode) => mode.length !== builtin.arity || /[^bf]/.test(mode))) throw new Error(`Invalid mode for built-in ${builtin.name}/${builtin.arity}`);
28
+ entries.set(builtin.name, builtin);
29
+ }
30
+ return entries;
31
+ };
32
+ /** True if `builtin` can be called with exactly the `bound` argument positions bound. */
33
+ var acceptsBinding = (builtin, bound) => bound.every(Boolean) || builtin.modes.some((mode) => [...mode].every((flag, index) => flag === "f" || bound[index]));
34
+ //#endregion
35
+ export { registry as a, predicate as i, acceptsBinding as n, make as r, Builtin_exports as t };
36
+
37
+ //# sourceMappingURL=chunk-Builtin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-Builtin.mjs","names":[],"sources":["../../src/Builtin.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport type * as Ast from './Ast.ts';\n\n/**\n * A binding pattern, one character per argument: `b` must be bound before the call, `f` may be\n * free and is bound by the call. `\"fb\"` lets the first argument be generated from the second.\n */\nexport type Mode = string;\n\n/** Arguments as seen by a built-in: `undefined` marks a free position of the selected mode. */\nexport type Arguments = ReadonlyArray<Ast.Value | undefined>;\n\n/** A predicate implemented in code rather than by rules. */\nexport type Builtin = {\n readonly name: string;\n readonly arity: number;\n /** Accepted binding patterns; the all-bound pattern is always accepted. */\n readonly modes: ReadonlyArray<Mode>;\n /**\n * Set when the result can change with no change to the facts (a clock), so the engine\n * re-evaluates the rules that use it on `refresh`.\n */\n readonly volatile?: boolean;\n /** Returns every full argument tuple that holds and agrees with the bound arguments. */\n readonly evaluate: (args: Arguments) => Iterable<Ast.Tuple>;\n};\n\n/** Built-ins by name. */\nexport type Registry = ReadonlyMap<string, Builtin>;\n\n/** Defines a built-in. */\nexport const make = (builtin: Builtin): Builtin => builtin;\n\n/** Defines a test-only built-in: holds iff `test` returns true for its fully bound arguments. */\nexport const predicate = (\n name: string,\n arity: number,\n test: (args: Ast.Tuple) => boolean,\n options: { volatile?: boolean } = {},\n): Builtin => ({\n name,\n arity,\n modes: ['b'.repeat(arity)],\n volatile: options.volatile,\n evaluate: (args) => {\n const bound = args.filter((arg): arg is Ast.Value => arg !== undefined);\n return bound.length === arity && test(bound) ? [bound] : [];\n },\n});\n\n/** Builds a registry, rejecting duplicate names. */\nexport const registry = (...builtins: ReadonlyArray<Builtin>): Registry => {\n const entries = new Map<string, Builtin>();\n for (const builtin of builtins) {\n if (entries.has(builtin.name)) {\n throw new Error(`Duplicate built-in: ${builtin.name}`);\n }\n if (builtin.modes.some((mode) => mode.length !== builtin.arity || /[^bf]/.test(mode))) {\n throw new Error(`Invalid mode for built-in ${builtin.name}/${builtin.arity}`);\n }\n entries.set(builtin.name, builtin);\n }\n return entries;\n};\n\n/** True if `builtin` can be called with exactly the `bound` argument positions bound. */\nexport const acceptsBinding = (builtin: Builtin, bound: ReadonlyArray<boolean>): boolean =>\n bound.every(Boolean) || builtin.modes.some((mode) => [...mode].every((flag, index) => flag === 'f' || bound[index]));\n"],"mappings":";;;;;;;;;AAoCA,IAAa,QAAQ,YAA8B;;AAGnD,IAAa,aACX,MACA,OACA,MACA,UAAkC,CAAC,OACtB;CACb;CACA;CACA,OAAO,CAAC,IAAI,OAAO,KAAK,CAAC;CACzB,UAAU,QAAQ;CAClB,WAAW,SAAS;EAClB,MAAM,QAAQ,KAAK,QAAQ,QAA0B,QAAQ,KAAA,CAAS;EACtE,OAAO,MAAM,WAAW,SAAS,KAAK,KAAK,IAAI,CAAC,KAAK,IAAI,CAAC;CAC5D;AACF;;AAGA,IAAa,YAAY,GAAG,aAA+C;CACzE,MAAM,0BAAU,IAAI,IAAqB;CACzC,KAAK,MAAM,WAAW,UAAU;EAC9B,IAAI,QAAQ,IAAI,QAAQ,IAAI,GAC1B,MAAM,IAAI,MAAM,uBAAuB,QAAQ,MAAM;EAEvD,IAAI,QAAQ,MAAM,MAAM,SAAS,KAAK,WAAW,QAAQ,SAAS,QAAQ,KAAK,IAAI,CAAC,GAClF,MAAM,IAAI,MAAM,6BAA6B,QAAQ,KAAK,GAAG,QAAQ,OAAO;EAE9E,QAAQ,IAAI,QAAQ,MAAM,OAAO;CACnC;CACA,OAAO;AACT;;AAGA,IAAa,kBAAkB,SAAkB,UAC/C,MAAM,MAAM,OAAO,KAAK,QAAQ,MAAM,MAAM,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,MAAM,UAAU,SAAS,OAAO,MAAM,MAAM,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
- import { formatRule, variablesOf } from "./Ast.mjs";
3
- import { acceptsBinding } from "./Builtin.mjs";
2
+ import { f as variablesOf, s as formatRule } from "./chunk-Ast.mjs";
3
+ import { n as acceptsBinding } from "./chunk-Builtin.mjs";
4
4
  import { BaseError } from "@dxos/errors";
5
5
  //#region src/internal/plan.ts
6
6
  /** Assigns a slot per named variable of a rule. */
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-Checker.mjs","names":[],"sources":["../../src/internal/plan.ts","../../src/internal/stratify.ts","../../src/Checker.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport type * as Ast from '../Ast.ts';\nimport * as Builtin from '../Builtin.ts';\n\n/** A term resolved against a rule's variable slots; `wild` is an anonymous variable. */\nexport type Ref =\n | { readonly kind: 'const'; readonly value: Ast.Value }\n | { readonly kind: 'slot'; readonly slot: number }\n | { readonly kind: 'wild' };\n\nexport type ScanStep = {\n readonly kind: 'scan';\n readonly literal: number;\n readonly relation: string;\n /** Columns whose value is known before the scan, with the value source. */\n readonly bound: ReadonlyArray<{ readonly column: number; readonly ref: Ref }>;\n /** Columns that bind a slot, or check it when the variable repeats within the atom. */\n readonly binds: ReadonlyArray<{ readonly column: number; readonly slot: number }>;\n};\n\nexport type NegationStep = {\n readonly kind: 'negation';\n readonly relation: string;\n readonly bound: ReadonlyArray<{ readonly column: number; readonly ref: Ref }>;\n};\n\nexport type CompareStep = {\n readonly kind: 'compare';\n readonly operator: Ast.ComparisonOperator;\n readonly left: Ref;\n readonly right: Ref;\n /** Set for `X = term` with `X` unbound: assigns instead of comparing. */\n readonly assign?: { readonly slot: number; readonly from: Ref };\n};\n\nexport type BuiltinStep = {\n readonly kind: 'builtin';\n readonly builtin: Builtin.Builtin;\n readonly args: ReadonlyArray<Ref>;\n /** Arguments unbound at call time, passed as `undefined` and bound from the results. */\n readonly free: ReadonlyArray<boolean>;\n readonly negated: boolean;\n};\n\nexport type AggregateStep = {\n readonly kind: 'aggregate';\n readonly function: Ast.AggregateFunction;\n readonly steps: ReadonlyArray<Step>;\n /** Slots local to the aggregate body; distinct assignments of these are aggregated. */\n readonly local: ReadonlyArray<number>;\n readonly target?: Ref;\n readonly result: Ref;\n readonly assignResult: boolean;\n};\n\nexport type Step = ScanStep | NegationStep | CompareStep | BuiltinStep | AggregateStep;\n\nexport type Unresolved = { readonly literal: number; readonly reason: string };\n\nexport type Plan = {\n readonly steps: ReadonlyArray<Step>;\n readonly unresolved: ReadonlyArray<Unresolved>;\n readonly bound: ReadonlySet<string>;\n};\n\n/** Assigns a slot per named variable of a rule. */\nexport class Slots {\n readonly #slots = new Map<string, number>();\n\n get size(): number {\n return this.#slots.size;\n }\n\n slot(name: string): number {\n let slot = this.#slots.get(name);\n if (slot === undefined) {\n slot = this.#slots.size;\n this.#slots.set(name, slot);\n }\n return slot;\n }\n\n ref(term: Ast.Term): Ref {\n if (term.type === 'constant') {\n return { kind: 'const', value: term.value };\n }\n return term.anonymous ? { kind: 'wild' } : { kind: 'slot', slot: this.slot(term.name) };\n }\n}\n\nconst isBound = (term: Ast.Term, bound: ReadonlySet<string>) =>\n term.type === 'constant' || (!term.anonymous && bound.has(term.name));\n\nconst unboundNames = (terms: ReadonlyArray<Ast.Term>, bound: ReadonlySet<string>) =>\n terms.flatMap((term) => (term.type === 'variable' && !term.anonymous && !bound.has(term.name) ? [term.name] : []));\n\nconst variableNames = (literal: Ast.Literal): string[] => {\n switch (literal.type) {\n case 'atom':\n return literal.atom.terms.flatMap((term) => (term.type === 'variable' && !term.anonymous ? [term.name] : []));\n case 'comparison':\n return [literal.left, literal.right].flatMap((term) =>\n term.type === 'variable' && !term.anonymous ? [term.name] : [],\n );\n case 'aggregate':\n return [\n ...[literal.result, ...(literal.target ? [literal.target] : [])].flatMap((term) =>\n term.type === 'variable' && !term.anonymous ? [term.name] : [],\n ),\n ...literal.body.flatMap(variableNames),\n ];\n }\n};\n\n/**\n * Orders a rule body so every literal runs once its inputs are bound: filters as early as\n * possible, then the relation scan with the most bound columns, then generating built-ins.\n * @param outer Variables used outside the body (the head, or the enclosing rule of an aggregate).\n * @param first Literal to scan first (the semi-naive delta).\n */\nexport const planBody = (options: {\n body: ReadonlyArray<Ast.Literal>;\n builtins: Builtin.Registry;\n slots: Slots;\n outer: ReadonlySet<string>;\n bound?: ReadonlySet<string>;\n first?: number;\n}): Plan => {\n const { body, builtins, slots, outer, first } = options;\n const bound = new Set(options.bound ?? []);\n const steps: Step[] = [];\n const remaining = new Set(body.keys());\n const unresolved: Unresolved[] = [];\n\n const scan = (index: number, literal: Ast.AtomLiteral) => {\n const boundColumns: { column: number; ref: Ref }[] = [];\n const binds: { column: number; slot: number }[] = [];\n literal.atom.terms.forEach((term, column) => {\n if (isBound(term, bound)) {\n boundColumns.push({ column, ref: slots.ref(term) });\n } else if (term.type === 'variable' && !term.anonymous) {\n binds.push({ column, slot: slots.slot(term.name) });\n }\n });\n for (const name of unboundNames(literal.atom.terms, bound)) {\n bound.add(name);\n }\n steps.push({ kind: 'scan', literal: index, relation: literal.atom.predicate, bound: boundColumns, binds });\n };\n\n /** Variables any other literal or the outer scope uses, which an aggregate must correlate on. */\n const correlated = (index: number, literal: Ast.AggregateLiteral): string[] => {\n const elsewhere = new Set([...outer, ...body.flatMap((other, at) => (at === index ? [] : variableNames(other)))]);\n const inner = new Set(literal.body.flatMap(variableNames));\n return [...inner].filter((name) => elsewhere.has(name));\n };\n\n /** Schedules `index` if it is a filter (or, with `generate`, a generator) whose inputs are bound. */\n const trySchedule = (index: number, generate: boolean): boolean => {\n const literal = body[index];\n switch (literal.type) {\n case 'atom': {\n const builtin = builtins.get(literal.atom.predicate);\n if (!builtin) {\n if (!literal.negated) {\n return false;\n }\n if (unboundNames(literal.atom.terms, bound).length > 0) {\n return false;\n }\n steps.push({\n kind: 'negation',\n relation: literal.atom.predicate,\n bound: literal.atom.terms.flatMap((term, column) =>\n term.type === 'variable' && term.anonymous ? [] : [{ column, ref: slots.ref(term) }],\n ),\n });\n return true;\n }\n const boundArgs = literal.atom.terms.map((term) => isBound(term, bound));\n const allBound = boundArgs.every(Boolean);\n if (!allBound && (!generate || literal.negated || !Builtin.acceptsBinding(builtin, boundArgs))) {\n return false;\n }\n steps.push({\n kind: 'builtin',\n builtin,\n args: literal.atom.terms.map((term) => slots.ref(term)),\n free: boundArgs.map((value) => !value),\n negated: literal.negated,\n });\n for (const name of unboundNames(literal.atom.terms, bound)) {\n bound.add(name);\n }\n return true;\n }\n case 'comparison': {\n const left = isBound(literal.left, bound);\n const right = isBound(literal.right, bound);\n if (left && right) {\n steps.push({\n kind: 'compare',\n operator: literal.operator,\n left: slots.ref(literal.left),\n right: slots.ref(literal.right),\n });\n return true;\n }\n if (!generate || literal.operator !== '=' || left === right) {\n return false;\n }\n const [target, source] = left ? [literal.right, literal.left] : [literal.left, literal.right];\n if (target.type !== 'variable' || target.anonymous) {\n return false;\n }\n steps.push({\n kind: 'compare',\n operator: '=',\n left: slots.ref(literal.left),\n right: slots.ref(literal.right),\n assign: { slot: slots.slot(target.name), from: slots.ref(source) },\n });\n bound.add(target.name);\n return true;\n }\n case 'aggregate': {\n const correlation = correlated(index, literal);\n if (correlation.some((name) => !bound.has(name))) {\n return false;\n }\n const resultBound = isBound(literal.result, bound);\n if (!resultBound && !generate) {\n return false;\n }\n const inner = planBody({\n body: literal.body,\n builtins,\n slots,\n outer: new Set(correlation),\n bound: new Set(correlation),\n });\n if (inner.unresolved.length > 0) {\n unresolved.push(...inner.unresolved.map(({ reason }) => ({ literal: index, reason })));\n return true;\n }\n if (literal.target && !isBound(literal.target, inner.bound)) {\n unresolved.push({ literal: index, reason: `aggregate target is not bound by the aggregate body` });\n return true;\n }\n const local = [...inner.bound].filter((name) => !correlation.includes(name)).map((name) => slots.slot(name));\n steps.push({\n kind: 'aggregate',\n function: literal.function,\n steps: inner.steps,\n local,\n target: literal.target ? slots.ref(literal.target) : undefined,\n result: slots.ref(literal.result),\n assignResult: !resultBound,\n });\n if (literal.result.type === 'variable' && !literal.result.anonymous) {\n bound.add(literal.result.name);\n }\n return true;\n }\n }\n };\n\n if (first !== undefined) {\n const literal = body[first];\n if (literal.type === 'atom' && !literal.negated && !builtins.has(literal.atom.predicate)) {\n remaining.delete(first);\n scan(first, literal);\n }\n }\n\n while (remaining.size > 0) {\n let progressed = false;\n for (const index of remaining) {\n if (trySchedule(index, false)) {\n remaining.delete(index);\n progressed = true;\n }\n }\n if (progressed) {\n continue;\n }\n\n let best: number | undefined;\n let bestBound = -1;\n for (const index of remaining) {\n const literal = body[index];\n if (literal.type === 'atom' && !literal.negated && !builtins.has(literal.atom.predicate)) {\n const boundCount = literal.atom.terms.filter((term) => isBound(term, bound)).length;\n if (boundCount > bestBound) {\n best = index;\n bestBound = boundCount;\n }\n }\n }\n if (best !== undefined) {\n const literal = body[best];\n if (literal.type === 'atom') {\n remaining.delete(best);\n scan(best, literal);\n }\n continue;\n }\n\n for (const index of remaining) {\n if (trySchedule(index, true)) {\n remaining.delete(index);\n progressed = true;\n break;\n }\n }\n if (!progressed) {\n break;\n }\n }\n\n for (const index of remaining) {\n unresolved.push({ literal: index, reason: describeUnresolved(body[index], bound, builtins) });\n }\n return { steps, unresolved, bound };\n};\n\nconst describeUnresolved = (literal: Ast.Literal, bound: ReadonlySet<string>, builtins: Builtin.Registry): string => {\n switch (literal.type) {\n case 'atom': {\n const names = unboundNames(literal.atom.terms, bound).join(', ');\n if (builtins.has(literal.atom.predicate)) {\n return literal.negated\n ? `negated built-in ${literal.atom.predicate} needs every argument bound (${names} unbound)`\n : `no binding mode of built-in ${literal.atom.predicate}/${literal.atom.terms.length} accepts ${names} unbound`;\n }\n return `variable ${names} under negation is not bound by a positive literal`;\n }\n case 'comparison':\n return `variable ${unboundNames([literal.left, literal.right], bound).join(', ')} in comparison is not bound`;\n case 'aggregate':\n return `aggregate depends on unbound variables`;\n }\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport type * as Ast from '../Ast.ts';\nimport type * as Builtin from '../Builtin.ts';\n\nexport type Dependency = { readonly predicate: string; readonly negative: boolean };\n\nexport type Stratum = {\n /** Predicates defined by the stratum's rules (one strongly connected component). */\n readonly predicates: ReadonlySet<string>;\n /** Indexes into the program's rules. */\n readonly rules: ReadonlyArray<number>;\n readonly recursive: boolean;\n};\n\nexport type Stratification =\n | { readonly ok: true; readonly strata: ReadonlyArray<Stratum> }\n | { readonly ok: false; readonly cycles: ReadonlyArray<ReadonlyArray<string>> };\n\n/** Relations a literal reads; negation and aggregation read them non-monotonically. */\nexport const dependencies = (literal: Ast.Literal, builtins: Builtin.Registry): Dependency[] => {\n switch (literal.type) {\n case 'atom':\n return builtins.has(literal.atom.predicate)\n ? []\n : [{ predicate: literal.atom.predicate, negative: literal.negated }];\n case 'comparison':\n return [];\n case 'aggregate':\n return literal.body.flatMap((inner) =>\n dependencies(inner, builtins).map(({ predicate }) => ({ predicate, negative: true })),\n );\n }\n};\n\n/**\n * Splits rules into strata: one per strongly connected component of the predicate graph, in\n * dependency order; fails when negation or aggregation occurs inside a component.\n */\nexport const stratify = (rules: ReadonlyArray<Ast.Rule>, builtins: Builtin.Registry): Stratification => {\n const defined = new Set(rules.filter((rule) => rule.body.length > 0).map((rule) => rule.head.predicate));\n const edges = new Map<string, Dependency[]>();\n for (const predicate of defined) {\n edges.set(predicate, []);\n }\n for (const rule of rules) {\n for (const literal of rule.body) {\n for (const dependency of dependencies(literal, builtins)) {\n if (defined.has(dependency.predicate)) {\n edges.get(rule.head.predicate)?.push(dependency);\n }\n }\n }\n }\n\n // Tarjan's algorithm emits each component after every component it depends on.\n const components: string[][] = [];\n const index = new Map<string, number>();\n const lowLink = new Map<string, number>();\n const stack: string[] = [];\n const onStack = new Set<string>();\n const visit = (predicate: string) => {\n index.set(predicate, index.size);\n lowLink.set(predicate, index.get(predicate) ?? 0);\n stack.push(predicate);\n onStack.add(predicate);\n for (const { predicate: next } of edges.get(predicate) ?? []) {\n if (!index.has(next)) {\n visit(next);\n lowLink.set(predicate, Math.min(lowLink.get(predicate) ?? 0, lowLink.get(next) ?? 0));\n } else if (onStack.has(next)) {\n lowLink.set(predicate, Math.min(lowLink.get(predicate) ?? 0, index.get(next) ?? 0));\n }\n }\n if (lowLink.get(predicate) === index.get(predicate)) {\n const component: string[] = [];\n let member: string | undefined;\n do {\n member = stack.pop();\n if (member !== undefined) {\n onStack.delete(member);\n component.push(member);\n }\n } while (member !== undefined && member !== predicate);\n components.push(component);\n }\n };\n for (const predicate of defined) {\n if (!index.has(predicate)) {\n visit(predicate);\n }\n }\n\n const cycles: string[][] = [];\n const strata: Stratum[] = components.map((component) => {\n const members = new Set(component);\n const internal = component.flatMap((predicate) =>\n (edges.get(predicate) ?? []).filter((dependency) => members.has(dependency.predicate)),\n );\n if (internal.some((dependency) => dependency.negative)) {\n cycles.push(component.sort());\n }\n return {\n predicates: members,\n rules: rules.flatMap((rule, ruleIndex) =>\n rule.body.length > 0 && members.has(rule.head.predicate) ? [ruleIndex] : [],\n ),\n recursive: internal.length > 0,\n };\n });\n return cycles.length > 0 ? { ok: false, cycles } : { ok: true, strata };\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { BaseError } from '@dxos/errors';\n\nimport * as Ast from './Ast.ts';\nimport type * as Builtin from './Builtin.ts';\nimport { Slots, planBody } from './internal/plan.ts';\nimport { stratify } from './internal/stratify.ts';\n\nexport type DiagnosticCode = 'arity' | 'builtin-head' | 'undefined' | 'unsafe' | 'unstratifiable';\n\n/** A static error in a program. */\nexport type Diagnostic = {\n readonly code: DiagnosticCode;\n readonly message: string;\n /** Index of the offending rule. */\n readonly rule?: number;\n readonly position?: Ast.Position;\n};\n\nexport type Options = {\n readonly builtins?: Builtin.Registry;\n /**\n * Base relations and their arities. When given, a body predicate that is neither defined by a\n * rule, declared here nor a built-in is reported as `undefined`.\n */\n readonly relations?: Readonly<Record<string, number>>;\n};\n\n/** Thrown when a program with diagnostics is evaluated. */\nexport class CheckError extends BaseError.extend('CheckError', 'Invalid program') {\n // A typed field rather than `context`, which would repeat every diagnostic in the message as JSON.\n readonly diagnostics: ReadonlyArray<Diagnostic>;\n\n constructor(diagnostics: ReadonlyArray<Diagnostic>) {\n super({ message: `Invalid program:\\n${diagnostics.map(formatDiagnostic).join('\\n')}` });\n this.diagnostics = diagnostics;\n }\n}\n\n/** Formats a diagnostic as `line:column code: message`. */\nexport const formatDiagnostic = (diagnostic: Diagnostic): string => {\n const at = diagnostic.position ? `${diagnostic.position.line}:${diagnostic.position.column} ` : '';\n return `${at}${diagnostic.code}: ${diagnostic.message}`;\n};\n\n/**\n * Checks arity consistency, built-in heads, undefined predicates, range restriction (safety) and\n * stratification; an empty result means the program can be evaluated.\n */\nexport const check = (program: Ast.Program, options: Options = {}): Diagnostic[] => {\n const builtins = options.builtins ?? new Map();\n const diagnostics: Diagnostic[] = [];\n const arities = new Map<string, number>();\n for (const builtin of builtins.values()) {\n arities.set(builtin.name, builtin.arity);\n }\n for (const [name, arity] of Object.entries(options.relations ?? {})) {\n arities.set(name, arity);\n }\n const defined = new Set(program.rules.map((rule) => rule.head.predicate));\n\n const visitAtom = (atom: Ast.Atom, rule: number, position: Ast.Position | undefined) => {\n const expected = arities.get(atom.predicate);\n if (expected === undefined) {\n arities.set(atom.predicate, atom.terms.length);\n } else if (expected !== atom.terms.length) {\n diagnostics.push({\n code: 'arity',\n message: `${atom.predicate}/${atom.terms.length} used where ${atom.predicate}/${expected} is expected`,\n rule,\n position,\n });\n }\n };\n const visitLiteral = (literal: Ast.Literal, rule: number, fallback: Ast.Position | undefined) => {\n const position = literal.position ?? fallback;\n if (literal.type === 'atom') {\n visitAtom(literal.atom, rule, position);\n const predicate = literal.atom.predicate;\n if (\n options.relations &&\n !defined.has(predicate) &&\n !builtins.has(predicate) &&\n !(predicate in options.relations)\n ) {\n diagnostics.push({\n code: 'undefined',\n message: `${predicate}/${literal.atom.terms.length} is not a relation, rule or built-in`,\n rule,\n position,\n });\n }\n } else if (literal.type === 'aggregate') {\n literal.body.forEach((inner) => visitLiteral(inner, rule, position));\n }\n };\n\n program.rules.forEach((rule, index) => {\n if (builtins.has(rule.head.predicate)) {\n diagnostics.push({\n code: 'builtin-head',\n message: `rule defines built-in ${rule.head.predicate}`,\n rule: index,\n position: rule.position,\n });\n }\n visitAtom(rule.head, index, rule.position);\n rule.body.forEach((literal) => visitLiteral(literal, index, rule.position));\n\n const head = new Set(Ast.variablesOf(rule.head.terms));\n const plan = planBody({ body: rule.body, builtins, slots: new Slots(), outer: head });\n for (const { literal, reason } of plan.unresolved) {\n diagnostics.push({\n code: 'unsafe',\n message: `${reason} in: ${Ast.formatRule(rule)}`,\n rule: index,\n position: rule.body[literal].position ?? rule.position,\n });\n }\n const unboundHead = [...head].filter((name) => !plan.bound.has(name));\n if (unboundHead.length > 0) {\n diagnostics.push({\n code: 'unsafe',\n message: `head variable ${unboundHead.join(', ')} is not bound by the body in: ${Ast.formatRule(rule)}`,\n rule: index,\n position: rule.position,\n });\n }\n if (rule.head.terms.some((term) => term.type === 'variable' && term.anonymous)) {\n diagnostics.push({\n code: 'unsafe',\n message: `anonymous variable in head of: ${Ast.formatRule(rule)}`,\n rule: index,\n position: rule.position,\n });\n }\n });\n\n const stratification = stratify(program.rules, builtins);\n if (!stratification.ok) {\n for (const cycle of stratification.cycles) {\n diagnostics.push({\n code: 'unstratifiable',\n message: `negation or aggregation through recursion among: ${cycle.join(', ')}`,\n rule: program.rules.findIndex((rule) => cycle.includes(rule.head.predicate)),\n position: program.rules.find((rule) => cycle.includes(rule.head.predicate))?.position,\n });\n }\n }\n return diagnostics;\n};\n"],"mappings":";;;;;;AAqEA,IAAa,QAAb,MAAmB;CACjB,yBAAkB,IAAI,IAAoB;CAE1C,IAAI,OAAe;EACjB,OAAO,KAAK,OAAO;CACrB;CAEA,KAAK,MAAsB;EACzB,IAAI,OAAO,KAAK,OAAO,IAAI,IAAI;EAC/B,IAAI,SAAS,KAAA,GAAW;GACtB,OAAO,KAAK,OAAO;GACnB,KAAK,OAAO,IAAI,MAAM,IAAI;EAC5B;EACA,OAAO;CACT;CAEA,IAAI,MAAqB;EACvB,IAAI,KAAK,SAAS,YAChB,OAAO;GAAE,MAAM;GAAS,OAAO,KAAK;EAAM;EAE5C,OAAO,KAAK,YAAY,EAAE,MAAM,OAAO,IAAI;GAAE,MAAM;GAAQ,MAAM,KAAK,KAAK,KAAK,IAAI;EAAE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M;GACN,UAAU,KAAK,KAAK,QAAQ,CAAC,YAAY,KAAK;EAChD,CAAC;EAEH,MAAM,cAAc,CAAC,GAAG,IAAI,CAAC,CAAC,QAAQ,SAAS,CAAC,KAAK,MAAM,IAAI,IAAI,CAAC;EACpE,IAAI,YAAY,SAAS,GACvB,YAAY,KAAK;GACf,MAAM;GACN,SAAS,iBAAiB,YAAY,KAAK,IAAI,EAAE,gCAAgC,WAAe,IAAI;GACpG,MAAM;GACN,UAAU,KAAK;EACjB,CAAC;EAEH,IAAI,KAAK,KAAK,MAAM,MAAM,SAAS,KAAK,SAAS,cAAc,KAAK,SAAS,GAC3E,YAAY,KAAK;GACf,MAAM;GACN,SAAS,kCAAkC,WAAe,IAAI;GAC9D,MAAM;GACN,UAAU,KAAK;EACjB,CAAC;CAEL,CAAC;CAED,MAAM,iBAAiB,SAAS,QAAQ,OAAO,QAAQ;CACvD,IAAI,CAAC,eAAe,IAClB,KAAK,MAAM,SAAS,eAAe,QACjC,YAAY,KAAK;EACf,MAAM;EACN,SAAS,oDAAoD,MAAM,KAAK,IAAI;EAC5E,MAAM,QAAQ,MAAM,WAAW,SAAS,MAAM,SAAS,KAAK,KAAK,SAAS,CAAC;EAC3E,UAAU,QAAQ,MAAM,MAAM,SAAS,MAAM,SAAS,KAAK,KAAK,SAAS,CAAC,CAAC,EAAE;CAC/E,CAAC;CAGL,OAAO;AACT"}
1
+ {"version":3,"file":"chunk-Checker.mjs","names":["Builtin.acceptsBinding","Ast.variablesOf","Ast.formatRule"],"sources":["../../src/internal/plan.ts","../../src/internal/stratify.ts","../../src/Checker.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport type * as Ast from '../Ast.ts';\nimport * as Builtin from '../Builtin.ts';\n\n/** A term resolved against a rule's variable slots; `wild` is an anonymous variable. */\nexport type Ref =\n | { readonly kind: 'const'; readonly value: Ast.Value }\n | { readonly kind: 'slot'; readonly slot: number }\n | { readonly kind: 'wild' };\n\nexport type ScanStep = {\n readonly kind: 'scan';\n readonly literal: number;\n readonly relation: string;\n /** Columns whose value is known before the scan, with the value source. */\n readonly bound: ReadonlyArray<{ readonly column: number; readonly ref: Ref }>;\n /** Columns that bind a slot, or check it when the variable repeats within the atom. */\n readonly binds: ReadonlyArray<{ readonly column: number; readonly slot: number }>;\n};\n\nexport type NegationStep = {\n readonly kind: 'negation';\n readonly relation: string;\n readonly bound: ReadonlyArray<{ readonly column: number; readonly ref: Ref }>;\n};\n\nexport type CompareStep = {\n readonly kind: 'compare';\n readonly operator: Ast.ComparisonOperator;\n readonly left: Ref;\n readonly right: Ref;\n /** Set for `X = term` with `X` unbound: assigns instead of comparing. */\n readonly assign?: { readonly slot: number; readonly from: Ref };\n};\n\nexport type BuiltinStep = {\n readonly kind: 'builtin';\n readonly builtin: Builtin.Builtin;\n readonly args: ReadonlyArray<Ref>;\n /** Arguments unbound at call time, passed as `undefined` and bound from the results. */\n readonly free: ReadonlyArray<boolean>;\n readonly negated: boolean;\n};\n\nexport type AggregateStep = {\n readonly kind: 'aggregate';\n readonly function: Ast.AggregateFunction;\n readonly steps: ReadonlyArray<Step>;\n /** Slots local to the aggregate body; distinct assignments of these are aggregated. */\n readonly local: ReadonlyArray<number>;\n readonly target?: Ref;\n readonly result: Ref;\n readonly assignResult: boolean;\n};\n\nexport type Step = ScanStep | NegationStep | CompareStep | BuiltinStep | AggregateStep;\n\nexport type Unresolved = { readonly literal: number; readonly reason: string };\n\nexport type Plan = {\n readonly steps: ReadonlyArray<Step>;\n readonly unresolved: ReadonlyArray<Unresolved>;\n readonly bound: ReadonlySet<string>;\n};\n\n/** Assigns a slot per named variable of a rule. */\nexport class Slots {\n readonly #slots = new Map<string, number>();\n\n get size(): number {\n return this.#slots.size;\n }\n\n slot(name: string): number {\n let slot = this.#slots.get(name);\n if (slot === undefined) {\n slot = this.#slots.size;\n this.#slots.set(name, slot);\n }\n return slot;\n }\n\n ref(term: Ast.Term): Ref {\n if (term.type === 'constant') {\n return { kind: 'const', value: term.value };\n }\n return term.anonymous ? { kind: 'wild' } : { kind: 'slot', slot: this.slot(term.name) };\n }\n}\n\nconst isBound = (term: Ast.Term, bound: ReadonlySet<string>) =>\n term.type === 'constant' || (!term.anonymous && bound.has(term.name));\n\nconst unboundNames = (terms: ReadonlyArray<Ast.Term>, bound: ReadonlySet<string>) =>\n terms.flatMap((term) => (term.type === 'variable' && !term.anonymous && !bound.has(term.name) ? [term.name] : []));\n\nconst variableNames = (literal: Ast.Literal): string[] => {\n switch (literal.type) {\n case 'atom':\n return literal.atom.terms.flatMap((term) => (term.type === 'variable' && !term.anonymous ? [term.name] : []));\n case 'comparison':\n return [literal.left, literal.right].flatMap((term) =>\n term.type === 'variable' && !term.anonymous ? [term.name] : [],\n );\n case 'aggregate':\n return [\n ...[literal.result, ...(literal.target ? [literal.target] : [])].flatMap((term) =>\n term.type === 'variable' && !term.anonymous ? [term.name] : [],\n ),\n ...literal.body.flatMap(variableNames),\n ];\n }\n};\n\n/**\n * Orders a rule body so every literal runs once its inputs are bound: filters as early as\n * possible, then the relation scan with the most bound columns, then generating built-ins.\n * @param outer Variables used outside the body (the head, or the enclosing rule of an aggregate).\n * @param first Literal to scan first (the semi-naive delta).\n */\nexport const planBody = (options: {\n body: ReadonlyArray<Ast.Literal>;\n builtins: Builtin.Registry;\n slots: Slots;\n outer: ReadonlySet<string>;\n bound?: ReadonlySet<string>;\n first?: number;\n}): Plan => {\n const { body, builtins, slots, outer, first } = options;\n const bound = new Set(options.bound ?? []);\n const steps: Step[] = [];\n const remaining = new Set(body.keys());\n const unresolved: Unresolved[] = [];\n\n const scan = (index: number, literal: Ast.AtomLiteral) => {\n const boundColumns: { column: number; ref: Ref }[] = [];\n const binds: { column: number; slot: number }[] = [];\n literal.atom.terms.forEach((term, column) => {\n if (isBound(term, bound)) {\n boundColumns.push({ column, ref: slots.ref(term) });\n } else if (term.type === 'variable' && !term.anonymous) {\n binds.push({ column, slot: slots.slot(term.name) });\n }\n });\n for (const name of unboundNames(literal.atom.terms, bound)) {\n bound.add(name);\n }\n steps.push({ kind: 'scan', literal: index, relation: literal.atom.predicate, bound: boundColumns, binds });\n };\n\n /** Variables any other literal or the outer scope uses, which an aggregate must correlate on. */\n const correlated = (index: number, literal: Ast.AggregateLiteral): string[] => {\n const elsewhere = new Set([...outer, ...body.flatMap((other, at) => (at === index ? [] : variableNames(other)))]);\n const inner = new Set(literal.body.flatMap(variableNames));\n return [...inner].filter((name) => elsewhere.has(name));\n };\n\n /** Schedules `index` if it is a filter (or, with `generate`, a generator) whose inputs are bound. */\n const trySchedule = (index: number, generate: boolean): boolean => {\n const literal = body[index];\n switch (literal.type) {\n case 'atom': {\n const builtin = builtins.get(literal.atom.predicate);\n if (!builtin) {\n if (!literal.negated) {\n return false;\n }\n if (unboundNames(literal.atom.terms, bound).length > 0) {\n return false;\n }\n steps.push({\n kind: 'negation',\n relation: literal.atom.predicate,\n bound: literal.atom.terms.flatMap((term, column) =>\n term.type === 'variable' && term.anonymous ? [] : [{ column, ref: slots.ref(term) }],\n ),\n });\n return true;\n }\n const boundArgs = literal.atom.terms.map((term) => isBound(term, bound));\n const allBound = boundArgs.every(Boolean);\n if (!allBound && (!generate || literal.negated || !Builtin.acceptsBinding(builtin, boundArgs))) {\n return false;\n }\n steps.push({\n kind: 'builtin',\n builtin,\n args: literal.atom.terms.map((term) => slots.ref(term)),\n free: boundArgs.map((value) => !value),\n negated: literal.negated,\n });\n for (const name of unboundNames(literal.atom.terms, bound)) {\n bound.add(name);\n }\n return true;\n }\n case 'comparison': {\n const left = isBound(literal.left, bound);\n const right = isBound(literal.right, bound);\n if (left && right) {\n steps.push({\n kind: 'compare',\n operator: literal.operator,\n left: slots.ref(literal.left),\n right: slots.ref(literal.right),\n });\n return true;\n }\n if (!generate || literal.operator !== '=' || left === right) {\n return false;\n }\n const [target, source] = left ? [literal.right, literal.left] : [literal.left, literal.right];\n if (target.type !== 'variable' || target.anonymous) {\n return false;\n }\n steps.push({\n kind: 'compare',\n operator: '=',\n left: slots.ref(literal.left),\n right: slots.ref(literal.right),\n assign: { slot: slots.slot(target.name), from: slots.ref(source) },\n });\n bound.add(target.name);\n return true;\n }\n case 'aggregate': {\n const correlation = correlated(index, literal);\n if (correlation.some((name) => !bound.has(name))) {\n return false;\n }\n const resultBound = isBound(literal.result, bound);\n if (!resultBound && !generate) {\n return false;\n }\n const inner = planBody({\n body: literal.body,\n builtins,\n slots,\n outer: new Set(correlation),\n bound: new Set(correlation),\n });\n if (inner.unresolved.length > 0) {\n unresolved.push(...inner.unresolved.map(({ reason }) => ({ literal: index, reason })));\n return true;\n }\n if (literal.target && !isBound(literal.target, inner.bound)) {\n unresolved.push({ literal: index, reason: `aggregate target is not bound by the aggregate body` });\n return true;\n }\n const local = [...inner.bound].filter((name) => !correlation.includes(name)).map((name) => slots.slot(name));\n steps.push({\n kind: 'aggregate',\n function: literal.function,\n steps: inner.steps,\n local,\n target: literal.target ? slots.ref(literal.target) : undefined,\n result: slots.ref(literal.result),\n assignResult: !resultBound,\n });\n if (literal.result.type === 'variable' && !literal.result.anonymous) {\n bound.add(literal.result.name);\n }\n return true;\n }\n }\n };\n\n if (first !== undefined) {\n const literal = body[first];\n if (literal.type === 'atom' && !literal.negated && !builtins.has(literal.atom.predicate)) {\n remaining.delete(first);\n scan(first, literal);\n }\n }\n\n while (remaining.size > 0) {\n let progressed = false;\n for (const index of remaining) {\n if (trySchedule(index, false)) {\n remaining.delete(index);\n progressed = true;\n }\n }\n if (progressed) {\n continue;\n }\n\n let best: number | undefined;\n let bestBound = -1;\n for (const index of remaining) {\n const literal = body[index];\n if (literal.type === 'atom' && !literal.negated && !builtins.has(literal.atom.predicate)) {\n const boundCount = literal.atom.terms.filter((term) => isBound(term, bound)).length;\n if (boundCount > bestBound) {\n best = index;\n bestBound = boundCount;\n }\n }\n }\n if (best !== undefined) {\n const literal = body[best];\n if (literal.type === 'atom') {\n remaining.delete(best);\n scan(best, literal);\n }\n continue;\n }\n\n for (const index of remaining) {\n if (trySchedule(index, true)) {\n remaining.delete(index);\n progressed = true;\n break;\n }\n }\n if (!progressed) {\n break;\n }\n }\n\n for (const index of remaining) {\n unresolved.push({ literal: index, reason: describeUnresolved(body[index], bound, builtins) });\n }\n return { steps, unresolved, bound };\n};\n\nconst describeUnresolved = (literal: Ast.Literal, bound: ReadonlySet<string>, builtins: Builtin.Registry): string => {\n switch (literal.type) {\n case 'atom': {\n const names = unboundNames(literal.atom.terms, bound).join(', ');\n if (builtins.has(literal.atom.predicate)) {\n return literal.negated\n ? `negated built-in ${literal.atom.predicate} needs every argument bound (${names} unbound)`\n : `no binding mode of built-in ${literal.atom.predicate}/${literal.atom.terms.length} accepts ${names} unbound`;\n }\n return `variable ${names} under negation is not bound by a positive literal`;\n }\n case 'comparison':\n return `variable ${unboundNames([literal.left, literal.right], bound).join(', ')} in comparison is not bound`;\n case 'aggregate':\n return `aggregate depends on unbound variables`;\n }\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport type * as Ast from '../Ast.ts';\nimport type * as Builtin from '../Builtin.ts';\n\nexport type Dependency = { readonly predicate: string; readonly negative: boolean };\n\nexport type Stratum = {\n /** Predicates defined by the stratum's rules (one strongly connected component). */\n readonly predicates: ReadonlySet<string>;\n /** Indexes into the program's rules. */\n readonly rules: ReadonlyArray<number>;\n readonly recursive: boolean;\n};\n\nexport type Stratification =\n | { readonly ok: true; readonly strata: ReadonlyArray<Stratum> }\n | { readonly ok: false; readonly cycles: ReadonlyArray<ReadonlyArray<string>> };\n\n/** Relations a literal reads; negation and aggregation read them non-monotonically. */\nexport const dependencies = (literal: Ast.Literal, builtins: Builtin.Registry): Dependency[] => {\n switch (literal.type) {\n case 'atom':\n return builtins.has(literal.atom.predicate)\n ? []\n : [{ predicate: literal.atom.predicate, negative: literal.negated }];\n case 'comparison':\n return [];\n case 'aggregate':\n return literal.body.flatMap((inner) =>\n dependencies(inner, builtins).map(({ predicate }) => ({ predicate, negative: true })),\n );\n }\n};\n\n/**\n * Splits rules into strata: one per strongly connected component of the predicate graph, in\n * dependency order; fails when negation or aggregation occurs inside a component.\n */\nexport const stratify = (rules: ReadonlyArray<Ast.Rule>, builtins: Builtin.Registry): Stratification => {\n const defined = new Set(rules.filter((rule) => rule.body.length > 0).map((rule) => rule.head.predicate));\n const edges = new Map<string, Dependency[]>();\n for (const predicate of defined) {\n edges.set(predicate, []);\n }\n for (const rule of rules) {\n for (const literal of rule.body) {\n for (const dependency of dependencies(literal, builtins)) {\n if (defined.has(dependency.predicate)) {\n edges.get(rule.head.predicate)?.push(dependency);\n }\n }\n }\n }\n\n // Tarjan's algorithm emits each component after every component it depends on.\n const components: string[][] = [];\n const index = new Map<string, number>();\n const lowLink = new Map<string, number>();\n const stack: string[] = [];\n const onStack = new Set<string>();\n const visit = (predicate: string) => {\n index.set(predicate, index.size);\n lowLink.set(predicate, index.get(predicate) ?? 0);\n stack.push(predicate);\n onStack.add(predicate);\n for (const { predicate: next } of edges.get(predicate) ?? []) {\n if (!index.has(next)) {\n visit(next);\n lowLink.set(predicate, Math.min(lowLink.get(predicate) ?? 0, lowLink.get(next) ?? 0));\n } else if (onStack.has(next)) {\n lowLink.set(predicate, Math.min(lowLink.get(predicate) ?? 0, index.get(next) ?? 0));\n }\n }\n if (lowLink.get(predicate) === index.get(predicate)) {\n const component: string[] = [];\n let member: string | undefined;\n do {\n member = stack.pop();\n if (member !== undefined) {\n onStack.delete(member);\n component.push(member);\n }\n } while (member !== undefined && member !== predicate);\n components.push(component);\n }\n };\n for (const predicate of defined) {\n if (!index.has(predicate)) {\n visit(predicate);\n }\n }\n\n const cycles: string[][] = [];\n const strata: Stratum[] = components.map((component) => {\n const members = new Set(component);\n const internal = component.flatMap((predicate) =>\n (edges.get(predicate) ?? []).filter((dependency) => members.has(dependency.predicate)),\n );\n if (internal.some((dependency) => dependency.negative)) {\n cycles.push(component.sort());\n }\n return {\n predicates: members,\n rules: rules.flatMap((rule, ruleIndex) =>\n rule.body.length > 0 && members.has(rule.head.predicate) ? [ruleIndex] : [],\n ),\n recursive: internal.length > 0,\n };\n });\n return cycles.length > 0 ? { ok: false, cycles } : { ok: true, strata };\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { BaseError } from '@dxos/errors';\n\nimport * as Ast from './Ast.ts';\nimport type * as Builtin from './Builtin.ts';\nimport { Slots, planBody } from './internal/plan.ts';\nimport { stratify } from './internal/stratify.ts';\n\nexport type DiagnosticCode = 'arity' | 'builtin-head' | 'undefined' | 'unsafe' | 'unstratifiable';\n\n/** A static error in a program. */\nexport type Diagnostic = {\n readonly code: DiagnosticCode;\n readonly message: string;\n /** Index of the offending rule. */\n readonly rule?: number;\n readonly position?: Ast.Position;\n};\n\nexport type Options = {\n readonly builtins?: Builtin.Registry;\n /**\n * Base relations and their arities. When given, a body predicate that is neither defined by a\n * rule, declared here nor a built-in is reported as `undefined`.\n */\n readonly relations?: Readonly<Record<string, number>>;\n};\n\n/** Thrown when a program with diagnostics is evaluated. */\nexport class CheckError extends BaseError.extend('CheckError', 'Invalid program') {\n // A typed field rather than `context`, which would repeat every diagnostic in the message as JSON.\n readonly diagnostics: ReadonlyArray<Diagnostic>;\n\n constructor(diagnostics: ReadonlyArray<Diagnostic>) {\n super({ message: `Invalid program:\\n${diagnostics.map(formatDiagnostic).join('\\n')}` });\n this.diagnostics = diagnostics;\n }\n}\n\n/** Formats a diagnostic as `line:column code: message`. */\nexport const formatDiagnostic = (diagnostic: Diagnostic): string => {\n const at = diagnostic.position ? `${diagnostic.position.line}:${diagnostic.position.column} ` : '';\n return `${at}${diagnostic.code}: ${diagnostic.message}`;\n};\n\n/**\n * Checks arity consistency, built-in heads, undefined predicates, range restriction (safety) and\n * stratification; an empty result means the program can be evaluated.\n */\nexport const check = (program: Ast.Program, options: Options = {}): Diagnostic[] => {\n const builtins = options.builtins ?? new Map();\n const diagnostics: Diagnostic[] = [];\n const arities = new Map<string, number>();\n for (const builtin of builtins.values()) {\n arities.set(builtin.name, builtin.arity);\n }\n for (const [name, arity] of Object.entries(options.relations ?? {})) {\n arities.set(name, arity);\n }\n const defined = new Set(program.rules.map((rule) => rule.head.predicate));\n\n const visitAtom = (atom: Ast.Atom, rule: number, position: Ast.Position | undefined) => {\n const expected = arities.get(atom.predicate);\n if (expected === undefined) {\n arities.set(atom.predicate, atom.terms.length);\n } else if (expected !== atom.terms.length) {\n diagnostics.push({\n code: 'arity',\n message: `${atom.predicate}/${atom.terms.length} used where ${atom.predicate}/${expected} is expected`,\n rule,\n position,\n });\n }\n };\n const visitLiteral = (literal: Ast.Literal, rule: number, fallback: Ast.Position | undefined) => {\n const position = literal.position ?? fallback;\n if (literal.type === 'atom') {\n visitAtom(literal.atom, rule, position);\n const predicate = literal.atom.predicate;\n if (\n options.relations &&\n !defined.has(predicate) &&\n !builtins.has(predicate) &&\n !(predicate in options.relations)\n ) {\n diagnostics.push({\n code: 'undefined',\n message: `${predicate}/${literal.atom.terms.length} is not a relation, rule or built-in`,\n rule,\n position,\n });\n }\n } else if (literal.type === 'aggregate') {\n literal.body.forEach((inner) => visitLiteral(inner, rule, position));\n }\n };\n\n program.rules.forEach((rule, index) => {\n if (builtins.has(rule.head.predicate)) {\n diagnostics.push({\n code: 'builtin-head',\n message: `rule defines built-in ${rule.head.predicate}`,\n rule: index,\n position: rule.position,\n });\n }\n visitAtom(rule.head, index, rule.position);\n rule.body.forEach((literal) => visitLiteral(literal, index, rule.position));\n\n const head = new Set(Ast.variablesOf(rule.head.terms));\n const plan = planBody({ body: rule.body, builtins, slots: new Slots(), outer: head });\n for (const { literal, reason } of plan.unresolved) {\n diagnostics.push({\n code: 'unsafe',\n message: `${reason} in: ${Ast.formatRule(rule)}`,\n rule: index,\n position: rule.body[literal].position ?? rule.position,\n });\n }\n const unboundHead = [...head].filter((name) => !plan.bound.has(name));\n if (unboundHead.length > 0) {\n diagnostics.push({\n code: 'unsafe',\n message: `head variable ${unboundHead.join(', ')} is not bound by the body in: ${Ast.formatRule(rule)}`,\n rule: index,\n position: rule.position,\n });\n }\n if (rule.head.terms.some((term) => term.type === 'variable' && term.anonymous)) {\n diagnostics.push({\n code: 'unsafe',\n message: `anonymous variable in head of: ${Ast.formatRule(rule)}`,\n rule: index,\n position: rule.position,\n });\n }\n });\n\n const stratification = stratify(program.rules, builtins);\n if (!stratification.ok) {\n for (const cycle of stratification.cycles) {\n diagnostics.push({\n code: 'unstratifiable',\n message: `negation or aggregation through recursion among: ${cycle.join(', ')}`,\n rule: program.rules.findIndex((rule) => cycle.includes(rule.head.predicate)),\n position: program.rules.find((rule) => cycle.includes(rule.head.predicate))?.position,\n });\n }\n }\n return diagnostics;\n};\n"],"mappings":";;;;;;AAqEA,IAAa,QAAb,MAAmB;CACjB,yBAAkB,IAAI,IAAoB;CAE1C,IAAI,OAAe;EACjB,OAAO,KAAK,OAAO;CACrB;CAEA,KAAK,MAAsB;EACzB,IAAI,OAAO,KAAK,OAAO,IAAI,IAAI;EAC/B,IAAI,SAAS,KAAA,GAAW;GACtB,OAAO,KAAK,OAAO;GACnB,KAAK,OAAO,IAAI,MAAM,IAAI;EAC5B;EACA,OAAO;CACT;CAEA,IAAI,MAAqB;EACvB,IAAI,KAAK,SAAS,YAChB,OAAO;GAAE,MAAM;GAAS,OAAO,KAAK;EAAM;EAE5C,OAAO,KAAK,YAAY,EAAE,MAAM,OAAO,IAAI;GAAE,MAAM;GAAQ,MAAM,KAAK,KAAK,KAAK,IAAI;EAAE;CACxF;AACF;AAEA,IAAM,WAAW,MAAgB,UAC/B,KAAK,SAAS,cAAe,CAAC,KAAK,aAAa,MAAM,IAAI,KAAK,IAAI;AAErE,IAAM,gBAAgB,OAAgC,UACpD,MAAM,SAAS,SAAU,KAAK,SAAS,cAAc,CAAC,KAAK,aAAa,CAAC,MAAM,IAAI,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAE;AAEnH,IAAM,iBAAiB,YAAmC;CACxD,QAAQ,QAAQ,MAAhB;EACE,KAAK,QACH,OAAO,QAAQ,KAA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AM,SAAS,KAAK,SAAS,cAAc,KAAK,SAAS,GAC3E,YAAY,KAAK;GACf,MAAM;GACN,SAAS,kCAAkCA,WAAe,IAAI;GAC9D,MAAM;GACN,UAAU,KAAK;EACjB,CAAC;CAEL,CAAC;CAED,MAAM,iBAAiB,SAAS,QAAQ,OAAO,QAAQ;CACvD,IAAI,CAAC,eAAe,IAClB,KAAK,MAAM,SAAS,eAAe,QACjC,YAAY,KAAK;EACf,MAAM;EACN,SAAS,oDAAoD,MAAM,KAAK,IAAI;EAC5E,MAAM,QAAQ,MAAM,WAAW,SAAS,MAAM,SAAS,KAAK,KAAK,SAAS,CAAC;EAC3E,UAAU,QAAQ,MAAM,MAAM,SAAS,MAAM,SAAS,KAAK,KAAK,SAAS,CAAC,CAAC,EAAE;CAC/E,CAAC;CAGL,OAAO;AACT"}
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
- import { variablesOf } from "./Ast.mjs";
2
+ import { f as variablesOf } from "./chunk-Ast.mjs";
3
3
  import { a as dependencies, c as planBody, o as stratify, r as check, s as Slots, t as CheckError } from "./chunk-Checker.mjs";
4
4
  //#region src/internal/relation.ts
5
5
  /** Collision-free key: the type tag keeps `1` and `"1"` apart. */
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-Engine.mjs","names":[],"sources":["../../src/internal/relation.ts","../../src/Engine.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport type * as Ast from '../Ast.ts';\n\n/** Collision-free key: the type tag keeps `1` and `\"1\"` apart. */\nexport const valueKey = (value: Ast.Value): string => (typeof value === 'number' ? `n${value}` : `s${value}`);\n\nexport const tupleKey = (tuple: Ast.Tuple): string => tuple.map(valueKey).join('\\u0001');\n\n/** Total order over values: numbers before strings, numbers numerically, strings by code unit. */\nexport const compareValues = (left: Ast.Value, right: Ast.Value): number => {\n if (typeof left === 'number' && typeof right === 'number') {\n return left - right;\n }\n if (typeof left === 'number') {\n return -1;\n }\n if (typeof right === 'number') {\n return 1;\n }\n return left < right ? -1 : left > right ? 1 : 0;\n};\n\n/** A set of tuples with lazily built hash indexes over bound column sets. */\nexport class Relation {\n readonly #tuples = new Map<string, Ast.Tuple>();\n readonly #indexes = new Map<string, Index>();\n\n get size(): number {\n return this.#tuples.size;\n }\n\n values(): IterableIterator<Ast.Tuple> {\n return this.#tuples.values();\n }\n\n entries(): IterableIterator<[string, Ast.Tuple]> {\n return this.#tuples.entries();\n }\n\n has(key: string): boolean {\n return this.#tuples.has(key);\n }\n\n /** Adds a tuple; returns false if it was already present. */\n add(tuple: Ast.Tuple, key = tupleKey(tuple)): boolean {\n if (this.#tuples.has(key)) {\n return false;\n }\n this.#tuples.set(key, tuple);\n for (const index of this.#indexes.values()) {\n insert(index, tuple);\n }\n return true;\n }\n\n delete(key: string): boolean {\n const deleted = this.#tuples.delete(key);\n if (deleted) {\n this.#indexes.clear();\n }\n return deleted;\n }\n\n /** Tuples whose `columns` equal `values`; scans everything when no column is bound. */\n lookup(columns: ReadonlyArray<number>, values: ReadonlyArray<Ast.Value>): Iterable<Ast.Tuple> {\n if (columns.length === 0) {\n return this.#tuples.values();\n }\n const columnsKey = columns.join(',');\n let index = this.#indexes.get(columnsKey);\n if (!index) {\n index = { columns, buckets: new Map() };\n for (const tuple of this.#tuples.values()) {\n insert(index, tuple);\n }\n this.#indexes.set(columnsKey, index);\n }\n return index.buckets.get(values.map(valueKey).join('\\u0001')) ?? [];\n }\n}\n\ntype Index = { readonly columns: ReadonlyArray<number>; readonly buckets: Map<string, Ast.Tuple[]> };\n\nconst insert = (index: Index, tuple: Ast.Tuple) => {\n const key = index.columns.map((column) => valueKey(tuple[column])).join('\\u0001');\n const bucket = index.buckets.get(key);\n if (bucket) {\n bucket.push(tuple);\n } else {\n index.buckets.set(key, [tuple]);\n }\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Ast from './Ast.ts';\nimport type * as Builtin from './Builtin.ts';\nimport * as Checker from './Checker.ts';\nimport { type Plan, type Ref, Slots, type Step, planBody } from './internal/plan.ts';\nimport { Relation, compareValues, tupleKey, valueKey } from './internal/relation.ts';\nimport { dependencies, stratify } from './internal/stratify.ts';\n\n/** A tuple of a named relation. */\nexport type Entry = { readonly relation: string; readonly tuple: Ast.Tuple };\n\n/** Tuples that entered or left each relation during one update. */\nexport type Changes = {\n readonly added: ReadonlyMap<string, ReadonlyArray<Ast.Tuple>>;\n readonly removed: ReadonlyMap<string, ReadonlyArray<Ast.Tuple>>;\n};\n\n/** One way a tuple was derived: the rule and the relation tuples its positive literals matched. */\nexport type Derivation = { readonly rule: number; readonly premises: ReadonlyArray<Entry> };\n\nexport type Options = {\n readonly program: Ast.Program;\n readonly builtins?: Builtin.Registry;\n /** Base relations and their arities; enables the `undefined` check. */\n readonly relations?: Readonly<Record<string, number>>;\n /** Record one derivation per derived tuple (default true). */\n readonly provenance?: boolean;\n};\n\nexport type Update = {\n readonly insert?: Iterable<Entry>;\n readonly retract?: Iterable<Entry>;\n /** Re-evaluate rules that use volatile built-ins (a clock tick). */\n readonly refresh?: boolean;\n};\n\ntype CompiledRule = {\n readonly index: number;\n readonly relation: string;\n readonly head: ReadonlyArray<Ref>;\n readonly slots: number;\n readonly naive: ReadonlyArray<Step>;\n /** Plans that scan the given positive literal first, for semi-naive deltas. */\n readonly delta: ReadonlyMap<number, { readonly relation: string; readonly steps: ReadonlyArray<Step> }>;\n readonly generatorOnly: boolean;\n};\n\ntype CompiledStratum = {\n readonly predicates: ReadonlySet<string>;\n readonly rules: ReadonlyArray<CompiledRule>;\n readonly positive: ReadonlySet<string>;\n readonly nonMonotone: ReadonlySet<string>;\n readonly volatile: boolean;\n};\n\ntype Accumulator = { added: Map<string, Ast.Tuple[]>; removed: Map<string, Ast.Tuple[]> };\n\n/**\n * Stratified semi-naive evaluator that keeps its model between updates: insertions propagate\n * incrementally, and a stratum is recomputed (and diffed) only when something it reads\n * non-monotonically changed.\n */\nexport class Engine {\n readonly #builtins: Builtin.Registry;\n readonly #provenance: boolean;\n readonly #strata: ReadonlyArray<CompiledStratum>;\n readonly #idb: ReadonlySet<string>;\n readonly #arities = new Map<string, number>();\n readonly #relations = new Map<string, Relation>();\n readonly #base = new Map<string, Relation>();\n readonly #derivations = new Map<string, Map<string, Derivation>>();\n\n /** @throws Checker.CheckError if the program has diagnostics. */\n constructor(options: Options) {\n this.#builtins = options.builtins ?? new Map();\n this.#provenance = options.provenance ?? true;\n const diagnostics = Checker.check(options.program, { builtins: this.#builtins, relations: options.relations });\n if (diagnostics.length > 0) {\n throw new Checker.CheckError(diagnostics);\n }\n const stratification = stratify(options.program.rules, this.#builtins);\n if (!stratification.ok) {\n throw new Error('Unreachable: checked programs are stratifiable.');\n }\n\n for (const [name, arity] of Object.entries(options.relations ?? {})) {\n this.#arities.set(name, arity);\n }\n const rules = options.program.rules;\n const visit = (literal: Ast.Literal) => {\n if (literal.type === 'atom' && !this.#builtins.has(literal.atom.predicate)) {\n this.#arities.set(literal.atom.predicate, literal.atom.terms.length);\n } else if (literal.type === 'aggregate') {\n literal.body.forEach(visit);\n }\n };\n for (const rule of rules) {\n this.#arities.set(rule.head.predicate, rule.head.terms.length);\n rule.body.forEach(visit);\n }\n this.#idb = new Set(stratification.strata.flatMap((stratum) => [...stratum.predicates]));\n this.#strata = stratification.strata.map((stratum) => {\n const compiled = stratum.rules.map((index) => this.#compileRule(index, rules[index]));\n const positive = new Set<string>();\n const nonMonotone = new Set<string>();\n for (const index of stratum.rules) {\n for (const literal of rules[index].body) {\n for (const dependency of dependencies(literal, this.#builtins)) {\n if (!stratum.predicates.has(dependency.predicate)) {\n (dependency.negative ? nonMonotone : positive).add(dependency.predicate);\n }\n }\n }\n }\n return {\n predicates: stratum.predicates,\n rules: compiled,\n positive,\n nonMonotone,\n volatile: stratum.rules.some((index) => rules[index].body.some((literal) => this.#isVolatile(literal))),\n };\n });\n\n const accumulator: Accumulator = { added: new Map(), removed: new Map() };\n for (const rule of rules.filter((rule) => rule.body.length === 0)) {\n const tuple = rule.head.terms.flatMap((term) => (term.type === 'constant' ? [term.value] : []));\n this.#addBase(rule.head.predicate, tuple, accumulator);\n }\n for (const stratum of this.#strata) {\n this.#recompute(stratum, accumulator);\n }\n }\n\n /** Applies retractions, then insertions, then propagates; returns what changed. */\n update(update: Update): Changes {\n const accumulator: Accumulator = { added: new Map(), removed: new Map() };\n const dirty = new Set<string>();\n for (const { relation, tuple } of update.retract ?? []) {\n const key = tupleKey(tuple);\n if (this.#base.get(relation)?.delete(key)) {\n if (this.#idb.has(relation)) {\n dirty.add(relation);\n } else if (this.#relation(relation).delete(key)) {\n push(accumulator.removed, relation, tuple);\n }\n }\n }\n for (const { relation, tuple } of update.insert ?? []) {\n if (this.#addBase(relation, tuple, accumulator) && this.#idb.has(relation)) {\n dirty.add(relation);\n }\n }\n\n for (const stratum of this.#strata) {\n const changed = (relation: string) =>\n (accumulator.added.get(relation)?.length ?? 0) + (accumulator.removed.get(relation)?.length ?? 0) > 0;\n const full =\n (update.refresh && stratum.volatile) ||\n [...stratum.predicates].some((predicate) => dirty.has(predicate)) ||\n [...stratum.nonMonotone].some(changed) ||\n [...stratum.positive].some((relation) => (accumulator.removed.get(relation)?.length ?? 0) > 0);\n if (full) {\n this.#recompute(stratum, accumulator);\n } else {\n this.#propagate(stratum, accumulator);\n }\n }\n return accumulator;\n }\n\n /** Inserts tuples into one relation. */\n insert(relation: string, ...tuples: ReadonlyArray<Ast.Tuple>): Changes {\n return this.update({ insert: tuples.map((tuple) => ({ relation, tuple })) });\n }\n\n /** Tuples of `relation`, optionally restricted to those matching the defined positions of `pattern`. */\n query(relation: string, pattern: ReadonlyArray<Ast.Value | undefined> = []): Ast.Tuple[] {\n const columns: number[] = [];\n const values: Ast.Value[] = [];\n pattern.forEach((value, column) => {\n if (value !== undefined) {\n columns.push(column);\n values.push(value);\n }\n });\n return [...(this.#relations.get(relation)?.lookup(columns, values) ?? [])];\n }\n\n has(relation: string, tuple: Ast.Tuple): boolean {\n return this.#relations.get(relation)?.has(tupleKey(tuple)) ?? false;\n }\n\n /** The recorded derivation of a tuple; undefined for base tuples and absent ones. */\n derivation(relation: string, tuple: Ast.Tuple): Derivation | undefined {\n return this.#derivations.get(relation)?.get(tupleKey(tuple));\n }\n\n /** The base tuples one derivation of `tuple` rests on (the tuple itself if it is a base tuple). */\n provenance(relation: string, tuple: Ast.Tuple): Entry[] {\n const result: Entry[] = [];\n const visited = new Set<string>();\n const visit = (entry: Entry) => {\n const key = `${entry.relation}\\u0002${tupleKey(entry.tuple)}`;\n if (visited.has(key)) {\n return;\n }\n visited.add(key);\n const derivation = this.derivation(entry.relation, entry.tuple);\n if (derivation) {\n derivation.premises.forEach(visit);\n } else if (this.#base.get(entry.relation)?.has(tupleKey(entry.tuple))) {\n result.push(entry);\n }\n };\n if (this.has(relation, tuple)) {\n visit({ relation, tuple });\n }\n return result;\n }\n\n #compileRule(index: number, rule: Ast.Rule): CompiledRule {\n const slots = new Slots();\n const outer = new Set(Ast.variablesOf(rule.head.terms));\n const naive = planBody({ body: rule.body, builtins: this.#builtins, slots, outer });\n const delta = new Map<number, { relation: string; steps: ReadonlyArray<Step> }>();\n rule.body.forEach((literal, literalIndex) => {\n if (literal.type === 'atom' && !literal.negated && !this.#builtins.has(literal.atom.predicate)) {\n const plan: Plan = planBody({ body: rule.body, builtins: this.#builtins, slots, outer, first: literalIndex });\n delta.set(literalIndex, { relation: literal.atom.predicate, steps: plan.steps });\n }\n });\n return {\n index,\n relation: rule.head.predicate,\n head: rule.head.terms.map((term) => slots.ref(term)),\n slots: slots.size,\n naive: naive.steps,\n delta,\n generatorOnly: delta.size === 0,\n };\n }\n\n #isVolatile(literal: Ast.Literal): boolean {\n switch (literal.type) {\n case 'atom':\n return this.#builtins.get(literal.atom.predicate)?.volatile === true;\n case 'comparison':\n return false;\n case 'aggregate':\n return literal.body.some((inner) => this.#isVolatile(inner));\n }\n }\n\n #relation(name: string): Relation {\n let relation = this.#relations.get(name);\n if (!relation) {\n relation = new Relation();\n this.#relations.set(name, relation);\n }\n return relation;\n }\n\n #addBase(relation: string, tuple: Ast.Tuple, accumulator: Accumulator): boolean {\n const arity = this.#arities.get(relation);\n if (arity === undefined) {\n this.#arities.set(relation, tuple.length);\n } else if (arity !== tuple.length) {\n throw new Error(`Arity mismatch: ${relation}/${tuple.length} inserted where ${relation}/${arity} is expected`);\n }\n let base = this.#base.get(relation);\n if (!base) {\n base = new Relation();\n this.#base.set(relation, base);\n }\n const key = tupleKey(tuple);\n if (!base.add(tuple, key)) {\n return false;\n }\n if (!this.#idb.has(relation) && this.#relation(relation).add(tuple, key)) {\n push(accumulator.added, relation, tuple);\n }\n return true;\n }\n\n /** Re-derives a stratum from scratch and records the difference from its previous contents. */\n #recompute(stratum: CompiledStratum, accumulator: Accumulator) {\n const previous = new Map<string, Relation>();\n for (const predicate of stratum.predicates) {\n previous.set(predicate, this.#relation(predicate));\n const fresh = new Relation();\n for (const [key, tuple] of this.#base.get(predicate)?.entries() ?? []) {\n fresh.add(tuple, key);\n }\n this.#relations.set(predicate, fresh);\n this.#derivations.delete(predicate);\n }\n\n const delta = this.#commit(\n stratum.rules.flatMap((rule) => this.#run(rule, rule.naive)),\n undefined,\n );\n this.#iterate(stratum, delta);\n\n for (const predicate of stratum.predicates) {\n const before = previous.get(predicate) ?? new Relation();\n const after = this.#relation(predicate);\n for (const [key, tuple] of after.entries()) {\n if (!before.has(key)) {\n push(accumulator.added, predicate, tuple);\n }\n }\n for (const [key, tuple] of before.entries()) {\n if (!after.has(key)) {\n push(accumulator.removed, predicate, tuple);\n }\n }\n }\n }\n\n /** Semi-naive propagation of tuples added to relations below the stratum. */\n #propagate(stratum: CompiledStratum, accumulator: Accumulator) {\n const derived: Emitted[] = [];\n for (const rule of stratum.rules) {\n if (rule.generatorOnly) {\n derived.push(...this.#run(rule, rule.naive));\n continue;\n }\n for (const { relation, steps } of rule.delta.values()) {\n const tuples = accumulator.added.get(relation);\n if (tuples && tuples.length > 0 && !stratum.predicates.has(relation)) {\n derived.push(...this.#run(rule, steps, tuples));\n }\n }\n }\n const delta = this.#commit(derived, accumulator);\n this.#iterate(stratum, delta, accumulator);\n }\n\n /** Runs recursive rules of the stratum to fixpoint from `delta`. */\n #iterate(stratum: CompiledStratum, initial: Map<string, Ast.Tuple[]>, accumulator?: Accumulator) {\n let delta = initial;\n while (delta.size > 0) {\n const derived: Emitted[] = [];\n for (const rule of stratum.rules) {\n for (const { relation, steps } of rule.delta.values()) {\n const tuples = delta.get(relation);\n if (tuples && stratum.predicates.has(relation)) {\n derived.push(...this.#run(rule, steps, tuples));\n }\n }\n }\n delta = this.#commit(derived, accumulator);\n }\n }\n\n /** Adds derived tuples; returns the new ones by relation. */\n #commit(derived: ReadonlyArray<Emitted>, accumulator: Accumulator | undefined): Map<string, Ast.Tuple[]> {\n const delta = new Map<string, Ast.Tuple[]>();\n for (const { relation, tuple, derivation } of derived) {\n const key = tupleKey(tuple);\n if (this.#relation(relation).add(tuple, key)) {\n push(delta, relation, tuple);\n if (accumulator) {\n push(accumulator.added, relation, tuple);\n }\n if (derivation) {\n let derivations = this.#derivations.get(relation);\n if (!derivations) {\n derivations = new Map();\n this.#derivations.set(relation, derivations);\n }\n derivations.set(key, derivation);\n }\n }\n }\n return delta;\n }\n\n /** Evaluates a rule plan; when `delta` is given, the plan's first scan reads it instead of the relation. */\n #run(rule: CompiledRule, steps: ReadonlyArray<Step>, delta?: ReadonlyArray<Ast.Tuple>): Emitted[] {\n const emitted: Emitted[] = [];\n const binding: Array<Ast.Value | undefined> = new Array(rule.slots).fill(undefined);\n const premises: Entry[] = [];\n this.#solve(steps, 0, binding, premises, delta, () => {\n const tuple = rule.head.map((ref) => resolveBound(ref, binding));\n emitted.push({\n relation: rule.relation,\n tuple,\n derivation: this.#provenance ? { rule: rule.index, premises: [...premises] } : undefined,\n });\n });\n return emitted;\n }\n\n #solve(\n steps: ReadonlyArray<Step>,\n position: number,\n binding: Array<Ast.Value | undefined>,\n premises: Entry[],\n delta: ReadonlyArray<Ast.Tuple> | undefined,\n emit: () => void,\n ): void {\n if (position === steps.length) {\n emit();\n return;\n }\n const step = steps[position];\n const next = () => this.#solve(steps, position + 1, binding, premises, delta, emit);\n switch (step.kind) {\n case 'scan': {\n const values = step.bound.map(({ ref }) => resolveBound(ref, binding));\n const tuples =\n position === 0 && delta\n ? delta.filter((tuple) => step.bound.every(({ column }, at) => tuple[column] === values[at]))\n : this.#relation(step.relation).lookup(\n step.bound.map(({ column }) => column),\n values,\n );\n for (const tuple of tuples) {\n const assigned: number[] = [];\n let matches = true;\n for (const { column, slot } of step.binds) {\n const current = binding[slot];\n if (current === undefined) {\n binding[slot] = tuple[column];\n assigned.push(slot);\n } else if (current !== tuple[column]) {\n matches = false;\n break;\n }\n }\n if (matches) {\n premises.push({ relation: step.relation, tuple });\n next();\n premises.pop();\n }\n for (const slot of assigned) {\n binding[slot] = undefined;\n }\n }\n return;\n }\n case 'negation': {\n const matches = this.#relation(step.relation).lookup(\n step.bound.map(({ column }) => column),\n step.bound.map(({ ref }) => resolveBound(ref, binding)),\n );\n if (isEmpty(matches)) {\n next();\n }\n return;\n }\n case 'compare': {\n if (step.assign) {\n binding[step.assign.slot] = resolve(step.assign.from, binding);\n next();\n binding[step.assign.slot] = undefined;\n return;\n }\n const left = resolve(step.left, binding);\n const right = resolve(step.right, binding);\n if (left !== undefined && right !== undefined && compare(step.operator, left, right)) {\n next();\n }\n return;\n }\n case 'builtin': {\n const args = step.args.map((ref, index) => (step.free[index] ? undefined : resolve(ref, binding)));\n const results = step.builtin.evaluate(args);\n if (step.negated) {\n if (isEmpty(results)) {\n next();\n }\n return;\n }\n for (const result of results) {\n if (result.length !== step.args.length) {\n continue;\n }\n const assigned: number[] = [];\n let matches = true;\n for (let index = 0; index < step.args.length && matches; index++) {\n const ref = step.args[index];\n if (ref.kind === 'wild') {\n continue;\n }\n if (ref.kind === 'slot' && binding[ref.slot] === undefined) {\n binding[ref.slot] = result[index];\n assigned.push(ref.slot);\n } else {\n matches = resolve(ref, binding) === result[index];\n }\n }\n if (matches) {\n next();\n }\n for (const slot of assigned) {\n binding[slot] = undefined;\n }\n }\n return;\n }\n case 'aggregate': {\n const seen = new Set<string>();\n const targets: Ast.Value[] = [];\n const matched: Entry[] = [];\n this.#solve(step.steps, 0, binding, matched, undefined, () => {\n // Matched tuples join the key so anonymous columns still count as distinct rows.\n const key = [\n ...step.local.map((slot) => valueKey(resolveBound({ kind: 'slot', slot }, binding))),\n ...matched.map(({ relation, tuple }) => `${relation}\\u0002${tupleKey(tuple)}`),\n ].join('\\u0001');\n if (!seen.has(key)) {\n seen.add(key);\n const target = step.target ? resolve(step.target, binding) : undefined;\n if (target !== undefined) {\n targets.push(target);\n }\n }\n });\n const value = aggregate(step.function, seen.size, targets);\n if (value === undefined) {\n return;\n }\n if (step.assignResult && step.result.kind === 'slot') {\n binding[step.result.slot] = value;\n next();\n binding[step.result.slot] = undefined;\n } else if (step.result.kind === 'wild' || resolve(step.result, binding) === value) {\n next();\n }\n }\n }\n }\n}\n\n/** Creates an engine and evaluates the program's facts. */\nexport const make = (options: Options): Engine => new Engine(options);\n\ntype Emitted = { readonly relation: string; readonly tuple: Ast.Tuple; readonly derivation?: Derivation };\n\nconst push = (map: Map<string, Ast.Tuple[]>, relation: string, tuple: Ast.Tuple) => {\n const list = map.get(relation);\n if (list) {\n list.push(tuple);\n } else {\n map.set(relation, [tuple]);\n }\n};\n\nconst resolve = (ref: Ref, binding: ReadonlyArray<Ast.Value | undefined>): Ast.Value | undefined => {\n switch (ref.kind) {\n case 'const':\n return ref.value;\n case 'slot':\n return binding[ref.slot];\n case 'wild':\n return undefined;\n }\n};\n\n/** Planned steps only read slots an earlier step bound. */\nconst resolveBound = (ref: Ref, binding: ReadonlyArray<Ast.Value | undefined>): Ast.Value => {\n const value = resolve(ref, binding);\n if (value === undefined) {\n throw new Error('Unbound variable in planned step.');\n }\n return value;\n};\n\nconst isEmpty = (iterable: Iterable<unknown>): boolean => iterable[Symbol.iterator]().next().done === true;\n\nconst compare = (operator: Ast.ComparisonOperator, left: Ast.Value, right: Ast.Value): boolean => {\n switch (operator) {\n case '=':\n return left === right;\n case '!=':\n return left !== right;\n case '<':\n return compareValues(left, right) < 0;\n case '<=':\n return compareValues(left, right) <= 0;\n case '>':\n return compareValues(left, right) > 0;\n case '>=':\n return compareValues(left, right) >= 0;\n }\n};\n\nconst aggregate = (\n fn: Ast.AggregateFunction,\n count: number,\n targets: ReadonlyArray<Ast.Value>,\n): Ast.Value | undefined => {\n switch (fn) {\n case 'count':\n return count;\n case 'sum':\n return targets.reduce<number>((sum, value) => sum + (typeof value === 'number' ? value : Number(value)), 0);\n case 'min':\n return targets.length === 0\n ? undefined\n : targets.reduce((min, value) => (compareValues(value, min) < 0 ? value : min));\n case 'max':\n return targets.length === 0\n ? undefined\n : targets.reduce((max, value) => (compareValues(value, max) > 0 ? value : max));\n }\n};\n"],"mappings":";;;;;AAOA,IAAa,YAAY,UAA8B,OAAO,UAAU,WAAW,IAAI,UAAU,IAAI;AAErG,IAAa,YAAY,UAA6B,MAAM,IAAI,QAAQ,CAAC,CAAC,KAAK,GAAQ;;AAGvF,IAAa,iBAAiB,MAAiB,UAA6B;CAC1E,IAAI,OAAO,SAAS,YAAY,OAAO,UAAU,UAC/C,OAAO,OAAO;CAEhB,IAAI,OAAO,SAAS,UAClB,OAAO;CAET,IAAI,OAAO,UAAU,UACnB,OAAO;CAET,OAAO,OAAO,QAAQ,KAAK,OAAO,QAAQ,IAAI;AAChD;;AAGA,IAAa,WAAb,MAAsB;CACpB,0BAAmB,IAAI,IAAuB;CAC9C,2BAAoB,IAAI,IAAmB;CAE3C,IAAI,OAAe;EACjB,OAAO,KAAK,QAAQ;CACtB;CAEA,SAAsC;EACpC,OAAO,KAAK,QAAQ,OAAO;CAC7B;CAEA,UAAiD;EAC/C,OAAO,KAAK,QAAQ,QAAQ;CAC9B;CAEA,IAAI,KAAsB;EACxB,OAAO,KAAK,QAAQ,IAAI,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AZ;EACE,KAAK,SACH,OAAO,IAAI;EACb,KAAK,QACH,OAAO,QAAQ,IAAI;EACrB,KAAK,QACH;CACJ;AACF;;AAGA,IAAM,gBAAgB,KAAU,YAA6D;CAC3F,MAAM,QAAQ,QAAQ,KAAK,OAAO;CAClC,IAAI,UAAU,KAAA,GACZ,MAAM,IAAI,MAAM,mCAAmC;CAErD,OAAO;AACT;AAEA,IAAM,WAAW,aAAyC,SAAS,OAAO,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS;AAEtG,IAAM,WAAW,UAAkC,MAAiB,UAA8B;CAChG,QAAQ,UAAR;EACE,KAAK,KACH,OAAO,SAAS;EAClB,KAAK,MACH,OAAO,SAAS;EAClB,KAAK,KACH,OAAO,cAAc,MAAM,KAAK,IAAI;EACtC,KAAK,MACH,OAAO,cAAc,MAAM,KAAK,KAAK;EACvC,KAAK,KACH,OAAO,cAAc,MAAM,KAAK,IAAI;EACtC,KAAK,MACH,OAAO,cAAc,MAAM,KAAK,KAAK;CACzC;AACF;AAEA,IAAM,aACJ,IACA,OACA,YAC0B;CAC1B,QAAQ,IAAR;EACE,KAAK,SACH,OAAO;EACT,KAAK,OACH,OAAO,QAAQ,QAAgB,KAAK,UAAU,OAAO,OAAO,UAAU,WAAW,QAAQ,OAAO,KAAK,IAAI,CAAC;EAC5G,KAAK,OACH,OAAO,QAAQ,WAAW,IACtB,KAAA,IACA,QAAQ,QAAQ,KAAK,UAAW,cAAc,OAAO,GAAG,IAAI,IAAI,QAAQ,GAAI;EAClF,KAAK,OACH,OAAO,QAAQ,WAAW,IACtB,KAAA,IACA,QAAQ,QAAQ,KAAK,UAAW,cAAc,OAAO,GAAG,IAAI,IAAI,QAAQ,GAAI;CACpF;AACF"}
1
+ {"version":3,"file":"chunk-Engine.mjs","names":["Checker.check","Checker.CheckError","Ast.variablesOf"],"sources":["../../src/internal/relation.ts","../../src/Engine.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport type * as Ast from '../Ast.ts';\n\n/** Collision-free key: the type tag keeps `1` and `\"1\"` apart. */\nexport const valueKey = (value: Ast.Value): string => (typeof value === 'number' ? `n${value}` : `s${value}`);\n\nexport const tupleKey = (tuple: Ast.Tuple): string => tuple.map(valueKey).join('\\u0001');\n\n/** Total order over values: numbers before strings, numbers numerically, strings by code unit. */\nexport const compareValues = (left: Ast.Value, right: Ast.Value): number => {\n if (typeof left === 'number' && typeof right === 'number') {\n return left - right;\n }\n if (typeof left === 'number') {\n return -1;\n }\n if (typeof right === 'number') {\n return 1;\n }\n return left < right ? -1 : left > right ? 1 : 0;\n};\n\n/** A set of tuples with lazily built hash indexes over bound column sets. */\nexport class Relation {\n readonly #tuples = new Map<string, Ast.Tuple>();\n readonly #indexes = new Map<string, Index>();\n\n get size(): number {\n return this.#tuples.size;\n }\n\n values(): IterableIterator<Ast.Tuple> {\n return this.#tuples.values();\n }\n\n entries(): IterableIterator<[string, Ast.Tuple]> {\n return this.#tuples.entries();\n }\n\n has(key: string): boolean {\n return this.#tuples.has(key);\n }\n\n /** Adds a tuple; returns false if it was already present. */\n add(tuple: Ast.Tuple, key = tupleKey(tuple)): boolean {\n if (this.#tuples.has(key)) {\n return false;\n }\n this.#tuples.set(key, tuple);\n for (const index of this.#indexes.values()) {\n insert(index, tuple);\n }\n return true;\n }\n\n delete(key: string): boolean {\n const deleted = this.#tuples.delete(key);\n if (deleted) {\n this.#indexes.clear();\n }\n return deleted;\n }\n\n /** Tuples whose `columns` equal `values`; scans everything when no column is bound. */\n lookup(columns: ReadonlyArray<number>, values: ReadonlyArray<Ast.Value>): Iterable<Ast.Tuple> {\n if (columns.length === 0) {\n return this.#tuples.values();\n }\n const columnsKey = columns.join(',');\n let index = this.#indexes.get(columnsKey);\n if (!index) {\n index = { columns, buckets: new Map() };\n for (const tuple of this.#tuples.values()) {\n insert(index, tuple);\n }\n this.#indexes.set(columnsKey, index);\n }\n return index.buckets.get(values.map(valueKey).join('\\u0001')) ?? [];\n }\n}\n\ntype Index = { readonly columns: ReadonlyArray<number>; readonly buckets: Map<string, Ast.Tuple[]> };\n\nconst insert = (index: Index, tuple: Ast.Tuple) => {\n const key = index.columns.map((column) => valueKey(tuple[column])).join('\\u0001');\n const bucket = index.buckets.get(key);\n if (bucket) {\n bucket.push(tuple);\n } else {\n index.buckets.set(key, [tuple]);\n }\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Ast from './Ast.ts';\nimport type * as Builtin from './Builtin.ts';\nimport * as Checker from './Checker.ts';\nimport { type Plan, type Ref, Slots, type Step, planBody } from './internal/plan.ts';\nimport { Relation, compareValues, tupleKey, valueKey } from './internal/relation.ts';\nimport { dependencies, stratify } from './internal/stratify.ts';\n\n/** A tuple of a named relation. */\nexport type Entry = { readonly relation: string; readonly tuple: Ast.Tuple };\n\n/** Tuples that entered or left each relation during one update. */\nexport type Changes = {\n readonly added: ReadonlyMap<string, ReadonlyArray<Ast.Tuple>>;\n readonly removed: ReadonlyMap<string, ReadonlyArray<Ast.Tuple>>;\n};\n\n/** One way a tuple was derived: the rule and the relation tuples its positive literals matched. */\nexport type Derivation = { readonly rule: number; readonly premises: ReadonlyArray<Entry> };\n\nexport type Options = {\n readonly program: Ast.Program;\n readonly builtins?: Builtin.Registry;\n /** Base relations and their arities; enables the `undefined` check. */\n readonly relations?: Readonly<Record<string, number>>;\n /** Record one derivation per derived tuple (default true). */\n readonly provenance?: boolean;\n};\n\nexport type Update = {\n readonly insert?: Iterable<Entry>;\n readonly retract?: Iterable<Entry>;\n /** Re-evaluate rules that use volatile built-ins (a clock tick). */\n readonly refresh?: boolean;\n};\n\ntype CompiledRule = {\n readonly index: number;\n readonly relation: string;\n readonly head: ReadonlyArray<Ref>;\n readonly slots: number;\n readonly naive: ReadonlyArray<Step>;\n /** Plans that scan the given positive literal first, for semi-naive deltas. */\n readonly delta: ReadonlyMap<number, { readonly relation: string; readonly steps: ReadonlyArray<Step> }>;\n readonly generatorOnly: boolean;\n};\n\ntype CompiledStratum = {\n readonly predicates: ReadonlySet<string>;\n readonly rules: ReadonlyArray<CompiledRule>;\n readonly positive: ReadonlySet<string>;\n readonly nonMonotone: ReadonlySet<string>;\n readonly volatile: boolean;\n};\n\ntype Accumulator = { added: Map<string, Ast.Tuple[]>; removed: Map<string, Ast.Tuple[]> };\n\n/**\n * Stratified semi-naive evaluator that keeps its model between updates: insertions propagate\n * incrementally, and a stratum is recomputed (and diffed) only when something it reads\n * non-monotonically changed.\n */\nexport class Engine {\n readonly #builtins: Builtin.Registry;\n readonly #provenance: boolean;\n readonly #strata: ReadonlyArray<CompiledStratum>;\n readonly #idb: ReadonlySet<string>;\n readonly #arities = new Map<string, number>();\n readonly #relations = new Map<string, Relation>();\n readonly #base = new Map<string, Relation>();\n readonly #derivations = new Map<string, Map<string, Derivation>>();\n\n /** @throws Checker.CheckError if the program has diagnostics. */\n constructor(options: Options) {\n this.#builtins = options.builtins ?? new Map();\n this.#provenance = options.provenance ?? true;\n const diagnostics = Checker.check(options.program, { builtins: this.#builtins, relations: options.relations });\n if (diagnostics.length > 0) {\n throw new Checker.CheckError(diagnostics);\n }\n const stratification = stratify(options.program.rules, this.#builtins);\n if (!stratification.ok) {\n throw new Error('Unreachable: checked programs are stratifiable.');\n }\n\n for (const [name, arity] of Object.entries(options.relations ?? {})) {\n this.#arities.set(name, arity);\n }\n const rules = options.program.rules;\n const visit = (literal: Ast.Literal) => {\n if (literal.type === 'atom' && !this.#builtins.has(literal.atom.predicate)) {\n this.#arities.set(literal.atom.predicate, literal.atom.terms.length);\n } else if (literal.type === 'aggregate') {\n literal.body.forEach(visit);\n }\n };\n for (const rule of rules) {\n this.#arities.set(rule.head.predicate, rule.head.terms.length);\n rule.body.forEach(visit);\n }\n this.#idb = new Set(stratification.strata.flatMap((stratum) => [...stratum.predicates]));\n this.#strata = stratification.strata.map((stratum) => {\n const compiled = stratum.rules.map((index) => this.#compileRule(index, rules[index]));\n const positive = new Set<string>();\n const nonMonotone = new Set<string>();\n for (const index of stratum.rules) {\n for (const literal of rules[index].body) {\n for (const dependency of dependencies(literal, this.#builtins)) {\n if (!stratum.predicates.has(dependency.predicate)) {\n (dependency.negative ? nonMonotone : positive).add(dependency.predicate);\n }\n }\n }\n }\n return {\n predicates: stratum.predicates,\n rules: compiled,\n positive,\n nonMonotone,\n volatile: stratum.rules.some((index) => rules[index].body.some((literal) => this.#isVolatile(literal))),\n };\n });\n\n const accumulator: Accumulator = { added: new Map(), removed: new Map() };\n for (const rule of rules.filter((rule) => rule.body.length === 0)) {\n const tuple = rule.head.terms.flatMap((term) => (term.type === 'constant' ? [term.value] : []));\n this.#addBase(rule.head.predicate, tuple, accumulator);\n }\n for (const stratum of this.#strata) {\n this.#recompute(stratum, accumulator);\n }\n }\n\n /** Applies retractions, then insertions, then propagates; returns what changed. */\n update(update: Update): Changes {\n const accumulator: Accumulator = { added: new Map(), removed: new Map() };\n const dirty = new Set<string>();\n for (const { relation, tuple } of update.retract ?? []) {\n const key = tupleKey(tuple);\n if (this.#base.get(relation)?.delete(key)) {\n if (this.#idb.has(relation)) {\n dirty.add(relation);\n } else if (this.#relation(relation).delete(key)) {\n push(accumulator.removed, relation, tuple);\n }\n }\n }\n for (const { relation, tuple } of update.insert ?? []) {\n if (this.#addBase(relation, tuple, accumulator) && this.#idb.has(relation)) {\n dirty.add(relation);\n }\n }\n\n for (const stratum of this.#strata) {\n const changed = (relation: string) =>\n (accumulator.added.get(relation)?.length ?? 0) + (accumulator.removed.get(relation)?.length ?? 0) > 0;\n const full =\n (update.refresh && stratum.volatile) ||\n [...stratum.predicates].some((predicate) => dirty.has(predicate)) ||\n [...stratum.nonMonotone].some(changed) ||\n [...stratum.positive].some((relation) => (accumulator.removed.get(relation)?.length ?? 0) > 0);\n if (full) {\n this.#recompute(stratum, accumulator);\n } else {\n this.#propagate(stratum, accumulator);\n }\n }\n return accumulator;\n }\n\n /** Inserts tuples into one relation. */\n insert(relation: string, ...tuples: ReadonlyArray<Ast.Tuple>): Changes {\n return this.update({ insert: tuples.map((tuple) => ({ relation, tuple })) });\n }\n\n /** Tuples of `relation`, optionally restricted to those matching the defined positions of `pattern`. */\n query(relation: string, pattern: ReadonlyArray<Ast.Value | undefined> = []): Ast.Tuple[] {\n const columns: number[] = [];\n const values: Ast.Value[] = [];\n pattern.forEach((value, column) => {\n if (value !== undefined) {\n columns.push(column);\n values.push(value);\n }\n });\n return [...(this.#relations.get(relation)?.lookup(columns, values) ?? [])];\n }\n\n has(relation: string, tuple: Ast.Tuple): boolean {\n return this.#relations.get(relation)?.has(tupleKey(tuple)) ?? false;\n }\n\n /** The recorded derivation of a tuple; undefined for base tuples and absent ones. */\n derivation(relation: string, tuple: Ast.Tuple): Derivation | undefined {\n return this.#derivations.get(relation)?.get(tupleKey(tuple));\n }\n\n /** The base tuples one derivation of `tuple` rests on (the tuple itself if it is a base tuple). */\n provenance(relation: string, tuple: Ast.Tuple): Entry[] {\n const result: Entry[] = [];\n const visited = new Set<string>();\n const visit = (entry: Entry) => {\n const key = `${entry.relation}\\u0002${tupleKey(entry.tuple)}`;\n if (visited.has(key)) {\n return;\n }\n visited.add(key);\n const derivation = this.derivation(entry.relation, entry.tuple);\n if (derivation) {\n derivation.premises.forEach(visit);\n } else if (this.#base.get(entry.relation)?.has(tupleKey(entry.tuple))) {\n result.push(entry);\n }\n };\n if (this.has(relation, tuple)) {\n visit({ relation, tuple });\n }\n return result;\n }\n\n #compileRule(index: number, rule: Ast.Rule): CompiledRule {\n const slots = new Slots();\n const outer = new Set(Ast.variablesOf(rule.head.terms));\n const naive = planBody({ body: rule.body, builtins: this.#builtins, slots, outer });\n const delta = new Map<number, { relation: string; steps: ReadonlyArray<Step> }>();\n rule.body.forEach((literal, literalIndex) => {\n if (literal.type === 'atom' && !literal.negated && !this.#builtins.has(literal.atom.predicate)) {\n const plan: Plan = planBody({ body: rule.body, builtins: this.#builtins, slots, outer, first: literalIndex });\n delta.set(literalIndex, { relation: literal.atom.predicate, steps: plan.steps });\n }\n });\n return {\n index,\n relation: rule.head.predicate,\n head: rule.head.terms.map((term) => slots.ref(term)),\n slots: slots.size,\n naive: naive.steps,\n delta,\n generatorOnly: delta.size === 0,\n };\n }\n\n #isVolatile(literal: Ast.Literal): boolean {\n switch (literal.type) {\n case 'atom':\n return this.#builtins.get(literal.atom.predicate)?.volatile === true;\n case 'comparison':\n return false;\n case 'aggregate':\n return literal.body.some((inner) => this.#isVolatile(inner));\n }\n }\n\n #relation(name: string): Relation {\n let relation = this.#relations.get(name);\n if (!relation) {\n relation = new Relation();\n this.#relations.set(name, relation);\n }\n return relation;\n }\n\n #addBase(relation: string, tuple: Ast.Tuple, accumulator: Accumulator): boolean {\n const arity = this.#arities.get(relation);\n if (arity === undefined) {\n this.#arities.set(relation, tuple.length);\n } else if (arity !== tuple.length) {\n throw new Error(`Arity mismatch: ${relation}/${tuple.length} inserted where ${relation}/${arity} is expected`);\n }\n let base = this.#base.get(relation);\n if (!base) {\n base = new Relation();\n this.#base.set(relation, base);\n }\n const key = tupleKey(tuple);\n if (!base.add(tuple, key)) {\n return false;\n }\n if (!this.#idb.has(relation) && this.#relation(relation).add(tuple, key)) {\n push(accumulator.added, relation, tuple);\n }\n return true;\n }\n\n /** Re-derives a stratum from scratch and records the difference from its previous contents. */\n #recompute(stratum: CompiledStratum, accumulator: Accumulator) {\n const previous = new Map<string, Relation>();\n for (const predicate of stratum.predicates) {\n previous.set(predicate, this.#relation(predicate));\n const fresh = new Relation();\n for (const [key, tuple] of this.#base.get(predicate)?.entries() ?? []) {\n fresh.add(tuple, key);\n }\n this.#relations.set(predicate, fresh);\n this.#derivations.delete(predicate);\n }\n\n const delta = this.#commit(\n stratum.rules.flatMap((rule) => this.#run(rule, rule.naive)),\n undefined,\n );\n this.#iterate(stratum, delta);\n\n for (const predicate of stratum.predicates) {\n const before = previous.get(predicate) ?? new Relation();\n const after = this.#relation(predicate);\n for (const [key, tuple] of after.entries()) {\n if (!before.has(key)) {\n push(accumulator.added, predicate, tuple);\n }\n }\n for (const [key, tuple] of before.entries()) {\n if (!after.has(key)) {\n push(accumulator.removed, predicate, tuple);\n }\n }\n }\n }\n\n /** Semi-naive propagation of tuples added to relations below the stratum. */\n #propagate(stratum: CompiledStratum, accumulator: Accumulator) {\n const derived: Emitted[] = [];\n for (const rule of stratum.rules) {\n if (rule.generatorOnly) {\n derived.push(...this.#run(rule, rule.naive));\n continue;\n }\n for (const { relation, steps } of rule.delta.values()) {\n const tuples = accumulator.added.get(relation);\n if (tuples && tuples.length > 0 && !stratum.predicates.has(relation)) {\n derived.push(...this.#run(rule, steps, tuples));\n }\n }\n }\n const delta = this.#commit(derived, accumulator);\n this.#iterate(stratum, delta, accumulator);\n }\n\n /** Runs recursive rules of the stratum to fixpoint from `delta`. */\n #iterate(stratum: CompiledStratum, initial: Map<string, Ast.Tuple[]>, accumulator?: Accumulator) {\n let delta = initial;\n while (delta.size > 0) {\n const derived: Emitted[] = [];\n for (const rule of stratum.rules) {\n for (const { relation, steps } of rule.delta.values()) {\n const tuples = delta.get(relation);\n if (tuples && stratum.predicates.has(relation)) {\n derived.push(...this.#run(rule, steps, tuples));\n }\n }\n }\n delta = this.#commit(derived, accumulator);\n }\n }\n\n /** Adds derived tuples; returns the new ones by relation. */\n #commit(derived: ReadonlyArray<Emitted>, accumulator: Accumulator | undefined): Map<string, Ast.Tuple[]> {\n const delta = new Map<string, Ast.Tuple[]>();\n for (const { relation, tuple, derivation } of derived) {\n const key = tupleKey(tuple);\n if (this.#relation(relation).add(tuple, key)) {\n push(delta, relation, tuple);\n if (accumulator) {\n push(accumulator.added, relation, tuple);\n }\n if (derivation) {\n let derivations = this.#derivations.get(relation);\n if (!derivations) {\n derivations = new Map();\n this.#derivations.set(relation, derivations);\n }\n derivations.set(key, derivation);\n }\n }\n }\n return delta;\n }\n\n /** Evaluates a rule plan; when `delta` is given, the plan's first scan reads it instead of the relation. */\n #run(rule: CompiledRule, steps: ReadonlyArray<Step>, delta?: ReadonlyArray<Ast.Tuple>): Emitted[] {\n const emitted: Emitted[] = [];\n const binding: Array<Ast.Value | undefined> = new Array(rule.slots).fill(undefined);\n const premises: Entry[] = [];\n this.#solve(steps, 0, binding, premises, delta, () => {\n const tuple = rule.head.map((ref) => resolveBound(ref, binding));\n emitted.push({\n relation: rule.relation,\n tuple,\n derivation: this.#provenance ? { rule: rule.index, premises: [...premises] } : undefined,\n });\n });\n return emitted;\n }\n\n #solve(\n steps: ReadonlyArray<Step>,\n position: number,\n binding: Array<Ast.Value | undefined>,\n premises: Entry[],\n delta: ReadonlyArray<Ast.Tuple> | undefined,\n emit: () => void,\n ): void {\n if (position === steps.length) {\n emit();\n return;\n }\n const step = steps[position];\n const next = () => this.#solve(steps, position + 1, binding, premises, delta, emit);\n switch (step.kind) {\n case 'scan': {\n const values = step.bound.map(({ ref }) => resolveBound(ref, binding));\n const tuples =\n position === 0 && delta\n ? delta.filter((tuple) => step.bound.every(({ column }, at) => tuple[column] === values[at]))\n : this.#relation(step.relation).lookup(\n step.bound.map(({ column }) => column),\n values,\n );\n for (const tuple of tuples) {\n const assigned: number[] = [];\n let matches = true;\n for (const { column, slot } of step.binds) {\n const current = binding[slot];\n if (current === undefined) {\n binding[slot] = tuple[column];\n assigned.push(slot);\n } else if (current !== tuple[column]) {\n matches = false;\n break;\n }\n }\n if (matches) {\n premises.push({ relation: step.relation, tuple });\n next();\n premises.pop();\n }\n for (const slot of assigned) {\n binding[slot] = undefined;\n }\n }\n return;\n }\n case 'negation': {\n const matches = this.#relation(step.relation).lookup(\n step.bound.map(({ column }) => column),\n step.bound.map(({ ref }) => resolveBound(ref, binding)),\n );\n if (isEmpty(matches)) {\n next();\n }\n return;\n }\n case 'compare': {\n if (step.assign) {\n binding[step.assign.slot] = resolve(step.assign.from, binding);\n next();\n binding[step.assign.slot] = undefined;\n return;\n }\n const left = resolve(step.left, binding);\n const right = resolve(step.right, binding);\n if (left !== undefined && right !== undefined && compare(step.operator, left, right)) {\n next();\n }\n return;\n }\n case 'builtin': {\n const args = step.args.map((ref, index) => (step.free[index] ? undefined : resolve(ref, binding)));\n const results = step.builtin.evaluate(args);\n if (step.negated) {\n if (isEmpty(results)) {\n next();\n }\n return;\n }\n for (const result of results) {\n if (result.length !== step.args.length) {\n continue;\n }\n const assigned: number[] = [];\n let matches = true;\n for (let index = 0; index < step.args.length && matches; index++) {\n const ref = step.args[index];\n if (ref.kind === 'wild') {\n continue;\n }\n if (ref.kind === 'slot' && binding[ref.slot] === undefined) {\n binding[ref.slot] = result[index];\n assigned.push(ref.slot);\n } else {\n matches = resolve(ref, binding) === result[index];\n }\n }\n if (matches) {\n next();\n }\n for (const slot of assigned) {\n binding[slot] = undefined;\n }\n }\n return;\n }\n case 'aggregate': {\n const seen = new Set<string>();\n const targets: Ast.Value[] = [];\n const matched: Entry[] = [];\n this.#solve(step.steps, 0, binding, matched, undefined, () => {\n // Matched tuples join the key so anonymous columns still count as distinct rows.\n const key = [\n ...step.local.map((slot) => valueKey(resolveBound({ kind: 'slot', slot }, binding))),\n ...matched.map(({ relation, tuple }) => `${relation}\\u0002${tupleKey(tuple)}`),\n ].join('\\u0001');\n if (!seen.has(key)) {\n seen.add(key);\n const target = step.target ? resolve(step.target, binding) : undefined;\n if (target !== undefined) {\n targets.push(target);\n }\n }\n });\n const value = aggregate(step.function, seen.size, targets);\n if (value === undefined) {\n return;\n }\n if (step.assignResult && step.result.kind === 'slot') {\n binding[step.result.slot] = value;\n next();\n binding[step.result.slot] = undefined;\n } else if (step.result.kind === 'wild' || resolve(step.result, binding) === value) {\n next();\n }\n }\n }\n }\n}\n\n/** Creates an engine and evaluates the program's facts. */\nexport const make = (options: Options): Engine => new Engine(options);\n\ntype Emitted = { readonly relation: string; readonly tuple: Ast.Tuple; readonly derivation?: Derivation };\n\nconst push = (map: Map<string, Ast.Tuple[]>, relation: string, tuple: Ast.Tuple) => {\n const list = map.get(relation);\n if (list) {\n list.push(tuple);\n } else {\n map.set(relation, [tuple]);\n }\n};\n\nconst resolve = (ref: Ref, binding: ReadonlyArray<Ast.Value | undefined>): Ast.Value | undefined => {\n switch (ref.kind) {\n case 'const':\n return ref.value;\n case 'slot':\n return binding[ref.slot];\n case 'wild':\n return undefined;\n }\n};\n\n/** Planned steps only read slots an earlier step bound. */\nconst resolveBound = (ref: Ref, binding: ReadonlyArray<Ast.Value | undefined>): Ast.Value => {\n const value = resolve(ref, binding);\n if (value === undefined) {\n throw new Error('Unbound variable in planned step.');\n }\n return value;\n};\n\nconst isEmpty = (iterable: Iterable<unknown>): boolean => iterable[Symbol.iterator]().next().done === true;\n\nconst compare = (operator: Ast.ComparisonOperator, left: Ast.Value, right: Ast.Value): boolean => {\n switch (operator) {\n case '=':\n return left === right;\n case '!=':\n return left !== right;\n case '<':\n return compareValues(left, right) < 0;\n case '<=':\n return compareValues(left, right) <= 0;\n case '>':\n return compareValues(left, right) > 0;\n case '>=':\n return compareValues(left, right) >= 0;\n }\n};\n\nconst aggregate = (\n fn: Ast.AggregateFunction,\n count: number,\n targets: ReadonlyArray<Ast.Value>,\n): Ast.Value | undefined => {\n switch (fn) {\n case 'count':\n return count;\n case 'sum':\n return targets.reduce<number>((sum, value) => sum + (typeof value === 'number' ? value : Number(value)), 0);\n case 'min':\n return targets.length === 0\n ? undefined\n : targets.reduce((min, value) => (compareValues(value, min) < 0 ? value : min));\n case 'max':\n return targets.length === 0\n ? undefined\n : targets.reduce((max, value) => (compareValues(value, max) > 0 ? value : max));\n }\n};\n"],"mappings":";;;;;AAOA,IAAa,YAAY,UAA8B,OAAO,UAAU,WAAW,IAAI,UAAU,IAAI;AAErG,IAAa,YAAY,UAA6B,MAAM,IAAI,QAAQ,CAAC,CAAC,KAAK,GAAQ;;AAGvF,IAAa,iBAAiB,MAAiB,UAA6B;CAC1E,IAAI,OAAO,SAAS,YAAY,OAAO,UAAU,UAC/C,OAAO,OAAO;CAEhB,IAAI,OAAO,SAAS,UAClB,OAAO;CAET,IAAI,OAAO,UAAU,UACnB,OAAO;CAET,OAAO,OAAO,QAAQ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AAc,OAAO,GAAG,IAAI,IAAI,QAAQ,GAAI;EAClF,KAAK,OACH,OAAO,QAAQ,WAAW,IACtB,KAAA,IACA,QAAQ,QAAQ,KAAK,UAAW,cAAc,OAAO,GAAG,IAAI,IAAI,QAAQ,GAAI;CACpF;AACF"}
@@ -1,5 +1,5 @@
1
- import { t as Ast_exports } from "./Ast.mjs";
2
- import { t as Builtin_exports } from "./Builtin.mjs";
1
+ import { t as Ast_exports } from "./chunk-Ast.mjs";
2
+ import { t as Builtin_exports } from "./chunk-Builtin.mjs";
3
3
  import { n as Checker_exports } from "./chunk-Checker.mjs";
4
4
  import { n as Engine_exports } from "./chunk-Engine.mjs";
5
5
  import { n as Parser_exports } from "./chunk-Parser.mjs";
@@ -1 +1 @@
1
- {"version":"7.0.2+effect-tsgo.0.36.5","root":[[88,89],[143,154]],"packageJsons":["../../../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/package.json","../../../../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/package.json","../../../../../node_modules/.pnpm/@types+chai@5.2.2/node_modules/@types/chai/package.json","../../../../../node_modules/.pnpm/@types+deep-eql@4.0.2/node_modules/@types/deep-eql/package.json","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/package.json","../../../../../node_modules/.pnpm/@vitest+browser-playwright@4.1.10_playwright@1.63.0_vite@8.2.1_@types+node@22.10.2_esbu_17b46e5799c04999268d95170b4ef023/node_modules/@vitest/browser-playwright/package.json","../../../../../node_modules/.pnpm/@vitest+coverage-v8@4.1.10_@vitest+browser@4.1.10_vitest@4.1.10/node_modules/@vitest/coverage-v8/package.json","../../../../../node_modules/.pnpm/@vitest+expect@4.1.10/node_modules/@vitest/expect/package.json","../../../../../node_modules/.pnpm/@vitest+mocker@4.1.10_vite@8.2.1_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0_/node_modules/@vitest/mocker/package.json","../../../../../node_modules/.pnpm/@vitest+pretty-format@4.1.10/node_modules/@vitest/pretty-format/package.json","../../../../../node_modules/.pnpm/@vitest+runner@4.1.10/node_modules/@vitest/runner/package.json","../../../../../node_modules/.pnpm/@vitest+snapshot@4.1.10/node_modules/@vitest/snapshot/package.json","../../../../../node_modules/.pnpm/@vitest+spy@4.1.10/node_modules/@vitest/spy/package.json","../../../../../node_modules/.pnpm/@vitest+ui@4.1.10_vitest@4.1.10/node_modules/@vitest/ui/package.json","../../../../../node_modules/.pnpm/@vitest+utils@4.1.10/node_modules/@vitest/utils/package.json","../../../../../node_modules/.pnpm/chai@6.2.2/node_modules/chai/package.json","../../../../../node_modules/.pnpm/esbuild@0.28.2/node_modules/esbuild/package.json","../../../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/package.json","../../../../../node_modules/.pnpm/happy-dom@20.7.0/node_modules/happy-dom/package.json","../../../../../node_modules/.pnpm/jiti@2.7.0/node_modules/jiti/package.json","../../../../../node_modules/.pnpm/jsdom@29.1.1_@noble+hashes@1.8.0_canvas@3.2.0/node_modules/jsdom/package.json","../../../../../node_modules/.pnpm/terser@5.46.0/node_modules/terser/package.json","../../../../../node_modules/.pnpm/tinybench@2.9.0/node_modules/tinybench/package.json","../../../../../node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/package.json","../../../../../node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/package.json","../../../../../node_modules/.pnpm/vite@8.2.1_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0/node_modules/vite/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/package.json","../../../../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/package.json","../../package.json","../../../errors/package.json"],"missingPackageJsons":["../../../../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/package.json","../../../../../node_modules/.pnpm/@types+chai@5.2.2/node_modules/deep-eql/package.json","../../../../../node_modules/.pnpm/@vitest+expect@4.1.10/node_modules/@vitest/expect/dist/package.json","../../../../../node_modules/.pnpm/@vitest+expect@4.1.10/node_modules/@vitest/utils/diff/package.json","../../../../../node_modules/.pnpm/@vitest+expect@4.1.10/node_modules/@vitest/utils/display/package.json","../../../../../node_modules/.pnpm/@vitest+mocker@4.1.10_vite@8.2.1_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0_/node_modules/@vitest/mocker/dist/package.json","../../../../../node_modules/.pnpm/@vitest+mocker@4.1.10_vite@8.2.1_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0_/node_modules/msw/package.json","../../../../../node_modules/.pnpm/@vitest+pretty-format@4.1.10/node_modules/@vitest/pretty-format/dist/package.json","../../../../../node_modules/.pnpm/@vitest+runner@4.1.10/node_modules/@vitest/runner/dist/package.json","../../../../../node_modules/.pnpm/@vitest+runner@4.1.10/node_modules/@vitest/utils/diff/package.json","../../../../../node_modules/.pnpm/@vitest+snapshot@4.1.10/node_modules/@vitest/snapshot/dist/package.json","../../../../../node_modules/.pnpm/@vitest+spy@4.1.10/node_modules/@vitest/spy/dist/package.json","../../../../../node_modules/.pnpm/@vitest+utils@4.1.10/node_modules/@vitest/utils/dist/package.json","../../../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/package.json","../../../../../node_modules/.pnpm/tinybench@2.9.0/node_modules/tinybench/dist/package.json","../../../../../node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/package.json","../../../../../node_modules/.pnpm/vite@8.2.1_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0/node_modules/@vitejs/devtools/package.json","../../../../../node_modules/.pnpm/vite@8.2.1_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0/node_modules/less/package.json","../../../../../node_modules/.pnpm/vite@8.2.1_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0/node_modules/sass-embedded/package.json","../../../../../node_modules/.pnpm/vite@8.2.1_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0/node_modules/sass/package.json","../../../../../node_modules/.pnpm/vite@8.2.1_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0/node_modules/stylus/package.json","../../../../../node_modules/.pnpm/vite@8.2.1_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0/node_modules/sugarss/package.json","../../../../../node_modules/.pnpm/vite@8.2.1_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0/node_modules/vite/dist/node/chunks/package.json","../../../../../node_modules/.pnpm/vite@8.2.1_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0/node_modules/vite/dist/node/package.json","../../../../../node_modules/.pnpm/vite@8.2.1_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0/node_modules/vite/dist/package.json","../../../../../node_modules/.pnpm/vite@8.2.1_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0/node_modules/vite/types/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/@edge-runtime/vm/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/@vitest/browser-preview/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/@vitest/browser-webdriverio/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/@vitest/coverage-istanbul/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/@vitest/runner/utils/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/@vitest/utils/diff/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vite/module-runner/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/dist/chunks/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/dist/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/node_modules/@vitest/expect/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/node_modules/@vitest/mocker/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/node_modules/@vitest/pretty-format/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/node_modules/@vitest/runner/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/node_modules/@vitest/runner/utils/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/node_modules/@vitest/snapshot/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/node_modules/@vitest/spy/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/node_modules/@vitest/utils/diff/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/node_modules/@vitest/utils/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/node_modules/expect-type/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/node_modules/tinybench/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/node_modules/vite/module-runner/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/node_modules/vite/package.json"],"fileNames":["lib.es5.d.ts","lib.es2015.d.ts","lib.es2016.d.ts","lib.es2017.d.ts","lib.es2018.d.ts","lib.es2019.d.ts","lib.es2020.d.ts","lib.es2021.d.ts","lib.es2022.d.ts","lib.es2023.d.ts","lib.es2024.d.ts","lib.es2025.d.ts","lib.esnext.d.ts","lib.es2015.core.d.ts","lib.es2015.collection.d.ts","lib.es2015.generator.d.ts","lib.es2015.iterable.d.ts","lib.es2015.promise.d.ts","lib.es2015.proxy.d.ts","lib.es2015.reflect.d.ts","lib.es2015.symbol.d.ts","lib.es2015.symbol.wellknown.d.ts","lib.es2016.array.include.d.ts","lib.es2016.intl.d.ts","lib.es2017.arraybuffer.d.ts","lib.es2017.date.d.ts","lib.es2017.object.d.ts","lib.es2017.sharedmemory.d.ts","lib.es2017.string.d.ts","lib.es2017.intl.d.ts","lib.es2017.typedarrays.d.ts","lib.es2018.asyncgenerator.d.ts","lib.es2018.asynciterable.d.ts","lib.es2018.intl.d.ts","lib.es2018.promise.d.ts","lib.es2018.regexp.d.ts","lib.es2019.array.d.ts","lib.es2019.object.d.ts","lib.es2019.string.d.ts","lib.es2019.symbol.d.ts","lib.es2019.intl.d.ts","lib.es2020.bigint.d.ts","lib.es2020.date.d.ts","lib.es2020.promise.d.ts","lib.es2020.sharedmemory.d.ts","lib.es2020.string.d.ts","lib.es2020.symbol.wellknown.d.ts","lib.es2020.intl.d.ts","lib.es2020.number.d.ts","lib.es2021.promise.d.ts","lib.es2021.string.d.ts","lib.es2021.weakref.d.ts","lib.es2021.intl.d.ts","lib.es2022.array.d.ts","lib.es2022.error.d.ts","lib.es2022.intl.d.ts","lib.es2022.object.d.ts","lib.es2022.string.d.ts","lib.es2022.regexp.d.ts","lib.es2023.array.d.ts","lib.es2023.collection.d.ts","lib.es2023.intl.d.ts","lib.es2024.arraybuffer.d.ts","lib.es2024.collection.d.ts","lib.es2024.object.d.ts","lib.es2024.promise.d.ts","lib.es2024.regexp.d.ts","lib.es2024.sharedmemory.d.ts","lib.es2024.string.d.ts","lib.es2025.collection.d.ts","lib.es2025.float16.d.ts","lib.es2025.intl.d.ts","lib.es2025.iterator.d.ts","lib.es2025.promise.d.ts","lib.es2025.regexp.d.ts","lib.esnext.array.d.ts","lib.esnext.collection.d.ts","lib.esnext.date.d.ts","lib.esnext.decorators.d.ts","lib.esnext.disposable.d.ts","lib.esnext.error.d.ts","lib.esnext.intl.d.ts","lib.esnext.sharedmemory.d.ts","lib.esnext.temporal.d.ts","lib.esnext.typedarrays.d.ts","lib.decorators.d.ts","lib.decorators.legacy.d.ts","../../src/Ast.ts","../../src/Builtin.ts","../../../../../node_modules/.pnpm/@vitest+pretty-format@4.1.10/node_modules/@vitest/pretty-format/dist/index.d.ts","../../../../../node_modules/.pnpm/@vitest+utils@4.1.10/node_modules/@vitest/utils/dist/display.d.ts","../../../../../node_modules/.pnpm/@vitest+utils@4.1.10/node_modules/@vitest/utils/dist/types.d.ts","../../../../../node_modules/.pnpm/@vitest+utils@4.1.10/node_modules/@vitest/utils/dist/helpers.d.ts","../../../../../node_modules/.pnpm/@vitest+utils@4.1.10/node_modules/@vitest/utils/dist/timers.d.ts","../../../../../node_modules/.pnpm/@vitest+utils@4.1.10/node_modules/@vitest/utils/dist/index.d.ts","../../../../../node_modules/.pnpm/@vitest+utils@4.1.10/node_modules/@vitest/utils/dist/types.d-BCElaP-c.d.ts","../../../../../node_modules/.pnpm/@vitest+utils@4.1.10/node_modules/@vitest/utils/dist/diff.d.ts","../../../../../node_modules/.pnpm/@vitest+runner@4.1.10/node_modules/@vitest/runner/dist/tasks.d-DEYaIMIu.d.ts","../../../../../node_modules/.pnpm/@vitest+runner@4.1.10/node_modules/@vitest/runner/dist/index.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/dist/chunks/traces.d.D2T_R8rx.d.ts","../../../../../node_modules/.pnpm/vite@8.2.1_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0/node_modules/vite/types/hmrPayload.d.ts","../../../../../node_modules/.pnpm/vite@8.2.1_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0/node_modules/vite/dist/node/chunks/moduleRunnerTransport.d.ts","../../../../../node_modules/.pnpm/vite@8.2.1_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0/node_modules/vite/types/customEvent.d.ts","../../../../../node_modules/.pnpm/vite@8.2.1_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0/node_modules/vite/types/hot.d.ts","../../../../../node_modules/.pnpm/vite@8.2.1_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0/node_modules/vite/dist/node/module-runner.d.ts","../../../../../node_modules/.pnpm/@vitest+snapshot@4.1.10/node_modules/@vitest/snapshot/dist/environment.d-DOJxxZV9.d.ts","../../../../../node_modules/.pnpm/@vitest+snapshot@4.1.10/node_modules/@vitest/snapshot/dist/rawSnapshot.d-D_X3-62x.d.ts","../../../../../node_modules/.pnpm/@vitest+snapshot@4.1.10/node_modules/@vitest/snapshot/dist/index.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/dist/chunks/config.d.A1h_Y6Jt.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/dist/chunks/environment.d.CrsxCzP1.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/dist/chunks/rpc.d.B_8sPU0w.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/dist/chunks/worker.d.ZpHpO4yb.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/dist/chunks/browser.d.BcoexmFG.d.ts","../../../../../node_modules/.pnpm/@vitest+spy@4.1.10/node_modules/@vitest/spy/optional-types.d.ts","../../../../../node_modules/.pnpm/@vitest+spy@4.1.10/node_modules/@vitest/spy/dist/index.d.ts","../../../../../node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.d.ts","../../../../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts","../../../../../node_modules/.pnpm/@types+deep-eql@4.0.2/node_modules/@types/deep-eql/index.d.ts","../../../../../node_modules/.pnpm/@types+chai@5.2.2/node_modules/@types/chai/index.d.ts","../../../../../node_modules/.pnpm/@vitest+expect@4.1.10/node_modules/@vitest/expect/dist/index.d.ts","../../../../../node_modules/.pnpm/@vitest+runner@4.1.10/node_modules/@vitest/runner/dist/utils.d.ts","../../../../../node_modules/.pnpm/tinybench@2.9.0/node_modules/tinybench/dist/index.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/dist/chunks/benchmark.d.DAaHLpsq.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/dist/chunks/global.d.DVsSRdQ5.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/optional-runtime-types.d.ts","../../../../../node_modules/.pnpm/@vitest+mocker@4.1.10_vite@8.2.1_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0_/node_modules/@vitest/mocker/dist/types.d-BjI5eAwu.d.ts","../../../../../node_modules/.pnpm/@vitest+mocker@4.1.10_vite@8.2.1_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0_/node_modules/@vitest/mocker/dist/index.d-B41z0AuW.d.ts","../../../../../node_modules/.pnpm/@vitest+mocker@4.1.10_vite@8.2.1_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.0_/node_modules/@vitest/mocker/dist/index.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/dist/chunks/suite.d.udJtyAgw.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/dist/chunks/evaluatedModules.d.BxJ5omdx.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/dist/runners.d.ts","../../../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/utils.d.ts","../../../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/overloads.d.ts","../../../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/branding.d.ts","../../../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/messages.d.ts","../../../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/index.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_c9f0315717434532fb4d0b81d334c05e/node_modules/vitest/dist/index.d.ts","../../../errors/dist/types/src/base.d.ts","../../../errors/dist/types/src/cancellation.d.ts","../../../errors/dist/types/src/context.d.ts","../../../errors/dist/types/src/errors.d.ts","../../../errors/dist/types/src/index.d.ts","../../src/internal/plan.ts","../../src/internal/stratify.ts","../../src/Checker.ts","../../src/internal/lexer.ts","../../src/Parser.ts","../../src/Checker.test.ts","../../src/internal/relation.ts","../../src/Engine.ts","../../src/Engine.test.ts","../../src/Engine.workerd.test.ts","../../src/Parser.test.ts","../../src/index.ts"],"fileInfos":[{"version":"16934abaab7026ac114da441aabea1a0","affectsGlobalScope":true,"impliedNodeFormat":1},"d4306fb2e47f74835e8674ffac07d76f","e437c5c1302869326c3bb93da85bbbcf","e4324975a566567b21d350615f1fc6ac","333b1b9a2a9ac3b8497dba5c63b5ba50","6cffacd662b6eb5fa7a36aa2ea366bfa","b4c34f9c23304dbef2d23698637ed638","e5cb86a5fc491796ecd1d2dd348d208f","feb6c6fb19cdb246a5d8acb36a6901c7","9443a7f109277ffaa79d893ed2549995","793cee405385076e27c24f409659dccd","09f69c6610266eaee1ac9e3e30df2c71","62bad718844246b8e17547f37bad6085",{"version":"926204c28cd3d073865348473ae28d2e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f25e42c801b2cb3cf2b39792006a9beb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6344b55f26a4e81d9608777dbfb877dd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3c0ed28e53d3695b363e256ec1c023fd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4c2761daba7f17141c25baa0821ac5da","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b87656acabd63e69379ff6ffcfe52fc7","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"597469522da047a5af5222cc6989f405","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1708ea4d34dc37fadadc63ca01127e80","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"55d97a8c6fbf34a30450a7b1e5f7a298","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0ee05eb59426d33e374226d8dcfa708b","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e347c14030993906efcfbb88915b6a05","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b0231263857c9b6a03641acdc9280ceb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3b15c4a83b598cacb4067676e6f0abed","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b417d97b7934cef63b1889abec0bbfbf","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"09a6cf4032ebba60ce22a501e663f881","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2b056277dd138e8f5650fc04e20eaa8d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e22cc07e3f3cc242ba52fa3f8ea1fc58","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2c45da767a1bfbb220848df1bc4029e4","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b44c3e0fbaf2130cdcf6ac38b120ffa1","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b612fb5cf8e5d964b92063a75207632a","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02705151a5e1551b9162a9ed8ab763f7","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"41025e398be9215d32e4337335da8f0b","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"52684c2b1f353a5538e4f275182a54cd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6dedb6a4f90d1df3a6fbe5693e44886c","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ca3f36fe3562c07e0f0d71c2bebd3f6d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"409974d6129befbb8226ddd1c6558568","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4d9cfde2a1ae1b4925f1f9bc10848e5d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7e1daecc66dd564144e3bb1a0266b5fd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a8e1d9bb35fd0637f2f9fd2b2a54f2ec","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4f168501772a6543182765bfd5f2fbfe","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a19c80aad1b2162103496f5ba293a732","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b69afa63cd5d059851c78adb2856ee09","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ae2fc5d954e9b0f5feee3d481b953c27","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1cfd3091a071d8b6feec15277643bafe","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1da2c1f258970fd3cc91184f69e91a9d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a0d87491913d843139e0c993650a3235","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4ef72aa378127e7b7abba915b0110b1e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3ec74c6a7d4463f0254db3a74cf75646","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"84c2bdfa470d075526cce6322d81b0b6","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0b3844c2b8c73e4e1ab91431411cad11","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4fc71cf4a15b8d99675a31df77f26e07","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d1b49564ddaeca3df5b6dbae925d2242","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6a25be566d60ccfc2d6e8b7bfdeefa83","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"8a20e27646985dfd58c57ca6566553dd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9969f02ad3cdcbf4f709405cda44167f","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c9be4792a7a4f42c15ae7360bf28779","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"8cf777fe00349b71ee9c4b6f3fe7fd19","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"74f96bc192530c9723f572bfff3d3078","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1df91c56b25955c56387426f378173c5","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"38856f70edcd2115c355d96ec77cc09e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"de8700156c1275465bcd473c28b359aa","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d47cfdb6ede40518357bb5a4cd7cd9fb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6e5773860cd9e5b15e683113f642ab47","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"30ff5fe1682f7fcd629880476ca3c2e0","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bf23d7d1b40b9015b694ddc2f011752f","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2cc585d42e2c548f9f24a30a1989fd33","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"713906ce9d332d2242b7f05ed9304be3","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0219894bfe5042c7e1aa2d22e4a91ed0","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6009ffff7e43c93318804d2d28e37fe3","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"03be89b227587594fbb50509fc1c2e45","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b30df52dc24740c0bad7c55c3511df7d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ab8d3c9b5ed5c2ab8f383607eef439f0","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d950ec671d0a8e07f3c1a31e94abed86","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1abef2ace5eccb02d60dd73cd5a5ee4c","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5f0a3044029d1cc081b5887eb4deb07","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d57c697f1446940ec4bfe669c962e2c4","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"be41035d7b941482a1e1ae6a5c5dcca5","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"10f7d9da7564f27f8ddf4a162b6da6d3","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1d0520af549e0c3581f15173cc713ca1","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d65083f97fd741cff028472563eddb79","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"da7f24f00653ebac660ac1c0821ed33d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7cb5ae9e65516ea2235f0721f6aac43c","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f64453cbf9671f28158677fa5c43967a","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"33f317af5428801f944a478d2c1e38e5","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1b70e8049e529cf7895ec26890fcea4b","signature":"457d8f74699257b6ec08b47046ca4ec0","impliedNodeFormat":1},{"version":"78f5430b29d9a530a750ce7b7bfe287b","signature":"582370d8d2e8113f5d2ee8942f59c813","impliedNodeFormat":1},{"version":"ed63d99e1e5c371dc120bef1b84057fc","impliedNodeFormat":99},{"version":"4d3fb552bfc7fb53c9195b2fafb512c0","impliedNodeFormat":99},{"version":"fbf7ba69043f86dc506ba28263e2e783","impliedNodeFormat":99},{"version":"a611eb6935df7737a77b34b01c631a4a","impliedNodeFormat":99},{"version":"6d08f6f1d0ee294c119d0e66f826331a","impliedNodeFormat":99},{"version":"d0abb8fa314728650d85450ff59db909","impliedNodeFormat":99},{"version":"abe007be89c2ad52c4d67fc2b0f6da6b","impliedNodeFormat":99},{"version":"ae1fe3925f3a2c8dfbb269ac2a50f5a6","impliedNodeFormat":99},{"version":"ee8ce731ff781ae7011350481a1af176","impliedNodeFormat":99},{"version":"08dcd98985ae16732a9be03d2b56aea6","impliedNodeFormat":99},{"version":"47f7401876f3c0a5b80bd01fbdfaed2b","impliedNodeFormat":99},{"version":"c740262327e60625eeb9d14da30af076","impliedNodeFormat":99},{"version":"3d553ca0b8e36d0e9f05a6b80fb3492d","impliedNodeFormat":99},{"version":"f5fb09fe1962bd4c63dc9d1fef0c41ae","impliedNodeFormat":99},{"version":"4aeb817c2b1122f77bdaeb4e884e9479","impliedNodeFormat":99},{"version":"31fca6603097de04dde1774dd2a14d9e","impliedNodeFormat":99},{"version":"0221e2868d1f0d6df8321d945764aadb","impliedNodeFormat":99},{"version":"d2f6ad6f161f0a522886f64842c96a0e","impliedNodeFormat":99},{"version":"618ace1500cc84e42bc2e47c64f8c407","impliedNodeFormat":99},{"version":"9dd3c481cc870c4bf19e59d34f030a27","impliedNodeFormat":99},{"version":"b5c81396e966d59acab5a45f66b70866","impliedNodeFormat":99},{"version":"f94aa434ddb9e71f6e80395de85f6850","impliedNodeFormat":99},{"version":"3486e8f7f01b9874a793ddd451eb62a5","impliedNodeFormat":99},{"version":"cb0e7222aae349c2fb4f89b26efa81bd","impliedNodeFormat":99},{"version":"b9129d694ae6cf810850117dda49d045","impliedNodeFormat":99},{"version":"0d7bbad7f82c886c5f36730065aec119","impliedNodeFormat":99},{"version":"369460c2755240ac2d3d006f09adb5ca","impliedNodeFormat":99},{"version":"4509fca76e721cdf9edb2d028395a117","impliedNodeFormat":99},"548472bfd4ebe2f1c8f494b960a27836",{"version":"31d11e53cef40d113a56c173ad0ac9f4","affectsGlobalScope":true,"impliedNodeFormat":99},{"version":"2c51637edf65b89d39356deff680ed36","affectsGlobalScope":true,"impliedNodeFormat":99},{"version":"0bf0efdacfd4bfadb631a4376097e382","impliedNodeFormat":99},{"version":"bd01f3bcdc72c9256e5cd5093d132df3","impliedNodeFormat":99},{"version":"b01bdc9acbaf3eb24eef464959e8e627","impliedNodeFormat":99},{"version":"2a75a1a065e5d0439fa1514d9c89b0eb","impliedNodeFormat":99},{"version":"b9129d694ae6cf810850117dda49d045","impliedNodeFormat":99},{"version":"c01d22bc96b89eedc0ed1f11d8c270ab","impliedNodeFormat":99},{"version":"c15bc5b81c64386efb6f85fb596c4349","impliedNodeFormat":99},{"version":"5794a694c1f75a9cc38cb5e9c757224e","impliedNodeFormat":99},{"version":"4040d5640775a803b2ca1aa914f7a1d4","impliedNodeFormat":99},{"version":"5ed96746ee2e7eb084ad54f0e0e518bc","impliedNodeFormat":99},{"version":"eba7786b00a4e551c36bafa71bfb1876","impliedNodeFormat":99},"8d8a98bf45979ce5401d9ca4027940cd","7d98e95d38525423bbe0f05e0a508a41","96920299d013de56061cbc74a1d658b2","439adabdf29be1212ec7acc292679f21","3eb46d20ed056dcbfa5e75bad9014661",{"version":"b46aa1886055db890de9be52a97b301e","impliedNodeFormat":99},"dac79954011d59a0085e6583f2ca67db","583f9212b45ab385cb533038c27b1e9d","f55774503d383236d8fbeb2aa8e653f5","6aa33a6665aad6e58ff483bff29b4c38","3735a36f58ae876645f237e112230508",{"version":"432f373767ce69ff84c4247bb0b6780f","signature":"39a359395ecdf5cfcca25c3a4c2c8cdb","impliedNodeFormat":1},{"version":"473f9984c9818061e94ef84210311947","signature":"b81f921a8251e426a926715121d0eed5","impliedNodeFormat":1},{"version":"33614ba45ae91c3fcd3b5695b1458141","signature":"4225f269cabd5cb6611cdd9385eb07b8","impliedNodeFormat":1},{"version":"56677af934ca34a6bd0a10e3c40d3b1f","signature":"6e93bb836ab24c29d472b0b58e1f93b0","impliedNodeFormat":1},{"version":"28ca4d82217696597934b0d13f1034fc","signature":"14a786575644c638427a0bd6f8de378c","impliedNodeFormat":1},{"version":"f664a2f3ca3d915515b849b04a803814","signature":"abe7d9981d6018efb6b2b794f40a1607","impliedNodeFormat":1},{"version":"59bcb852b24572a21ad2c61a86b76f12","signature":"662bfb32f527a9a3bd16a32152b48b11","impliedNodeFormat":1},{"version":"0b9aa557baa2454d014c1a0783374a9c","signature":"3c1b03d5506ef86754d6cb702ba3f6d2","impliedNodeFormat":1},{"version":"28ba4ed94d0eec65e9d7844df43cb746","signature":"abe7d9981d6018efb6b2b794f40a1607","impliedNodeFormat":1},{"version":"2ba4cd8b935292ad46d8ebbba0f82c88","signature":"abe7d9981d6018efb6b2b794f40a1607","impliedNodeFormat":1},{"version":"10b7d62672083f30b19ab0bd84a61b00","signature":"abe7d9981d6018efb6b2b794f40a1607","impliedNodeFormat":1},{"version":"ffee7d86e3924a7341e363a113944bac","signature":"a954c44d2af34b177fa4402bca73cf04","impliedNodeFormat":1}],"fileIdsList":[[118],[91,97,115,116,117,119],[126],[126,127],[95,97,98],[95,97],[95],[90,95,106,107],[90,95,106],[114],[90,96],[90],[92],[90,91,92,93,94],[132,133],[132,133,134,135],[132,134],[132],[101],[101,102,103,104],[103],[99,121,122,124],[99,100,112,124],[90,97,99,100,108,124],[105],[90,99,100,108,120,123],[99,100,105,108,124],[99,121,122,123,124],[99,105,109,110,111,124],[90,95,97,99,100,105,108,109,110,111,112,113,115,120,121,122,123,124,125,128,129,130,131,136],[90,97,99,100,108,109,121,122,123,124,129],[88],[89,137,145,147],[88,89,142,143,144],[88,89,137,145,147,150],[88,89,143,144,145,149],[89,137,147,150],[88,137,147],[88,142,146],[88,89,145,147,150],[88,142],[88,89],[138],[138,139,140,141]],"options":{"allowJs":false,"composite":true,"emitDeclarationOnly":true,"declaration":true,"declarationMap":true,"experimentalDecorators":true,"jsx":3,"module":200,"noImplicitOverride":true,"noUncheckedSideEffectImports":false,"outDir":"./","rewriteRelativeImportExtensions":true,"skipLibCheck":true,"strict":true,"stripInternal":true,"sourceMap":true,"target":99,"esModuleInterop":true},"effect":{"refactors":true,"diagnostics":true,"quickinfo":true,"completions":true,"goto":true,"renames":true,"ignoreEffectSuggestionsInTscExitCode":true,"namespaceImportPackages":["effect","@effect/*"],"topLevelNamedReexports":"follow","diagnosticSeverity":{}},"referencedMap":[[119,1],[120,2],[127,3],[128,4],[99,5],[98,6],[121,5],[106,7],[108,8],[107,9],[115,10],[97,11],[91,12],[93,13],[95,14],[96,12],[134,15],[136,16],[135,17],[133,18],[102,19],[105,20],[103,19],[104,21],[123,22],[113,23],[109,24],[110,7],[130,25],[124,26],[111,27],[129,28],[112,29],[137,30],[131,31],[89,32],[148,33],[145,34],[151,35],[150,36],[152,37],[153,38],[147,39],[154,40],[146,41],[143,42],[149,32],[144,42],[141,43],[142,44]],"latestChangedDtsFile":"./src/index.d.ts"}
1
+ {"version":"7.0.2+effect-tsgo.0.36.5","root":[[88,89],[143,154]],"packageJsons":["../../../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/package.json","../../../../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/package.json","../../../../../node_modules/.pnpm/@types+chai@5.2.2/node_modules/@types/chai/package.json","../../../../../node_modules/.pnpm/@types+deep-eql@4.0.2/node_modules/@types/deep-eql/package.json","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/package.json","../../../../../node_modules/.pnpm/@vitest+browser-playwright@4.1.10_playwright@1.63.0_vite@8.3.4_@types+node@22.10.2_esbu_bbef01595eae0ce6e2aa51233ef58645/node_modules/@vitest/browser-playwright/package.json","../../../../../node_modules/.pnpm/@vitest+coverage-v8@4.1.10_@vitest+browser@4.1.10_vitest@4.1.10/node_modules/@vitest/coverage-v8/package.json","../../../../../node_modules/.pnpm/@vitest+expect@4.1.10/node_modules/@vitest/expect/package.json","../../../../../node_modules/.pnpm/@vitest+mocker@4.1.10_vite@8.3.4_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.1_/node_modules/@vitest/mocker/package.json","../../../../../node_modules/.pnpm/@vitest+pretty-format@4.1.10/node_modules/@vitest/pretty-format/package.json","../../../../../node_modules/.pnpm/@vitest+runner@4.1.10/node_modules/@vitest/runner/package.json","../../../../../node_modules/.pnpm/@vitest+snapshot@4.1.10/node_modules/@vitest/snapshot/package.json","../../../../../node_modules/.pnpm/@vitest+spy@4.1.10/node_modules/@vitest/spy/package.json","../../../../../node_modules/.pnpm/@vitest+ui@4.1.10_vitest@4.1.10/node_modules/@vitest/ui/package.json","../../../../../node_modules/.pnpm/@vitest+utils@4.1.10/node_modules/@vitest/utils/package.json","../../../../../node_modules/.pnpm/chai@6.2.2/node_modules/chai/package.json","../../../../../node_modules/.pnpm/esbuild@0.28.2/node_modules/esbuild/package.json","../../../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/package.json","../../../../../node_modules/.pnpm/happy-dom@20.7.0/node_modules/happy-dom/package.json","../../../../../node_modules/.pnpm/jiti@2.7.0/node_modules/jiti/package.json","../../../../../node_modules/.pnpm/jsdom@29.1.1_@noble+hashes@1.8.0_canvas@3.2.0/node_modules/jsdom/package.json","../../../../../node_modules/.pnpm/terser@5.46.0/node_modules/terser/package.json","../../../../../node_modules/.pnpm/tinybench@2.9.0/node_modules/tinybench/package.json","../../../../../node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/package.json","../../../../../node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/package.json","../../../../../node_modules/.pnpm/vite@8.3.4_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.1/node_modules/vite/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/package.json","../../../../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/package.json","../../package.json","../../../errors/package.json"],"missingPackageJsons":["../../../../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/package.json","../../../../../node_modules/.pnpm/@types+chai@5.2.2/node_modules/deep-eql/package.json","../../../../../node_modules/.pnpm/@vitest+expect@4.1.10/node_modules/@vitest/expect/dist/package.json","../../../../../node_modules/.pnpm/@vitest+expect@4.1.10/node_modules/@vitest/utils/diff/package.json","../../../../../node_modules/.pnpm/@vitest+expect@4.1.10/node_modules/@vitest/utils/display/package.json","../../../../../node_modules/.pnpm/@vitest+mocker@4.1.10_vite@8.3.4_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.1_/node_modules/@vitest/mocker/dist/package.json","../../../../../node_modules/.pnpm/@vitest+mocker@4.1.10_vite@8.3.4_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.1_/node_modules/msw/package.json","../../../../../node_modules/.pnpm/@vitest+pretty-format@4.1.10/node_modules/@vitest/pretty-format/dist/package.json","../../../../../node_modules/.pnpm/@vitest+runner@4.1.10/node_modules/@vitest/runner/dist/package.json","../../../../../node_modules/.pnpm/@vitest+runner@4.1.10/node_modules/@vitest/utils/diff/package.json","../../../../../node_modules/.pnpm/@vitest+snapshot@4.1.10/node_modules/@vitest/snapshot/dist/package.json","../../../../../node_modules/.pnpm/@vitest+spy@4.1.10/node_modules/@vitest/spy/dist/package.json","../../../../../node_modules/.pnpm/@vitest+utils@4.1.10/node_modules/@vitest/utils/dist/package.json","../../../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/package.json","../../../../../node_modules/.pnpm/tinybench@2.9.0/node_modules/tinybench/dist/package.json","../../../../../node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/package.json","../../../../../node_modules/.pnpm/vite@8.3.4_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.1/node_modules/@vitejs/devtools/package.json","../../../../../node_modules/.pnpm/vite@8.3.4_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.1/node_modules/less/package.json","../../../../../node_modules/.pnpm/vite@8.3.4_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.1/node_modules/sass-embedded/package.json","../../../../../node_modules/.pnpm/vite@8.3.4_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.1/node_modules/sass/package.json","../../../../../node_modules/.pnpm/vite@8.3.4_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.1/node_modules/stylus/package.json","../../../../../node_modules/.pnpm/vite@8.3.4_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.1/node_modules/sugarss/package.json","../../../../../node_modules/.pnpm/vite@8.3.4_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.1/node_modules/vite/dist/node/chunks/package.json","../../../../../node_modules/.pnpm/vite@8.3.4_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.1/node_modules/vite/dist/node/package.json","../../../../../node_modules/.pnpm/vite@8.3.4_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.1/node_modules/vite/dist/package.json","../../../../../node_modules/.pnpm/vite@8.3.4_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.1/node_modules/vite/types/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/@edge-runtime/vm/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/@vitest/browser-preview/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/@vitest/browser-webdriverio/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/@vitest/coverage-istanbul/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/@vitest/runner/utils/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/@vitest/utils/diff/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vite/module-runner/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/dist/chunks/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/dist/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/node_modules/@vitest/expect/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/node_modules/@vitest/mocker/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/node_modules/@vitest/pretty-format/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/node_modules/@vitest/runner/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/node_modules/@vitest/runner/utils/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/node_modules/@vitest/snapshot/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/node_modules/@vitest/spy/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/node_modules/@vitest/utils/diff/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/node_modules/@vitest/utils/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/node_modules/expect-type/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/node_modules/tinybench/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/node_modules/vite/module-runner/package.json","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/node_modules/vite/package.json"],"fileNames":["lib.es5.d.ts","lib.es2015.d.ts","lib.es2016.d.ts","lib.es2017.d.ts","lib.es2018.d.ts","lib.es2019.d.ts","lib.es2020.d.ts","lib.es2021.d.ts","lib.es2022.d.ts","lib.es2023.d.ts","lib.es2024.d.ts","lib.es2025.d.ts","lib.esnext.d.ts","lib.es2015.core.d.ts","lib.es2015.collection.d.ts","lib.es2015.generator.d.ts","lib.es2015.iterable.d.ts","lib.es2015.promise.d.ts","lib.es2015.proxy.d.ts","lib.es2015.reflect.d.ts","lib.es2015.symbol.d.ts","lib.es2015.symbol.wellknown.d.ts","lib.es2016.array.include.d.ts","lib.es2016.intl.d.ts","lib.es2017.arraybuffer.d.ts","lib.es2017.date.d.ts","lib.es2017.object.d.ts","lib.es2017.sharedmemory.d.ts","lib.es2017.string.d.ts","lib.es2017.intl.d.ts","lib.es2017.typedarrays.d.ts","lib.es2018.asyncgenerator.d.ts","lib.es2018.asynciterable.d.ts","lib.es2018.intl.d.ts","lib.es2018.promise.d.ts","lib.es2018.regexp.d.ts","lib.es2019.array.d.ts","lib.es2019.object.d.ts","lib.es2019.string.d.ts","lib.es2019.symbol.d.ts","lib.es2019.intl.d.ts","lib.es2020.bigint.d.ts","lib.es2020.date.d.ts","lib.es2020.promise.d.ts","lib.es2020.sharedmemory.d.ts","lib.es2020.string.d.ts","lib.es2020.symbol.wellknown.d.ts","lib.es2020.intl.d.ts","lib.es2020.number.d.ts","lib.es2021.promise.d.ts","lib.es2021.string.d.ts","lib.es2021.weakref.d.ts","lib.es2021.intl.d.ts","lib.es2022.array.d.ts","lib.es2022.error.d.ts","lib.es2022.intl.d.ts","lib.es2022.object.d.ts","lib.es2022.string.d.ts","lib.es2022.regexp.d.ts","lib.es2023.array.d.ts","lib.es2023.collection.d.ts","lib.es2023.intl.d.ts","lib.es2024.arraybuffer.d.ts","lib.es2024.collection.d.ts","lib.es2024.object.d.ts","lib.es2024.promise.d.ts","lib.es2024.regexp.d.ts","lib.es2024.sharedmemory.d.ts","lib.es2024.string.d.ts","lib.es2025.collection.d.ts","lib.es2025.float16.d.ts","lib.es2025.intl.d.ts","lib.es2025.iterator.d.ts","lib.es2025.promise.d.ts","lib.es2025.regexp.d.ts","lib.esnext.array.d.ts","lib.esnext.collection.d.ts","lib.esnext.date.d.ts","lib.esnext.decorators.d.ts","lib.esnext.disposable.d.ts","lib.esnext.error.d.ts","lib.esnext.intl.d.ts","lib.esnext.sharedmemory.d.ts","lib.esnext.temporal.d.ts","lib.esnext.typedarrays.d.ts","lib.decorators.d.ts","lib.decorators.legacy.d.ts","../../src/Ast.ts","../../src/Builtin.ts","../../../../../node_modules/.pnpm/@vitest+pretty-format@4.1.10/node_modules/@vitest/pretty-format/dist/index.d.ts","../../../../../node_modules/.pnpm/@vitest+utils@4.1.10/node_modules/@vitest/utils/dist/display.d.ts","../../../../../node_modules/.pnpm/@vitest+utils@4.1.10/node_modules/@vitest/utils/dist/types.d.ts","../../../../../node_modules/.pnpm/@vitest+utils@4.1.10/node_modules/@vitest/utils/dist/helpers.d.ts","../../../../../node_modules/.pnpm/@vitest+utils@4.1.10/node_modules/@vitest/utils/dist/timers.d.ts","../../../../../node_modules/.pnpm/@vitest+utils@4.1.10/node_modules/@vitest/utils/dist/index.d.ts","../../../../../node_modules/.pnpm/@vitest+utils@4.1.10/node_modules/@vitest/utils/dist/types.d-BCElaP-c.d.ts","../../../../../node_modules/.pnpm/@vitest+utils@4.1.10/node_modules/@vitest/utils/dist/diff.d.ts","../../../../../node_modules/.pnpm/@vitest+runner@4.1.10/node_modules/@vitest/runner/dist/tasks.d-DEYaIMIu.d.ts","../../../../../node_modules/.pnpm/@vitest+runner@4.1.10/node_modules/@vitest/runner/dist/index.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/dist/chunks/traces.d.D2T_R8rx.d.ts","../../../../../node_modules/.pnpm/vite@8.3.4_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.1/node_modules/vite/types/hmrPayload.d.ts","../../../../../node_modules/.pnpm/vite@8.3.4_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.1/node_modules/vite/dist/node/chunks/moduleRunnerTransport.d.ts","../../../../../node_modules/.pnpm/vite@8.3.4_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.1/node_modules/vite/types/customEvent.d.ts","../../../../../node_modules/.pnpm/vite@8.3.4_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.1/node_modules/vite/types/hot.d.ts","../../../../../node_modules/.pnpm/vite@8.3.4_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.1/node_modules/vite/dist/node/module-runner.d.ts","../../../../../node_modules/.pnpm/@vitest+snapshot@4.1.10/node_modules/@vitest/snapshot/dist/environment.d-DOJxxZV9.d.ts","../../../../../node_modules/.pnpm/@vitest+snapshot@4.1.10/node_modules/@vitest/snapshot/dist/rawSnapshot.d-D_X3-62x.d.ts","../../../../../node_modules/.pnpm/@vitest+snapshot@4.1.10/node_modules/@vitest/snapshot/dist/index.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/dist/chunks/config.d.A1h_Y6Jt.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/dist/chunks/environment.d.CrsxCzP1.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/dist/chunks/rpc.d.B_8sPU0w.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/dist/chunks/worker.d.ZpHpO4yb.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/dist/chunks/browser.d.BcoexmFG.d.ts","../../../../../node_modules/.pnpm/@vitest+spy@4.1.10/node_modules/@vitest/spy/optional-types.d.ts","../../../../../node_modules/.pnpm/@vitest+spy@4.1.10/node_modules/@vitest/spy/dist/index.d.ts","../../../../../node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.d.ts","../../../../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts","../../../../../node_modules/.pnpm/@types+deep-eql@4.0.2/node_modules/@types/deep-eql/index.d.ts","../../../../../node_modules/.pnpm/@types+chai@5.2.2/node_modules/@types/chai/index.d.ts","../../../../../node_modules/.pnpm/@vitest+expect@4.1.10/node_modules/@vitest/expect/dist/index.d.ts","../../../../../node_modules/.pnpm/@vitest+runner@4.1.10/node_modules/@vitest/runner/dist/utils.d.ts","../../../../../node_modules/.pnpm/tinybench@2.9.0/node_modules/tinybench/dist/index.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/dist/chunks/benchmark.d.DAaHLpsq.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/dist/chunks/global.d.DVsSRdQ5.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/optional-runtime-types.d.ts","../../../../../node_modules/.pnpm/@vitest+mocker@4.1.10_vite@8.3.4_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.1_/node_modules/@vitest/mocker/dist/types.d-BjI5eAwu.d.ts","../../../../../node_modules/.pnpm/@vitest+mocker@4.1.10_vite@8.3.4_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.1_/node_modules/@vitest/mocker/dist/index.d-B41z0AuW.d.ts","../../../../../node_modules/.pnpm/@vitest+mocker@4.1.10_vite@8.3.4_@types+node@22.10.2_esbuild@0.28.2_jiti@2.7.0_terser@5.46.0_tsx@4.21.0_yaml@2.9.1_/node_modules/@vitest/mocker/dist/index.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/dist/chunks/suite.d.udJtyAgw.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/dist/chunks/evaluatedModules.d.BxJ5omdx.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/dist/runners.d.ts","../../../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/utils.d.ts","../../../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/overloads.d.ts","../../../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/branding.d.ts","../../../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/messages.d.ts","../../../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/index.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.10_patch_hash=cd5269e90ad2a4447bb2266e101250c008959a6c1168a57c132f6b50281f65_6a35effccd1e4a6c0c4770a416eae99e/node_modules/vitest/dist/index.d.ts","../../../errors/dist/types/src/base.d.ts","../../../errors/dist/types/src/cancellation.d.ts","../../../errors/dist/types/src/context.d.ts","../../../errors/dist/types/src/errors.d.ts","../../../errors/dist/types/src/index.d.ts","../../src/internal/plan.ts","../../src/internal/stratify.ts","../../src/Checker.ts","../../src/internal/lexer.ts","../../src/Parser.ts","../../src/Checker.test.ts","../../src/internal/relation.ts","../../src/Engine.ts","../../src/Engine.test.ts","../../src/Engine.workerd.test.ts","../../src/Parser.test.ts","../../src/index.ts"],"fileInfos":[{"version":"16934abaab7026ac114da441aabea1a0","affectsGlobalScope":true,"impliedNodeFormat":1},"d4306fb2e47f74835e8674ffac07d76f","e437c5c1302869326c3bb93da85bbbcf","e4324975a566567b21d350615f1fc6ac","333b1b9a2a9ac3b8497dba5c63b5ba50","6cffacd662b6eb5fa7a36aa2ea366bfa","b4c34f9c23304dbef2d23698637ed638","e5cb86a5fc491796ecd1d2dd348d208f","feb6c6fb19cdb246a5d8acb36a6901c7","9443a7f109277ffaa79d893ed2549995","793cee405385076e27c24f409659dccd","09f69c6610266eaee1ac9e3e30df2c71","62bad718844246b8e17547f37bad6085",{"version":"926204c28cd3d073865348473ae28d2e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f25e42c801b2cb3cf2b39792006a9beb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6344b55f26a4e81d9608777dbfb877dd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3c0ed28e53d3695b363e256ec1c023fd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4c2761daba7f17141c25baa0821ac5da","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b87656acabd63e69379ff6ffcfe52fc7","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"597469522da047a5af5222cc6989f405","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1708ea4d34dc37fadadc63ca01127e80","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"55d97a8c6fbf34a30450a7b1e5f7a298","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0ee05eb59426d33e374226d8dcfa708b","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e347c14030993906efcfbb88915b6a05","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b0231263857c9b6a03641acdc9280ceb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3b15c4a83b598cacb4067676e6f0abed","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b417d97b7934cef63b1889abec0bbfbf","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"09a6cf4032ebba60ce22a501e663f881","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2b056277dd138e8f5650fc04e20eaa8d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e22cc07e3f3cc242ba52fa3f8ea1fc58","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2c45da767a1bfbb220848df1bc4029e4","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b44c3e0fbaf2130cdcf6ac38b120ffa1","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b612fb5cf8e5d964b92063a75207632a","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02705151a5e1551b9162a9ed8ab763f7","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"41025e398be9215d32e4337335da8f0b","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"52684c2b1f353a5538e4f275182a54cd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6dedb6a4f90d1df3a6fbe5693e44886c","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ca3f36fe3562c07e0f0d71c2bebd3f6d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"409974d6129befbb8226ddd1c6558568","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4d9cfde2a1ae1b4925f1f9bc10848e5d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7e1daecc66dd564144e3bb1a0266b5fd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a8e1d9bb35fd0637f2f9fd2b2a54f2ec","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4f168501772a6543182765bfd5f2fbfe","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a19c80aad1b2162103496f5ba293a732","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b69afa63cd5d059851c78adb2856ee09","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ae2fc5d954e9b0f5feee3d481b953c27","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1cfd3091a071d8b6feec15277643bafe","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1da2c1f258970fd3cc91184f69e91a9d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a0d87491913d843139e0c993650a3235","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4ef72aa378127e7b7abba915b0110b1e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3ec74c6a7d4463f0254db3a74cf75646","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"84c2bdfa470d075526cce6322d81b0b6","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0b3844c2b8c73e4e1ab91431411cad11","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4fc71cf4a15b8d99675a31df77f26e07","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d1b49564ddaeca3df5b6dbae925d2242","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6a25be566d60ccfc2d6e8b7bfdeefa83","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"8a20e27646985dfd58c57ca6566553dd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9969f02ad3cdcbf4f709405cda44167f","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c9be4792a7a4f42c15ae7360bf28779","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"8cf777fe00349b71ee9c4b6f3fe7fd19","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"74f96bc192530c9723f572bfff3d3078","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1df91c56b25955c56387426f378173c5","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"38856f70edcd2115c355d96ec77cc09e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"de8700156c1275465bcd473c28b359aa","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d47cfdb6ede40518357bb5a4cd7cd9fb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6e5773860cd9e5b15e683113f642ab47","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"30ff5fe1682f7fcd629880476ca3c2e0","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bf23d7d1b40b9015b694ddc2f011752f","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2cc585d42e2c548f9f24a30a1989fd33","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"713906ce9d332d2242b7f05ed9304be3","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0219894bfe5042c7e1aa2d22e4a91ed0","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6009ffff7e43c93318804d2d28e37fe3","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"03be89b227587594fbb50509fc1c2e45","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b30df52dc24740c0bad7c55c3511df7d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ab8d3c9b5ed5c2ab8f383607eef439f0","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d950ec671d0a8e07f3c1a31e94abed86","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1abef2ace5eccb02d60dd73cd5a5ee4c","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5f0a3044029d1cc081b5887eb4deb07","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d57c697f1446940ec4bfe669c962e2c4","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"be41035d7b941482a1e1ae6a5c5dcca5","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"10f7d9da7564f27f8ddf4a162b6da6d3","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1d0520af549e0c3581f15173cc713ca1","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d65083f97fd741cff028472563eddb79","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"da7f24f00653ebac660ac1c0821ed33d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7cb5ae9e65516ea2235f0721f6aac43c","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f64453cbf9671f28158677fa5c43967a","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"33f317af5428801f944a478d2c1e38e5","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1b70e8049e529cf7895ec26890fcea4b","signature":"457d8f74699257b6ec08b47046ca4ec0","impliedNodeFormat":1},{"version":"78f5430b29d9a530a750ce7b7bfe287b","signature":"582370d8d2e8113f5d2ee8942f59c813","impliedNodeFormat":1},{"version":"ed63d99e1e5c371dc120bef1b84057fc","impliedNodeFormat":99},{"version":"4d3fb552bfc7fb53c9195b2fafb512c0","impliedNodeFormat":99},{"version":"fbf7ba69043f86dc506ba28263e2e783","impliedNodeFormat":99},{"version":"a611eb6935df7737a77b34b01c631a4a","impliedNodeFormat":99},{"version":"6d08f6f1d0ee294c119d0e66f826331a","impliedNodeFormat":99},{"version":"d0abb8fa314728650d85450ff59db909","impliedNodeFormat":99},{"version":"abe007be89c2ad52c4d67fc2b0f6da6b","impliedNodeFormat":99},{"version":"ae1fe3925f3a2c8dfbb269ac2a50f5a6","impliedNodeFormat":99},{"version":"ee8ce731ff781ae7011350481a1af176","impliedNodeFormat":99},{"version":"08dcd98985ae16732a9be03d2b56aea6","impliedNodeFormat":99},{"version":"47f7401876f3c0a5b80bd01fbdfaed2b","impliedNodeFormat":99},{"version":"0bc3d267b3625082350f29596e103fe8","impliedNodeFormat":99},{"version":"3d553ca0b8e36d0e9f05a6b80fb3492d","impliedNodeFormat":99},{"version":"b2e1f1a76cd60c84c29ae603431fd823","impliedNodeFormat":99},{"version":"4aeb817c2b1122f77bdaeb4e884e9479","impliedNodeFormat":99},{"version":"ff6e9c116461861d7012de4926be4641","impliedNodeFormat":99},{"version":"0221e2868d1f0d6df8321d945764aadb","impliedNodeFormat":99},{"version":"d2f6ad6f161f0a522886f64842c96a0e","impliedNodeFormat":99},{"version":"618ace1500cc84e42bc2e47c64f8c407","impliedNodeFormat":99},{"version":"9dd3c481cc870c4bf19e59d34f030a27","impliedNodeFormat":99},{"version":"b5c81396e966d59acab5a45f66b70866","impliedNodeFormat":99},{"version":"f94aa434ddb9e71f6e80395de85f6850","impliedNodeFormat":99},{"version":"3486e8f7f01b9874a793ddd451eb62a5","impliedNodeFormat":99},{"version":"cb0e7222aae349c2fb4f89b26efa81bd","impliedNodeFormat":99},{"version":"b9129d694ae6cf810850117dda49d045","impliedNodeFormat":99},{"version":"0d7bbad7f82c886c5f36730065aec119","impliedNodeFormat":99},{"version":"369460c2755240ac2d3d006f09adb5ca","impliedNodeFormat":99},{"version":"4509fca76e721cdf9edb2d028395a117","impliedNodeFormat":99},"548472bfd4ebe2f1c8f494b960a27836",{"version":"31d11e53cef40d113a56c173ad0ac9f4","affectsGlobalScope":true,"impliedNodeFormat":99},{"version":"2c51637edf65b89d39356deff680ed36","affectsGlobalScope":true,"impliedNodeFormat":99},{"version":"0bf0efdacfd4bfadb631a4376097e382","impliedNodeFormat":99},{"version":"bd01f3bcdc72c9256e5cd5093d132df3","impliedNodeFormat":99},{"version":"b01bdc9acbaf3eb24eef464959e8e627","impliedNodeFormat":99},{"version":"2a75a1a065e5d0439fa1514d9c89b0eb","impliedNodeFormat":99},{"version":"b9129d694ae6cf810850117dda49d045","impliedNodeFormat":99},{"version":"c01d22bc96b89eedc0ed1f11d8c270ab","impliedNodeFormat":99},{"version":"c15bc5b81c64386efb6f85fb596c4349","impliedNodeFormat":99},{"version":"5794a694c1f75a9cc38cb5e9c757224e","impliedNodeFormat":99},{"version":"4040d5640775a803b2ca1aa914f7a1d4","impliedNodeFormat":99},{"version":"5ed96746ee2e7eb084ad54f0e0e518bc","impliedNodeFormat":99},{"version":"eba7786b00a4e551c36bafa71bfb1876","impliedNodeFormat":99},"8d8a98bf45979ce5401d9ca4027940cd","7d98e95d38525423bbe0f05e0a508a41","96920299d013de56061cbc74a1d658b2","439adabdf29be1212ec7acc292679f21","3eb46d20ed056dcbfa5e75bad9014661",{"version":"b46aa1886055db890de9be52a97b301e","impliedNodeFormat":99},"dac79954011d59a0085e6583f2ca67db","583f9212b45ab385cb533038c27b1e9d","f55774503d383236d8fbeb2aa8e653f5","6aa33a6665aad6e58ff483bff29b4c38","3735a36f58ae876645f237e112230508",{"version":"432f373767ce69ff84c4247bb0b6780f","signature":"39a359395ecdf5cfcca25c3a4c2c8cdb","impliedNodeFormat":1},{"version":"473f9984c9818061e94ef84210311947","signature":"b81f921a8251e426a926715121d0eed5","impliedNodeFormat":1},{"version":"33614ba45ae91c3fcd3b5695b1458141","signature":"4225f269cabd5cb6611cdd9385eb07b8","impliedNodeFormat":1},{"version":"56677af934ca34a6bd0a10e3c40d3b1f","signature":"6e93bb836ab24c29d472b0b58e1f93b0","impliedNodeFormat":1},{"version":"28ca4d82217696597934b0d13f1034fc","signature":"14a786575644c638427a0bd6f8de378c","impliedNodeFormat":1},{"version":"f664a2f3ca3d915515b849b04a803814","signature":"abe7d9981d6018efb6b2b794f40a1607","impliedNodeFormat":1},{"version":"59bcb852b24572a21ad2c61a86b76f12","signature":"662bfb32f527a9a3bd16a32152b48b11","impliedNodeFormat":1},{"version":"0b9aa557baa2454d014c1a0783374a9c","signature":"3c1b03d5506ef86754d6cb702ba3f6d2","impliedNodeFormat":1},{"version":"28ba4ed94d0eec65e9d7844df43cb746","signature":"abe7d9981d6018efb6b2b794f40a1607","impliedNodeFormat":1},{"version":"2ba4cd8b935292ad46d8ebbba0f82c88","signature":"abe7d9981d6018efb6b2b794f40a1607","impliedNodeFormat":1},{"version":"10b7d62672083f30b19ab0bd84a61b00","signature":"abe7d9981d6018efb6b2b794f40a1607","impliedNodeFormat":1},{"version":"ffee7d86e3924a7341e363a113944bac","signature":"a954c44d2af34b177fa4402bca73cf04","impliedNodeFormat":1}],"fileIdsList":[[118],[91,97,115,116,117,119],[126],[126,127],[95,97,98],[95,97],[95],[90,95,106,107],[90,95,106],[114],[90,96],[90],[92],[90,91,92,93,94],[132,133],[132,133,134,135],[132,134],[132],[101],[101,102,103,104],[103],[99,121,122,124],[99,100,112,124],[90,97,99,100,108,124],[105],[90,99,100,108,120,123],[99,100,105,108,124],[99,121,122,123,124],[99,105,109,110,111,124],[90,95,97,99,100,105,108,109,110,111,112,113,115,120,121,122,123,124,125,128,129,130,131,136],[90,97,99,100,108,109,121,122,123,124,129],[88],[89,137,145,147],[88,89,142,143,144],[88,89,137,145,147,150],[88,89,143,144,145,149],[89,137,147,150],[88,137,147],[88,142,146],[88,89,145,147,150],[88,142],[88,89],[138],[138,139,140,141]],"options":{"allowJs":false,"composite":true,"emitDeclarationOnly":true,"declaration":true,"declarationMap":true,"experimentalDecorators":true,"jsx":3,"module":200,"noImplicitOverride":true,"noUncheckedSideEffectImports":false,"outDir":"./","rewriteRelativeImportExtensions":true,"skipLibCheck":true,"strict":true,"stripInternal":true,"sourceMap":true,"target":99,"esModuleInterop":true},"effect":{"refactors":true,"diagnostics":true,"quickinfo":true,"completions":true,"goto":true,"renames":true,"ignoreEffectSuggestionsInTscExitCode":true,"namespaceImportPackages":["effect","@effect/*"],"topLevelNamedReexports":"follow","diagnosticSeverity":{}},"referencedMap":[[119,1],[120,2],[127,3],[128,4],[99,5],[98,6],[121,5],[106,7],[108,8],[107,9],[115,10],[97,11],[91,12],[93,13],[95,14],[96,12],[134,15],[136,16],[135,17],[133,18],[102,19],[105,20],[103,19],[104,21],[123,22],[113,23],[109,24],[110,7],[130,25],[124,26],[111,27],[129,28],[112,29],[137,30],[131,31],[89,32],[148,33],[145,34],[151,35],[150,36],[152,37],[153,38],[147,39],[154,40],[146,41],[143,42],[149,32],[144,42],[141,43],[142,44]],"latestChangedDtsFile":"./src/index.d.ts"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/datalog",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "Datalog engine with no third-party dependencies: parser, static checks, incremental stratified semi-naive evaluation with provenance and pluggable built-ins.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -51,7 +51,7 @@
51
51
  "src"
52
52
  ],
53
53
  "dependencies": {
54
- "@dxos/errors": "0.14.0"
54
+ "@dxos/errors": "0.15.0"
55
55
  },
56
56
  "devDependencies": {
57
57
  "vitest": "4.1.10"
@@ -1 +0,0 @@
1
- {"version":3,"file":"Ast.mjs","names":[],"sources":["../../src/Ast.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\n/** A ground value; symbols (`dima`) and strings (`\"dima\"`) are the same value. */\nexport type Value = string | number;\n\n/** A ground row of a relation. */\nexport type Tuple = ReadonlyArray<Value>;\n\n/** Source location (1-based line and column). */\nexport type Position = { readonly line: number; readonly column: number };\n\nexport type Variable = {\n readonly type: 'variable';\n readonly name: string;\n /** Set for `_`; each occurrence is a distinct, never-joined variable. */\n readonly anonymous?: boolean;\n};\n\nexport type Constant = { readonly type: 'constant'; readonly value: Value };\n\nexport type Term = Variable | Constant;\n\nexport type Atom = { readonly predicate: string; readonly terms: ReadonlyArray<Term> };\n\nexport type ComparisonOperator = '=' | '!=' | '<' | '<=' | '>' | '>=';\n\nexport type AggregateFunction = 'count' | 'min' | 'max' | 'sum';\n\nexport type AtomLiteral = {\n readonly type: 'atom';\n readonly atom: Atom;\n readonly negated: boolean;\n readonly position?: Position;\n};\n\nexport type ComparisonLiteral = {\n readonly type: 'comparison';\n readonly operator: ComparisonOperator;\n readonly left: Term;\n readonly right: Term;\n readonly position?: Position;\n};\n\n/** `Result = fn Target : { body }`; `Target` is absent for `count`. */\nexport type AggregateLiteral = {\n readonly type: 'aggregate';\n readonly function: AggregateFunction;\n readonly result: Term;\n readonly target?: Term;\n readonly body: ReadonlyArray<Literal>;\n readonly position?: Position;\n};\n\nexport type Literal = AtomLiteral | ComparisonLiteral | AggregateLiteral;\n\n/** A rule; a fact is a rule with an empty body. */\nexport type Rule = {\n readonly head: Atom;\n readonly body: ReadonlyArray<Literal>;\n readonly position?: Position;\n};\n\nexport type Program = { readonly rules: ReadonlyArray<Rule> };\n\n/** Creates a variable term. */\nexport const variable = (name: string): Variable => ({ type: 'variable', name });\n\n/** Creates a constant term. */\nexport const constant = (value: Value): Constant => ({ type: 'constant', value });\n\n/** Creates an atom. */\nexport const atom = (predicate: string, terms: ReadonlyArray<Term>): Atom => ({ predicate, terms });\n\n/** Named (non-anonymous) variables of a term list, in order of first occurrence. */\nexport const variablesOf = (terms: ReadonlyArray<Term>): string[] => {\n const names: string[] = [];\n for (const term of terms) {\n if (term.type === 'variable' && !term.anonymous && !names.includes(term.name)) {\n names.push(term.name);\n }\n }\n return names;\n};\n\n/** Named variables a literal mentions, including those inside an aggregate body. */\nexport const literalVariables = (literal: Literal): string[] => {\n switch (literal.type) {\n case 'atom':\n return variablesOf(literal.atom.terms);\n case 'comparison':\n return variablesOf([literal.left, literal.right]);\n case 'aggregate': {\n const terms = [literal.result, ...(literal.target ? [literal.target] : [])];\n return [...new Set([...variablesOf(terms), ...literal.body.flatMap(literalVariables)])];\n }\n }\n};\n\n/** Formats a value as dialect source. */\nexport const formatValue = (value: Value): string =>\n typeof value === 'number' ? String(value) : /^[a-z][A-Za-z0-9_]*$/.test(value) ? value : JSON.stringify(value);\n\n/** Formats a term as dialect source. */\nexport const formatTerm = (term: Term): string =>\n term.type === 'constant' ? formatValue(term.value) : term.anonymous ? '_' : term.name;\n\n/** Formats an atom as dialect source. */\nexport const formatAtom = (atom: Atom): string =>\n atom.terms.length === 0 ? atom.predicate : `${atom.predicate}(${atom.terms.map(formatTerm).join(', ')})`;\n\n/** Formats a literal as dialect source. */\nexport const formatLiteral = (literal: Literal): string => {\n switch (literal.type) {\n case 'atom':\n return `${literal.negated ? 'not ' : ''}${formatAtom(literal.atom)}`;\n case 'comparison':\n return `${formatTerm(literal.left)} ${literal.operator} ${formatTerm(literal.right)}`;\n case 'aggregate': {\n const target = literal.target ? ` ${formatTerm(literal.target)}` : '';\n return `${formatTerm(literal.result)} = ${literal.function}${target} : { ${literal.body.map(formatLiteral).join(', ')} }`;\n }\n }\n};\n\n/** Formats a rule as dialect source. */\nexport const formatRule = (rule: Rule): string =>\n rule.body.length === 0\n ? `${formatAtom(rule.head)}.`\n : `${formatAtom(rule.head)} :- ${rule.body.map(formatLiteral).join(', ')}.`;\n\n/** Formats a program as dialect source, one rule per line. */\nexport const format = (program: Program): string => program.rules.map(formatRule).join('\\n');\n"],"mappings":";;;;;;;;;;;;;;;;AAqEA,IAAa,YAAY,UAA4B;CAAE,MAAM;CAAY;AAAK;;AAG9E,IAAa,YAAY,WAA4B;CAAE,MAAM;CAAY;AAAM;;AAG/E,IAAa,QAAQ,WAAmB,WAAsC;CAAE;CAAW;AAAM;;AAGjG,IAAa,eAAe,UAAyC;CACnE,MAAM,QAAkB,CAAC;CACzB,KAAK,MAAM,QAAQ,OACjB,IAAI,KAAK,SAAS,cAAc,CAAC,KAAK,aAAa,CAAC,MAAM,SAAS,KAAK,IAAI,GAC1E,MAAM,KAAK,KAAK,IAAI;CAGxB,OAAO;AACT;;AAGA,IAAa,oBAAoB,YAA+B;CAC9D,QAAQ,QAAQ,MAAhB;EACE,KAAK,QACH,OAAO,YAAY,QAAQ,KAAK,KAAK;EACvC,KAAK,cACH,OAAO,YAAY,CAAC,QAAQ,MAAM,QAAQ,KAAK,CAAC;EAClD,KAAK,aAAa;GAChB,MAAM,QAAQ,CAAC,QAAQ,QAAQ,GAAI,QAAQ,SAAS,CAAC,QAAQ,MAAM,IAAI,CAAC,CAAE;GAC1E,OAAO,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,YAAY,KAAK,GAAG,GAAG,QAAQ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-namespace\n\nimport type * as Ast from './Ast.ts';\n\n/**\n * A binding pattern, one character per argument: `b` must be bound before the call, `f` may be\n * free and is bound by the call. `\"fb\"` lets the first argument be generated from the second.\n */\nexport type Mode = string;\n\n/** Arguments as seen by a built-in: `undefined` marks a free position of the selected mode. */\nexport type Arguments = ReadonlyArray<Ast.Value | undefined>;\n\n/** A predicate implemented in code rather than by rules. */\nexport type Builtin = {\n readonly name: string;\n readonly arity: number;\n /** Accepted binding patterns; the all-bound pattern is always accepted. */\n readonly modes: ReadonlyArray<Mode>;\n /**\n * Set when the result can change with no change to the facts (a clock), so the engine\n * re-evaluates the rules that use it on `refresh`.\n */\n readonly volatile?: boolean;\n /** Returns every full argument tuple that holds and agrees with the bound arguments. */\n readonly evaluate: (args: Arguments) => Iterable<Ast.Tuple>;\n};\n\n/** Built-ins by name. */\nexport type Registry = ReadonlyMap<string, Builtin>;\n\n/** Defines a built-in. */\nexport const make = (builtin: Builtin): Builtin => builtin;\n\n/** Defines a test-only built-in: holds iff `test` returns true for its fully bound arguments. */\nexport const predicate = (\n name: string,\n arity: number,\n test: (args: Ast.Tuple) => boolean,\n options: { volatile?: boolean } = {},\n): Builtin => ({\n name,\n arity,\n modes: ['b'.repeat(arity)],\n volatile: options.volatile,\n evaluate: (args) => {\n const bound = args.filter((arg): arg is Ast.Value => arg !== undefined);\n return bound.length === arity && test(bound) ? [bound] : [];\n },\n});\n\n/** Builds a registry, rejecting duplicate names. */\nexport const registry = (...builtins: ReadonlyArray<Builtin>): Registry => {\n const entries = new Map<string, Builtin>();\n for (const builtin of builtins) {\n if (entries.has(builtin.name)) {\n throw new Error(`Duplicate built-in: ${builtin.name}`);\n }\n if (builtin.modes.some((mode) => mode.length !== builtin.arity || /[^bf]/.test(mode))) {\n throw new Error(`Invalid mode for built-in ${builtin.name}/${builtin.arity}`);\n }\n entries.set(builtin.name, builtin);\n }\n return entries;\n};\n\n/** True if `builtin` can be called with exactly the `bound` argument positions bound. */\nexport const acceptsBinding = (builtin: Builtin, bound: ReadonlyArray<boolean>): boolean =>\n bound.every(Boolean) || builtin.modes.some((mode) => [...mode].every((flag, index) => flag === 'f' || bound[index]));\n"],"mappings":";;;;;;;;;AAoCA,IAAa,QAAQ,YAA8B;;AAGnD,IAAa,aACX,MACA,OACA,MACA,UAAkC,CAAC,OACtB;CACb;CACA;CACA,OAAO,CAAC,IAAI,OAAO,KAAK,CAAC;CACzB,UAAU,QAAQ;CAClB,WAAW,SAAS;EAClB,MAAM,QAAQ,KAAK,QAAQ,QAA0B,QAAQ,KAAA,CAAS;EACtE,OAAO,MAAM,WAAW,SAAS,KAAK,KAAK,IAAI,CAAC,KAAK,IAAI,CAAC;CAC5D;AACF;;AAGA,IAAa,YAAY,GAAG,aAA+C;CACzE,MAAM,0BAAU,IAAI,IAAqB;CACzC,KAAK,MAAM,WAAW,UAAU;EAC9B,IAAI,QAAQ,IAAI,QAAQ,IAAI,GAC1B,MAAM,IAAI,MAAM,uBAAuB,QAAQ,MAAM;EAEvD,IAAI,QAAQ,MAAM,MAAM,SAAS,KAAK,WAAW,QAAQ,SAAS,QAAQ,KAAK,IAAI,CAAC,GAClF,MAAM,IAAI,MAAM,6BAA6B,QAAQ,KAAK,GAAG,QAAQ,OAAO;EAE9E,QAAQ,IAAI,QAAQ,MAAM,OAAO;CACnC;CACA,OAAO;AACT;;AAGA,IAAa,kBAAkB,SAAkB,UAC/C,MAAM,MAAM,OAAO,KAAK,QAAQ,MAAM,MAAM,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,MAAM,UAAU,SAAS,OAAO,MAAM,MAAM,CAAC"}