From c47f3a6eb04d5f010b3cf43f18de903b348d3d84 Mon Sep 17 00:00:00 2001 From: Andrew Michael McNutt Date: Sun, 2 Feb 2025 13:17:24 -0700 Subject: [PATCH] move all computation into a single call --- .../src/lib/SmallStepEvaluator.test.ts | 132 +- .../SmallStepEvaluator.test.ts.snap | 6125 +++++++++++++++++ .../lil-buddy/src/lib/small-step-evaluator.ts | 184 +- .../src/linting/VisualSummarizer.svelte | 22 +- .../linting/summary-nodes/DispatchNode.svelte | 28 +- .../linting/summary-nodes/InlineNode.svelte | 60 +- .../summary-nodes/QuantifierNode.svelte | 83 +- .../summary-nodes/visual-summary-utils.ts | 64 - .../src/lint-language/lint-language.ts | 4 +- 9 files changed, 6515 insertions(+), 187 deletions(-) delete mode 100644 apps/lil-buddy/src/linting/summary-nodes/visual-summary-utils.ts diff --git a/apps/lil-buddy/src/lib/SmallStepEvaluator.test.ts b/apps/lil-buddy/src/lib/SmallStepEvaluator.test.ts index 04f1ff0..9f0686e 100644 --- a/apps/lil-buddy/src/lib/SmallStepEvaluator.test.ts +++ b/apps/lil-buddy/src/lib/SmallStepEvaluator.test.ts @@ -1,7 +1,16 @@ import { expect, test } from "vitest"; import { makePalFromString } from "color-buddy-palette"; import { GenerateAST, PREBUILT_LINTS } from "color-buddy-palette-lint"; -import { generateEvaluations } from "./small-step-evaluator"; +import { + generateEvaluations, + rewriteQuantifiers, +} from "./small-step-evaluator"; + +const getAST = (node: any) => { + const ast = (GenerateAST(node as any).value as any).children[0] as any; + const rewrittenAST = rewriteQuantifiers(ast); + return rewrittenAST; +}; const defaultPal = makePalFromString(["red", "green"]); test("SmallStepEvaluator works", () => { @@ -11,35 +20,41 @@ test("SmallStepEvaluator works", () => { right: 10, }, }; - const ast = (GenerateAST(exampleNode as any).value as any).children[0] as any; + const ast = getAST(exampleNode); const result = generateEvaluations( ast, { a: defaultPal.colors[0], b: defaultPal.colors[1] }, - defaultPal + defaultPal, + true ); expect(result).toMatchSnapshot(); }); test("SmallStepEvaluator works with smaller example", () => { const smallExampleNode = { ">": { left: 11, right: 10 } }; - const ast = (GenerateAST(smallExampleNode as any).value as any) - .children[0] as any; - const result = generateEvaluations(ast, {}, defaultPal); + const result = generateEvaluations( + getAST(smallExampleNode), + {}, + defaultPal, + true + ); expect(result).toMatchSnapshot(); }); test("SmallStepEvaluator works with small not example", () => { const smallExampleNode = { not: { ">": { left: 11, right: 10 } } }; - const ast = (GenerateAST(smallExampleNode as any).value as any) - .children[0] as any; - const result = generateEvaluations(ast, {}, defaultPal); + const result = generateEvaluations( + getAST(smallExampleNode), + {}, + defaultPal, + true + ); expect(result).toMatchSnapshot(); }); test("Agg Test", () => { const example = { "<": { left: { count: "colors" }, right: 11 } }; - const ast = (GenerateAST(example as any).value as any).children[0] as any; - const result = generateEvaluations(ast, {}, defaultPal); + const result = generateEvaluations(getAST(example), {}, defaultPal, true); expect(result).toMatchSnapshot(); }); @@ -50,18 +65,105 @@ test("Fair Test", () => { right: 50, }, }; - const ast = (GenerateAST(fair as any).value as any).children[0] as any; - const result = generateEvaluations(ast, {}, defaultPal); + const result = generateEvaluations(getAST(fair), {}, defaultPal, true); + expect(result).toMatchSnapshot(); +}); + +test("Quantifier Test", () => { + const quantifier = { + all: { + in: "colors", + varb: "a", + predicate: { + ">": { + left: { + contrast: { left: "a", right: "background" }, + algorithm: "WCAG21", + }, + right: 3, + }, + }, + }, + }; + const result = generateEvaluations(getAST(quantifier), {}, defaultPal, true); + expect(result).toMatchSnapshot(); +}); + +test("Nested Quantifiers Test", () => { + const nested = { + all: { + in: "colors", + varbs: ["a", "b"], + where: { "!=": { left: "index(a)", right: "index(b)" } }, + predicate: { + not: { + similar: { + left: { cvdSim: "a", type: "deuteranopia" }, + right: { cvdSim: "b", type: "deuteranopia" }, + threshold: 9, + }, + }, + }, + }, + }; + const result = generateEvaluations(getAST(nested), {}, defaultPal, true); expect(result).toMatchSnapshot(); }); +test("Quantifier Rewrite Test 1", () => { + const nested = { + all: { + in: "colors", + varbs: ["a", "b"], + where: { "!=": { left: "index(a)", right: "index(b)" } }, + predicate: { + not: { + similar: { + left: { cvdSim: "a", type: "deuteranopia" }, + right: { cvdSim: "b", type: "deuteranopia" }, + threshold: 9, + }, + }, + }, + }, + }; + const ast = (GenerateAST(nested as any).value as any).children[0] as any; + const unnested = rewriteQuantifiers(ast); + expect(unnested).toMatchSnapshot(); +}); + +test("Quantifier Rewrite Test 2", () => { + const anotherExample = { + ">": { + left: { deltaE: { left: "a", right: "b" }, algorithm: "2000" }, + right: 10, + }, + }; + const ast = getAST(anotherExample); + expect(rewriteQuantifiers(ast)).toStrictEqual(ast); +}); + +test("Quantifier Rewrite Test 3", () => { + const nested = { + all: { + in: "colors", + varbs: ["a", "b", "c"], + where: { "!=": { left: "index(a)", right: "index(b)" } }, + predicate: true, + }, + }; + const ast = (GenerateAST(nested as any).value as any).children[0] as any; + const unnested = rewriteQuantifiers(ast); + expect(unnested).toMatchSnapshot(); +}); + // test("All Test", () => { // for (const test in PREBUILT_LINTS) { // const lint = PREBUILT_LINTS[test as keyof typeof PREBUILT_LINTS]; -// console.log(lint); +// console.log(lint.name); // const lintProgram = JSON.parse(lint.program); // const ast = (GenerateAST(lintProgram).value as any).children[0] as any; -// const result = generateEvaluations(ast, {}, defaultPal); +// const result = generateEvaluations(ast, {}, defaultPal, true); // expect(result).toMatchSnapshot(); // } // }); diff --git a/apps/lil-buddy/src/lib/__snapshots__/SmallStepEvaluator.test.ts.snap b/apps/lil-buddy/src/lib/__snapshots__/SmallStepEvaluator.test.ts.snap index 0258b0e..897815e 100644 --- a/apps/lil-buddy/src/lib/__snapshots__/SmallStepEvaluator.test.ts.snap +++ b/apps/lil-buddy/src/lib/__snapshots__/SmallStepEvaluator.test.ts.snap @@ -5,11 +5,13 @@ exports[`Agg Test 1`] = ` LLExpression { "nodeType": "expression", "value": LLPredicate { + "inducedVariables": {}, "left": LLAggregate { "children": LLVariable { "nodeType": "variable", "value": "colors", }, + "inducedVariables": {}, "nodeType": "aggregate", "type": "count", }, @@ -23,6 +25,7 @@ exports[`Agg Test 1`] = ` }, }, LLPredicate { + "inducedVariables": {}, "left": LLNumber { "nodeType": "number", "value": 2, @@ -42,11 +45,4262 @@ exports[`Agg Test 1`] = ` ] `; +exports[`All Test 1`] = ` +[ + LLExpression { + "nodeType": "expression", + "value": LLQuantifier { + "inducedVariables": {}, + "input": LLVariable { + "nodeType": "variable", + "value": "colors", + }, + "nodeType": "quantifier", + "predicate": LLExpression { + "nodeType": "expression", + "value": LLPredicate { + "left": LLPairFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "a", + }, + "nodeType": "pairFunction", + "params": { + "algorithm": "WCAG21", + }, + "right": LLVariable { + "nodeType": "variable", + "value": "background", + }, + "type": "contrast", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 3, + }, + "threshold": undefined, + "type": ">", + }, + }, + "type": "all", + "varbs": [ + "a", + ], + "where": undefined, + }, + }, + { + "inducedVariables": {}, + "quant": "all", + "results": [ + { + "color": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "evals": [ + LLPredicate { + "left": LLPairFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "a", + }, + "nodeType": "pairFunction", + "params": { + "algorithm": "WCAG21", + }, + "right": LLVariable { + "nodeType": "variable", + "value": "background", + }, + "type": "contrast", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 3, + }, + "threshold": undefined, + "type": ">", + }, + LLPredicate { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 0, + }, + "left": LLNumber { + "nodeType": "number", + "value": 3.997818803850546, + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 3, + }, + "threshold": undefined, + "type": ">", + }, + LLBool { + "nodeType": "bool", + "value": true, + }, + ], + }, + { + "color": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "evals": [ + LLPredicate { + "left": LLPairFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "a", + }, + "nodeType": "pairFunction", + "params": { + "algorithm": "WCAG21", + }, + "right": LLVariable { + "nodeType": "variable", + "value": "background", + }, + "type": "contrast", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 3, + }, + "threshold": undefined, + "type": ">", + }, + LLPredicate { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + }, + "left": LLNumber { + "nodeType": "number", + "value": 5.137518325903408, + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 3, + }, + "threshold": undefined, + "type": ">", + }, + LLBool { + "nodeType": "bool", + "value": true, + }, + ], + }, + ], + "varb": "a", + }, + LLBool { + "nodeType": "bool", + "value": true, + }, +] +`; + +exports[`All Test 2`] = ` +[ + LLExpression { + "nodeType": "expression", + "value": LLQuantifier { + "inducedVariables": {}, + "input": LLVariable { + "nodeType": "variable", + "value": "colors", + }, + "nodeType": "quantifier", + "predicate": LLExpression { + "nodeType": "expression", + "value": LLPredicate { + "left": LLPairFunction { + "left": LLVariable { + "nodeType": "variable", + "value": "a", + }, + "nodeType": "pairFunction", + "params": { + "algorithm": "WCAG21", + }, + "right": LLVariable { + "nodeType": "variable", + "value": "background", + }, + "type": "contrast", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 4.5, + }, + "threshold": undefined, + "type": ">", + }, + }, + "type": "all", + "varbs": [ + "a", + ], + "where": LLValueFunction { + "input": LLVariable { + "nodeType": "variable", + "value": "a", + }, + "nodeType": "valueFunction", + "params": { + "value": "text", + }, + "type": "isTag", + }, + }, + }, + { + "inducedVariables": {}, + "quant": "all", + "results": [ + { + "color": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "didEval": true, + "result": "WHERE SKIP", + }, + { + "color": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "didEval": true, + "result": "WHERE SKIP", + }, + ], + "varb": "a", + }, + LLBool { + "nodeType": "bool", + "value": true, + }, +] +`; + +exports[`All Test 3`] = ` +[ + LLExpression { + "nodeType": "expression", + "value": LLQuantifier { + "inducedVariables": {}, + "input": LLVariable { + "nodeType": "variable", + "value": "colors", + }, + "nodeType": "quantifier", + "predicate": LLExpression { + "nodeType": "expression", + "value": LLPredicate { + "left": LLPairFunction { + "left": LLVariable { + "nodeType": "variable", + "value": "a", + }, + "nodeType": "pairFunction", + "params": { + "algorithm": "WCAG21", + }, + "right": LLVariable { + "nodeType": "variable", + "value": "background", + }, + "type": "contrast", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 7, + }, + "threshold": undefined, + "type": ">", + }, + }, + "type": "all", + "varbs": [ + "a", + ], + "where": LLValueFunction { + "input": LLVariable { + "nodeType": "variable", + "value": "a", + }, + "nodeType": "valueFunction", + "params": { + "value": "text", + }, + "type": "isTag", + }, + }, + }, + { + "inducedVariables": {}, + "quant": "all", + "results": [ + { + "color": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "didEval": true, + "result": "WHERE SKIP", + }, + { + "color": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "didEval": true, + "result": "WHERE SKIP", + }, + ], + "varb": "a", + }, + LLBool { + "nodeType": "bool", + "value": true, + }, +] +`; + +exports[`All Test 4`] = ` +[ + LLExpression { + "nodeType": "expression", + "value": LLQuantifier { + "inducedVariables": {}, + "input": LLVariable { + "nodeType": "variable", + "value": "colors", + }, + "nodeType": "quantifier", + "predicate": LLExpression { + "nodeType": "expression", + "value": LLPredicate { + "left": LLPairFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "a", + }, + "nodeType": "pairFunction", + "params": { + "algorithm": "WCAG21", + }, + "right": LLVariable { + "nodeType": "variable", + "value": "background", + }, + "type": "contrast", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 4.5, + }, + "threshold": undefined, + "type": ">", + }, + }, + "type": "all", + "varbs": [ + "a", + ], + "where": undefined, + }, + }, + { + "inducedVariables": {}, + "quant": "all", + "results": [ + { + "color": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "evals": [ + LLPredicate { + "left": LLPairFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "a", + }, + "nodeType": "pairFunction", + "params": { + "algorithm": "WCAG21", + }, + "right": LLVariable { + "nodeType": "variable", + "value": "background", + }, + "type": "contrast", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 4.5, + }, + "threshold": undefined, + "type": ">", + }, + LLPredicate { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 0, + }, + "left": LLNumber { + "nodeType": "number", + "value": 3.997818803850546, + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 4.5, + }, + "threshold": undefined, + "type": ">", + }, + LLBool { + "nodeType": "bool", + "value": false, + }, + ], + }, + { + "color": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "evals": [ + LLPredicate { + "left": LLPairFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "a", + }, + "nodeType": "pairFunction", + "params": { + "algorithm": "WCAG21", + }, + "right": LLVariable { + "nodeType": "variable", + "value": "background", + }, + "type": "contrast", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 4.5, + }, + "threshold": undefined, + "type": ">", + }, + LLPredicate { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + }, + "left": LLNumber { + "nodeType": "number", + "value": 5.137518325903408, + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 4.5, + }, + "threshold": undefined, + "type": ">", + }, + LLBool { + "nodeType": "bool", + "value": true, + }, + ], + }, + ], + "varb": "a", + }, + LLBool { + "nodeType": "bool", + "value": false, + }, +] +`; + +exports[`All Test 5`] = ` +[ + LLExpression { + "nodeType": "expression", + "value": LLQuantifier { + "inducedVariables": {}, + "input": LLVariable { + "nodeType": "variable", + "value": "colors", + }, + "nodeType": "quantifier", + "predicate": LLExpression { + "nodeType": "expression", + "value": LLPredicate { + "left": LLPairFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "a", + }, + "nodeType": "pairFunction", + "params": { + "algorithm": "WCAG21", + }, + "right": LLVariable { + "nodeType": "variable", + "value": "background", + }, + "type": "contrast", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 7, + }, + "threshold": undefined, + "type": ">", + }, + }, + "type": "all", + "varbs": [ + "a", + ], + "where": undefined, + }, + }, + { + "inducedVariables": {}, + "quant": "all", + "results": [ + { + "color": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "evals": [ + LLPredicate { + "left": LLPairFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "a", + }, + "nodeType": "pairFunction", + "params": { + "algorithm": "WCAG21", + }, + "right": LLVariable { + "nodeType": "variable", + "value": "background", + }, + "type": "contrast", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 7, + }, + "threshold": undefined, + "type": ">", + }, + LLPredicate { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 0, + }, + "left": LLNumber { + "nodeType": "number", + "value": 3.997818803850546, + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 7, + }, + "threshold": undefined, + "type": ">", + }, + LLBool { + "nodeType": "bool", + "value": false, + }, + ], + }, + { + "color": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "evals": [ + LLPredicate { + "left": LLPairFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "a", + }, + "nodeType": "pairFunction", + "params": { + "algorithm": "WCAG21", + }, + "right": LLVariable { + "nodeType": "variable", + "value": "background", + }, + "type": "contrast", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 7, + }, + "threshold": undefined, + "type": ">", + }, + LLPredicate { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + }, + "left": LLNumber { + "nodeType": "number", + "value": 5.137518325903408, + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 7, + }, + "threshold": undefined, + "type": ">", + }, + LLBool { + "nodeType": "bool", + "value": false, + }, + ], + }, + ], + "varb": "a", + }, + LLBool { + "nodeType": "bool", + "value": false, + }, +] +`; + +exports[`All Test 6`] = ` +[ + LLExpression { + "nodeType": "expression", + "value": LLQuantifier { + "inducedVariables": {}, + "input": LLVariable { + "nodeType": "variable", + "value": "colors", + }, + "nodeType": "quantifier", + "predicate": LLExpression { + "nodeType": "expression", + "value": LLConjunction { + "children": [ + LLExpression { + "nodeType": "expression", + "value": LLPredicate { + "left": LLValueFunction { + "input": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "valueFunction", + "params": {}, + "type": "hsl.s", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 70, + }, + "threshold": undefined, + "type": ">", + }, + }, + ], + "nodeType": "conjunction", + "type": "not", + }, + }, + "type": "all", + "varbs": [ + "c", + ], + "where": LLPredicate { + "left": LLValueFunction { + "input": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "valueFunction", + "params": {}, + "type": "hsl.l", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 70, + }, + "threshold": undefined, + "type": ">", + }, + }, + }, + { + "inducedVariables": {}, + "quant": "all", + "results": [ + { + "color": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "didEval": true, + "result": "WHERE SKIP", + }, + { + "color": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "didEval": true, + "result": "WHERE SKIP", + }, + ], + "varb": "c", + }, + LLBool { + "nodeType": "bool", + "value": true, + }, +] +`; + +exports[`All Test 7`] = ` +[ + LLExpression { + "nodeType": "expression", + "value": LLQuantifier { + "inducedVariables": {}, + "input": LLVariable { + "nodeType": "variable", + "value": "colors", + }, + "nodeType": "quantifier", + "predicate": LLExpression { + "nodeType": "expression", + "value": LLConjunction { + "children": [ + LLExpression { + "nodeType": "expression", + "value": LLPredicate { + "left": LLValueFunction { + "input": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "valueFunction", + "params": {}, + "type": "hsl.s", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 70, + }, + "threshold": undefined, + "type": ">", + }, + }, + ], + "nodeType": "conjunction", + "type": "not", + }, + }, + "type": "all", + "varbs": [ + "c", + ], + "where": LLPredicate { + "left": LLValueFunction { + "input": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "valueFunction", + "params": {}, + "type": "hsl.l", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 70, + }, + "threshold": undefined, + "type": ">", + }, + }, + }, + { + "inducedVariables": {}, + "quant": "all", + "results": [ + { + "color": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "didEval": true, + "result": "WHERE SKIP", + }, + { + "color": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "didEval": true, + "result": "WHERE SKIP", + }, + ], + "varb": "c", + }, + LLBool { + "nodeType": "bool", + "value": true, + }, +] +`; + +exports[`All Test 8`] = ` +[ + LLExpression { + "nodeType": "expression", + "value": LLQuantifier { + "inducedVariables": {}, + "input": LLVariable { + "nodeType": "variable", + "value": "colors", + }, + "nodeType": "quantifier", + "predicate": LLExpression { + "nodeType": "expression", + "value": LLConjunction { + "children": [ + LLExpression { + "nodeType": "expression", + "value": LLPredicate { + "left": LLValueFunction { + "input": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "valueFunction", + "params": {}, + "type": "hsl.s", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 70, + }, + "threshold": undefined, + "type": ">", + }, + }, + ], + "nodeType": "conjunction", + "type": "not", + }, + }, + "type": "all", + "varbs": [ + "c", + ], + "where": LLPredicate { + "left": LLValueFunction { + "input": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "valueFunction", + "params": {}, + "type": "hsl.l", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 70, + }, + "threshold": undefined, + "type": ">", + }, + }, + }, + { + "inducedVariables": {}, + "quant": "all", + "results": [ + { + "color": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "didEval": true, + "result": "WHERE SKIP", + }, + { + "color": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "didEval": true, + "result": "WHERE SKIP", + }, + ], + "varb": "c", + }, + LLBool { + "nodeType": "bool", + "value": true, + }, +] +`; + +exports[`All Test 9`] = ` +[ + LLExpression { + "nodeType": "expression", + "value": LLQuantifier { + "inducedVariables": {}, + "input": LLVariable { + "nodeType": "variable", + "value": "colors", + }, + "nodeType": "quantifier", + "predicate": LLExpression { + "nodeType": "expression", + "value": LLConjunction { + "children": [ + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "lightblue", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 83.61154775498775, + "a": -12.226212744355758, + "b": -11.782128305001072, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "beige", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 96.04370417063645, + "a": -3.1148024941788366, + "b": 12.094696307241692, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "gray", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 53.58501345216902, + "a": 0, + "b": -2.220446049250313e-14, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + ], + "nodeType": "conjunction", + "type": "or", + }, + }, + "type": "exist", + "varbs": [ + "c", + ], + "where": undefined, + }, + }, + { + "inducedVariables": {}, + "quant": "exist", + "results": [ + { + "color": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "evals": [ + LLConjunction { + "children": [ + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "lightblue", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 83.61154775498775, + "a": -12.226212744355758, + "b": -11.782128305001072, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "beige", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 96.04370417063645, + "a": -3.1148024941788366, + "b": 12.094696307241692, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "gray", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 53.58501345216902, + "a": 0, + "b": -2.220446049250313e-14, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + ], + "nodeType": "conjunction", + "type": "or", + }, + LLConjunction { + "children": [ + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "bool", + "value": false, + }, + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "beige", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 96.04370417063645, + "a": -3.1148024941788366, + "b": 12.094696307241692, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "gray", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 53.58501345216902, + "a": 0, + "b": -2.220446049250313e-14, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "conjunction", + "type": "or", + }, + LLConjunction { + "children": [ + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "bool", + "value": false, + }, + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "bool", + "value": false, + }, + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "gray", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 53.58501345216902, + "a": 0, + "b": -2.220446049250313e-14, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "conjunction", + "type": "or", + }, + LLConjunction { + "children": [ + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "bool", + "value": false, + }, + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "bool", + "value": false, + }, + LLBool { + "nodeType": "bool", + "value": false, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "conjunction", + "type": "or", + }, + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "bool", + "value": false, + }, + LLBool { + "nodeType": "bool", + "value": false, + }, + ], + }, + { + "color": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "evals": [ + LLConjunction { + "children": [ + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "lightblue", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 83.61154775498775, + "a": -12.226212744355758, + "b": -11.782128305001072, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "beige", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 96.04370417063645, + "a": -3.1148024941788366, + "b": 12.094696307241692, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "gray", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 53.58501345216902, + "a": 0, + "b": -2.220446049250313e-14, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + ], + "nodeType": "conjunction", + "type": "or", + }, + LLConjunction { + "children": [ + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "bool", + "value": false, + }, + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "beige", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 96.04370417063645, + "a": -3.1148024941788366, + "b": 12.094696307241692, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "gray", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 53.58501345216902, + "a": 0, + "b": -2.220446049250313e-14, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "conjunction", + "type": "or", + }, + LLConjunction { + "children": [ + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "bool", + "value": false, + }, + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "bool", + "value": false, + }, + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "gray", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 53.58501345216902, + "a": 0, + "b": -2.220446049250313e-14, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "conjunction", + "type": "or", + }, + LLConjunction { + "children": [ + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "bool", + "value": false, + }, + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "bool", + "value": false, + }, + LLBool { + "nodeType": "bool", + "value": false, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "conjunction", + "type": "or", + }, + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "bool", + "value": false, + }, + LLBool { + "nodeType": "bool", + "value": false, + }, + ], + }, + ], + "varb": "c", + }, + LLBool { + "nodeType": "bool", + "value": false, + }, +] +`; + +exports[`All Test 10`] = ` +[ + LLExpression { + "nodeType": "expression", + "value": LLQuantifier { + "inducedVariables": {}, + "input": LLVariable { + "nodeType": "variable", + "value": "colors", + }, + "nodeType": "quantifier", + "predicate": LLExpression { + "nodeType": "expression", + "value": LLConjunction { + "children": [ + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLConjunction { + "children": [ + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "darkred", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 28.75820766095476, + "a": 51.45334895429457, + "b": 42.79761147038522, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "brown", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 38.14895787910737, + "a": 50.383647204301, + "b": 31.834795317003028, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "conjunction", + "type": "or", + }, + }, + ], + "nodeType": "conjunction", + "type": "not", + }, + }, + "type": "all", + "varbs": [ + "c", + ], + "where": undefined, + }, + }, + { + "inducedVariables": {}, + "quant": "all", + "results": [ + { + "color": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "evals": [ + LLConjunction { + "children": [ + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLConjunction { + "children": [ + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "darkred", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 28.75820766095476, + "a": 51.45334895429457, + "b": 42.79761147038522, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "brown", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 38.14895787910737, + "a": 50.383647204301, + "b": 31.834795317003028, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "conjunction", + "type": "or", + }, + }, + ], + "nodeType": "conjunction", + "type": "not", + }, + LLConjunction { + "children": [ + LLConjunction { + "children": [ + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "bool", + "value": false, + }, + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "brown", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 38.14895787910737, + "a": 50.383647204301, + "b": 31.834795317003028, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "conjunction", + "type": "or", + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "conjunction", + "type": "not", + }, + LLConjunction { + "children": [ + LLConjunction { + "children": [ + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "bool", + "value": false, + }, + LLBool { + "nodeType": "bool", + "value": true, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "conjunction", + "type": "or", + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "conjunction", + "type": "not", + }, + LLConjunction { + "children": [ + LLBool { + "nodeType": "bool", + "value": true, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "conjunction", + "type": "not", + }, + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "bool", + "value": false, + }, + LLBool { + "nodeType": "bool", + "value": false, + }, + ], + }, + { + "color": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "evals": [ + LLConjunction { + "children": [ + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLConjunction { + "children": [ + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "darkred", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 28.75820766095476, + "a": 51.45334895429457, + "b": 42.79761147038522, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "brown", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 38.14895787910737, + "a": 50.383647204301, + "b": 31.834795317003028, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "conjunction", + "type": "or", + }, + }, + ], + "nodeType": "conjunction", + "type": "not", + }, + LLConjunction { + "children": [ + LLConjunction { + "children": [ + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "bool", + "value": false, + }, + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "brown", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 38.14895787910737, + "a": 50.383647204301, + "b": 31.834795317003028, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "conjunction", + "type": "or", + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "conjunction", + "type": "not", + }, + LLConjunction { + "children": [ + LLConjunction { + "children": [ + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "bool", + "value": false, + }, + LLBool { + "nodeType": "bool", + "value": false, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "conjunction", + "type": "or", + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "conjunction", + "type": "not", + }, + LLConjunction { + "children": [ + LLBool { + "nodeType": "bool", + "value": false, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "conjunction", + "type": "not", + }, + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "bool", + "value": true, + }, + LLBool { + "nodeType": "bool", + "value": true, + }, + ], + }, + ], + "varb": "c", + }, + LLBool { + "nodeType": "bool", + "value": false, + }, +] +`; + +exports[`All Test 11`] = ` +[ + LLExpression { + "nodeType": "expression", + "value": LLQuantifier { + "inducedVariables": {}, + "input": LLVariable { + "nodeType": "variable", + "value": "colors", + }, + "nodeType": "quantifier", + "predicate": LLExpression { + "nodeType": "expression", + "value": LLConjunction { + "children": [ + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLConjunction { + "children": [ + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "green", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLValueFunction { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "input": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "valueFunction", + "params": {}, + "type": "lab.l", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 70, + }, + "threshold": undefined, + "type": ">", + }, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "conjunction", + "type": "or", + }, + }, + ], + "nodeType": "conjunction", + "type": "not", + }, + }, + "type": "all", + "varbs": [ + "c", + ], + "where": undefined, + }, + }, + { + "inducedVariables": {}, + "quant": "all", + "results": [ + { + "color": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "evals": [ + LLConjunction { + "children": [ + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLConjunction { + "children": [ + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "green", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLValueFunction { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "input": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "valueFunction", + "params": {}, + "type": "lab.l", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 70, + }, + "threshold": undefined, + "type": ">", + }, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "conjunction", + "type": "or", + }, + }, + ], + "nodeType": "conjunction", + "type": "not", + }, + LLConjunction { + "children": [ + LLConjunction { + "children": [ + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "bool", + "value": false, + }, + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLValueFunction { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "input": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "valueFunction", + "params": {}, + "type": "lab.l", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 70, + }, + "threshold": undefined, + "type": ">", + }, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "conjunction", + "type": "or", + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "conjunction", + "type": "not", + }, + LLConjunction { + "children": [ + LLConjunction { + "children": [ + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "bool", + "value": false, + }, + LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "left": LLNumber { + "nodeType": "number", + "value": 54.29054140467191, + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 70, + }, + "threshold": undefined, + "type": ">", + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "conjunction", + "type": "or", + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "conjunction", + "type": "not", + }, + LLConjunction { + "children": [ + LLConjunction { + "children": [ + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "bool", + "value": false, + }, + LLBool { + "nodeType": "bool", + "value": false, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "conjunction", + "type": "or", + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "conjunction", + "type": "not", + }, + LLConjunction { + "children": [ + LLBool { + "nodeType": "bool", + "value": false, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "conjunction", + "type": "not", + }, + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 0, + }, + "nodeType": "bool", + "value": true, + }, + LLBool { + "nodeType": "bool", + "value": true, + }, + ], + }, + { + "color": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "evals": [ + LLConjunction { + "children": [ + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLConjunction { + "children": [ + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "green", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 20, + "type": "similar", + }, + }, + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLValueFunction { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "input": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "valueFunction", + "params": {}, + "type": "lab.l", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 70, + }, + "threshold": undefined, + "type": ">", + }, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "conjunction", + "type": "or", + }, + }, + ], + "nodeType": "conjunction", + "type": "not", + }, + LLConjunction { + "children": [ + LLConjunction { + "children": [ + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "bool", + "value": true, + }, + LLExpression { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLValueFunction { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "input": LLVariable { + "nodeType": "variable", + "value": "c", + }, + "nodeType": "valueFunction", + "params": {}, + "type": "lab.l", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 70, + }, + "threshold": undefined, + "type": ">", + }, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "conjunction", + "type": "or", + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "conjunction", + "type": "not", + }, + LLConjunction { + "children": [ + LLConjunction { + "children": [ + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "bool", + "value": true, + }, + LLPredicate { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "left": LLNumber { + "nodeType": "number", + "value": 46.27770784805982, + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 70, + }, + "threshold": undefined, + "type": ">", + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "conjunction", + "type": "or", + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "conjunction", + "type": "not", + }, + LLConjunction { + "children": [ + LLConjunction { + "children": [ + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "bool", + "value": true, + }, + LLBool { + "nodeType": "bool", + "value": false, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "conjunction", + "type": "or", + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "conjunction", + "type": "not", + }, + LLConjunction { + "children": [ + LLBool { + "nodeType": "bool", + "value": true, + }, + ], + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "conjunction", + "type": "not", + }, + LLBool { + "inducedVariables": { + "c": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(c)": 1, + }, + "nodeType": "bool", + "value": false, + }, + LLBool { + "nodeType": "bool", + "value": false, + }, + ], + }, + ], + "varb": "c", + }, + LLBool { + "nodeType": "bool", + "value": false, + }, +] +`; + exports[`Fair Test 1`] = ` [ LLExpression { "nodeType": "expression", "value": LLPredicate { + "inducedVariables": {}, "left": LLAggregate { "children": LLMap { "children": LLVariable { @@ -62,10 +4316,12 @@ exports[`Fair Test 1`] = ` "params": {}, "type": "lch.l", }, + "inducedVariables": {}, "nodeType": "map", "type": "sort", "varb": "x", }, + "inducedVariables": {}, "nodeType": "aggregate", "type": "extent", }, @@ -79,6 +4335,7 @@ exports[`Fair Test 1`] = ` }, }, LLPredicate { + "inducedVariables": {}, "left": LLAggregate { "children": LLValueArray { "children": [ @@ -93,6 +4350,7 @@ exports[`Fair Test 1`] = ` ], "nodeType": "array", }, + "inducedVariables": {}, "nodeType": "aggregate", "type": "extent", }, @@ -105,6 +4363,7 @@ exports[`Fair Test 1`] = ` "type": "<", }, LLPredicate { + "inducedVariables": {}, "left": LLNumber { "nodeType": "number", "value": 8.012999999999998, @@ -124,12 +4383,1852 @@ exports[`Fair Test 1`] = ` ] `; +exports[`Nested Quantifiers Test 1`] = ` +[ + LLExpression { + "nodeType": "expression", + "value": LLQuantifier { + "inducedVariables": {}, + "input": LLVariable { + "nodeType": "variable", + "value": "colors", + }, + "nodeType": "quantifier", + "predicate": LLQuantifier { + "input": LLVariable { + "nodeType": "variable", + "value": "colors", + }, + "nodeType": "quantifier", + "predicate": LLExpression { + "nodeType": "expression", + "value": LLConjunction { + "children": [ + LLExpression { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "left": LLValueFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "input": LLVariable { + "nodeType": "variable", + "value": "a", + }, + "nodeType": "valueFunction", + "params": { + "type": "deuteranopia", + }, + "type": "cvdSim", + }, + "nodeType": "predicate", + "right": LLValueFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "input": LLVariable { + "nodeType": "variable", + "value": "b", + }, + "nodeType": "valueFunction", + "params": { + "type": "deuteranopia", + }, + "type": "cvdSim", + }, + "threshold": 9, + "type": "similar", + }, + }, + ], + "nodeType": "conjunction", + "type": "not", + }, + }, + "type": "all", + "varbs": [ + "b", + ], + "where": LLPredicate { + "left": LLVariable { + "nodeType": "variable", + "value": "index(a)", + }, + "nodeType": "predicate", + "right": LLVariable { + "nodeType": "variable", + "value": "index(b)", + }, + "threshold": undefined, + "type": "!=", + }, + }, + "type": "all", + "varbs": [ + "a", + ], + "where": undefined, + }, + }, + { + "inducedVariables": {}, + "quant": "all", + "results": [ + { + "color": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "evals": [ + LLQuantifier { + "input": LLVariable { + "nodeType": "variable", + "value": "colors", + }, + "nodeType": "quantifier", + "predicate": LLExpression { + "nodeType": "expression", + "value": LLConjunction { + "children": [ + LLExpression { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "left": LLValueFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "input": LLVariable { + "nodeType": "variable", + "value": "a", + }, + "nodeType": "valueFunction", + "params": { + "type": "deuteranopia", + }, + "type": "cvdSim", + }, + "nodeType": "predicate", + "right": LLValueFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "input": LLVariable { + "nodeType": "variable", + "value": "b", + }, + "nodeType": "valueFunction", + "params": { + "type": "deuteranopia", + }, + "type": "cvdSim", + }, + "threshold": 9, + "type": "similar", + }, + }, + ], + "nodeType": "conjunction", + "type": "not", + }, + }, + "type": "all", + "varbs": [ + "b", + ], + "where": LLPredicate { + "left": LLVariable { + "nodeType": "variable", + "value": "index(a)", + }, + "nodeType": "predicate", + "right": LLVariable { + "nodeType": "variable", + "value": "index(b)", + }, + "threshold": undefined, + "type": "!=", + }, + }, + { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 0, + }, + "quant": "all", + "results": [ + { + "color": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "didEval": true, + "result": "WHERE SKIP", + }, + { + "color": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "evals": [ + LLConjunction { + "children": [ + LLExpression { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "left": LLValueFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "input": LLVariable { + "nodeType": "variable", + "value": "a", + }, + "nodeType": "valueFunction", + "params": { + "type": "deuteranopia", + }, + "type": "cvdSim", + }, + "nodeType": "predicate", + "right": LLValueFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "input": LLVariable { + "nodeType": "variable", + "value": "b", + }, + "nodeType": "valueFunction", + "params": { + "type": "deuteranopia", + }, + "type": "cvdSim", + }, + "threshold": 9, + "type": "similar", + }, + }, + ], + "nodeType": "conjunction", + "type": "not", + }, + LLConjunction { + "children": [ + LLPredicate { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 0, + "index(b)": 1, + }, + "left": LLColor { + "constructorString": "#9b9b00", + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 0, + "index(b)": 1, + }, + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 62.46057567197121, + "a": -10.877327253457691, + "b": 64.50055351868562, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "nodeType": "predicate", + "right": LLValueFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "input": LLVariable { + "nodeType": "variable", + "value": "b", + }, + "nodeType": "valueFunction", + "params": { + "type": "deuteranopia", + }, + "type": "cvdSim", + }, + "threshold": 9, + "type": "similar", + }, + ], + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 0, + "index(b)": 1, + }, + "nodeType": "conjunction", + "type": "not", + }, + LLConjunction { + "children": [ + LLPredicate { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 0, + "index(b)": 1, + }, + "left": LLColor { + "constructorString": "#9b9b00", + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 0, + "index(b)": 1, + }, + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 62.46057567197121, + "a": -10.877327253457691, + "b": 64.50055351868562, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "#6a6a16", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 43.76722055724194, + "a": -7.7956612798162075, + "b": 43.56344576087999, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 9, + "type": "similar", + }, + ], + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 0, + "index(b)": 1, + }, + "nodeType": "conjunction", + "type": "not", + }, + LLConjunction { + "children": [ + LLBool { + "nodeType": "bool", + "value": false, + }, + ], + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 0, + "index(b)": 1, + }, + "nodeType": "conjunction", + "type": "not", + }, + LLBool { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 0, + "index(b)": 1, + }, + "nodeType": "bool", + "value": true, + }, + LLBool { + "nodeType": "bool", + "value": true, + }, + ], + }, + ], + "varb": "b", + }, + LLBool { + "nodeType": "bool", + "value": false, + }, + ], + }, + { + "color": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "evals": [ + LLQuantifier { + "input": LLVariable { + "nodeType": "variable", + "value": "colors", + }, + "nodeType": "quantifier", + "predicate": LLExpression { + "nodeType": "expression", + "value": LLConjunction { + "children": [ + LLExpression { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "left": LLValueFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "input": LLVariable { + "nodeType": "variable", + "value": "a", + }, + "nodeType": "valueFunction", + "params": { + "type": "deuteranopia", + }, + "type": "cvdSim", + }, + "nodeType": "predicate", + "right": LLValueFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "input": LLVariable { + "nodeType": "variable", + "value": "b", + }, + "nodeType": "valueFunction", + "params": { + "type": "deuteranopia", + }, + "type": "cvdSim", + }, + "threshold": 9, + "type": "similar", + }, + }, + ], + "nodeType": "conjunction", + "type": "not", + }, + }, + "type": "all", + "varbs": [ + "b", + ], + "where": LLPredicate { + "left": LLVariable { + "nodeType": "variable", + "value": "index(a)", + }, + "nodeType": "predicate", + "right": LLVariable { + "nodeType": "variable", + "value": "index(b)", + }, + "threshold": undefined, + "type": "!=", + }, + }, + { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + }, + "quant": "all", + "results": [ + { + "color": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "evals": [ + LLConjunction { + "children": [ + LLExpression { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "nodeType": "expression", + "value": LLPredicate { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "left": LLValueFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "input": LLVariable { + "nodeType": "variable", + "value": "a", + }, + "nodeType": "valueFunction", + "params": { + "type": "deuteranopia", + }, + "type": "cvdSim", + }, + "nodeType": "predicate", + "right": LLValueFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "input": LLVariable { + "nodeType": "variable", + "value": "b", + }, + "nodeType": "valueFunction", + "params": { + "type": "deuteranopia", + }, + "type": "cvdSim", + }, + "threshold": 9, + "type": "similar", + }, + }, + ], + "nodeType": "conjunction", + "type": "not", + }, + LLConjunction { + "children": [ + LLPredicate { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "left": LLColor { + "constructorString": "#6a6a16", + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 43.76722055724194, + "a": -7.7956612798162075, + "b": 43.56344576087999, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "nodeType": "predicate", + "right": LLValueFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "input": LLVariable { + "nodeType": "variable", + "value": "b", + }, + "nodeType": "valueFunction", + "params": { + "type": "deuteranopia", + }, + "type": "cvdSim", + }, + "threshold": 9, + "type": "similar", + }, + ], + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "nodeType": "conjunction", + "type": "not", + }, + LLConjunction { + "children": [ + LLPredicate { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "left": LLColor { + "constructorString": "#6a6a16", + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 43.76722055724194, + "a": -7.7956612798162075, + "b": 43.56344576087999, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "nodeType": "predicate", + "right": LLColor { + "constructorString": "#9b9b00", + "nodeType": "color", + "value": CIELAB { + "channels": { + "L": 62.46057567197121, + "a": -10.877327253457691, + "b": 64.50055351868562, + }, + "spaceName": "lab", + "tags": [], + }, + }, + "threshold": 9, + "type": "similar", + }, + ], + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "nodeType": "conjunction", + "type": "not", + }, + LLConjunction { + "children": [ + LLBool { + "nodeType": "bool", + "value": false, + }, + ], + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "nodeType": "conjunction", + "type": "not", + }, + LLBool { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + "index(b)": 0, + }, + "nodeType": "bool", + "value": true, + }, + LLBool { + "nodeType": "bool", + "value": true, + }, + ], + }, + { + "color": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "didEval": true, + "result": "WHERE SKIP", + }, + ], + "varb": "b", + }, + LLBool { + "nodeType": "bool", + "value": false, + }, + ], + }, + ], + "varb": "a", + }, + LLBool { + "nodeType": "bool", + "value": true, + }, +] +`; + +exports[`Quantifier Rewrite Test 1 1`] = ` +LLExpression { + "nodeType": "expression", + "value": LLQuantifier { + "input": LLVariable { + "nodeType": "variable", + "value": "colors", + }, + "nodeType": "quantifier", + "predicate": LLQuantifier { + "input": LLVariable { + "nodeType": "variable", + "value": "colors", + }, + "nodeType": "quantifier", + "predicate": LLExpression { + "nodeType": "expression", + "value": LLConjunction { + "children": [ + LLExpression { + "nodeType": "expression", + "value": LLPredicate { + "left": LLValueFunction { + "input": LLVariable { + "nodeType": "variable", + "value": "a", + }, + "nodeType": "valueFunction", + "params": { + "type": "deuteranopia", + }, + "type": "cvdSim", + }, + "nodeType": "predicate", + "right": LLValueFunction { + "input": LLVariable { + "nodeType": "variable", + "value": "b", + }, + "nodeType": "valueFunction", + "params": { + "type": "deuteranopia", + }, + "type": "cvdSim", + }, + "threshold": 9, + "type": "similar", + }, + }, + ], + "nodeType": "conjunction", + "type": "not", + }, + }, + "type": "all", + "varbs": [ + "b", + ], + "where": LLPredicate { + "left": LLVariable { + "nodeType": "variable", + "value": "index(a)", + }, + "nodeType": "predicate", + "right": LLVariable { + "nodeType": "variable", + "value": "index(b)", + }, + "threshold": undefined, + "type": "!=", + }, + }, + "type": "all", + "varbs": [ + "a", + ], + "where": undefined, + }, +} +`; + +exports[`Quantifier Rewrite Test 3 1`] = ` +LLExpression { + "nodeType": "expression", + "value": LLQuantifier { + "input": LLVariable { + "nodeType": "variable", + "value": "colors", + }, + "nodeType": "quantifier", + "predicate": LLQuantifier { + "input": LLVariable { + "nodeType": "variable", + "value": "colors", + }, + "nodeType": "quantifier", + "predicate": LLQuantifier { + "input": LLVariable { + "nodeType": "variable", + "value": "colors", + }, + "nodeType": "quantifier", + "predicate": LLExpression { + "nodeType": "expression", + "value": LLBool { + "nodeType": "bool", + "value": true, + }, + }, + "type": "all", + "varbs": [ + "c", + ], + "where": LLPredicate { + "left": LLVariable { + "nodeType": "variable", + "value": "index(a)", + }, + "nodeType": "predicate", + "right": LLVariable { + "nodeType": "variable", + "value": "index(b)", + }, + "threshold": undefined, + "type": "!=", + }, + }, + "type": "all", + "varbs": [ + "b", + ], + "where": undefined, + }, + "type": "all", + "varbs": [ + "a", + ], + "where": undefined, + }, +} +`; + +exports[`Quantifier Test 1`] = ` +[ + LLExpression { + "nodeType": "expression", + "value": LLQuantifier { + "inducedVariables": {}, + "input": LLVariable { + "nodeType": "variable", + "value": "colors", + }, + "nodeType": "quantifier", + "predicate": LLExpression { + "nodeType": "expression", + "value": LLPredicate { + "left": LLPairFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "a", + }, + "nodeType": "pairFunction", + "params": { + "algorithm": "WCAG21", + }, + "right": LLVariable { + "nodeType": "variable", + "value": "background", + }, + "type": "contrast", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 3, + }, + "threshold": undefined, + "type": ">", + }, + }, + "type": "all", + "varbs": [ + "a", + ], + "where": undefined, + }, + }, + { + "inducedVariables": {}, + "quant": "all", + "results": [ + { + "color": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "evals": [ + LLPredicate { + "left": LLPairFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "a", + }, + "nodeType": "pairFunction", + "params": { + "algorithm": "WCAG21", + }, + "right": LLVariable { + "nodeType": "variable", + "value": "background", + }, + "type": "contrast", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 3, + }, + "threshold": undefined, + "type": ">", + }, + LLPredicate { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 0, + }, + "left": LLNumber { + "nodeType": "number", + "value": 3.997818803850546, + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 3, + }, + "threshold": undefined, + "type": ">", + }, + LLBool { + "nodeType": "bool", + "value": true, + }, + ], + }, + { + "color": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "evals": [ + LLPredicate { + "left": LLPairFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + }, + "left": LLVariable { + "nodeType": "variable", + "value": "a", + }, + "nodeType": "pairFunction", + "params": { + "algorithm": "WCAG21", + }, + "right": LLVariable { + "nodeType": "variable", + "value": "background", + }, + "type": "contrast", + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 3, + }, + "threshold": undefined, + "type": ">", + }, + LLPredicate { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + "index(a)": 1, + }, + "left": LLNumber { + "nodeType": "number", + "value": 5.137518325903408, + }, + "nodeType": "predicate", + "right": LLNumber { + "nodeType": "number", + "value": 3, + }, + "threshold": undefined, + "type": ">", + }, + LLBool { + "nodeType": "bool", + "value": true, + }, + ], + }, + ], + "varb": "a", + }, + LLBool { + "nodeType": "bool", + "value": true, + }, +] +`; + exports[`SmallStepEvaluator works 1`] = ` [ LLExpression { "nodeType": "expression", "value": LLPredicate { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + }, "left": LLPairFunction { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + }, "left": LLVariable { "nodeType": "variable", "value": "a", @@ -154,6 +6253,26 @@ exports[`SmallStepEvaluator works 1`] = ` }, }, LLPredicate { + "inducedVariables": { + "a": CIELAB { + "channels": { + "L": 54.29054140467191, + "a": 80.80492817043522, + "b": 69.89096476862429, + }, + "spaceName": "lab", + "tags": [], + }, + "b": CIELAB { + "channels": { + "L": 46.27770784805982, + "a": -47.552395089952206, + "b": 48.5862848460751, + }, + "spaceName": "lab", + "tags": [], + }, + }, "left": LLNumber { "nodeType": "number", "value": 70.2365636120491, @@ -180,8 +6299,10 @@ exports[`SmallStepEvaluator works with small not example 1`] = ` "value": LLConjunction { "children": [ LLExpression { + "inducedVariables": {}, "nodeType": "expression", "value": LLPredicate { + "inducedVariables": {}, "left": LLNumber { "nodeType": "number", "value": 11, @@ -196,6 +6317,7 @@ exports[`SmallStepEvaluator works with small not example 1`] = ` }, }, ], + "inducedVariables": {}, "nodeType": "conjunction", "type": "not", }, @@ -207,10 +6329,12 @@ exports[`SmallStepEvaluator works with small not example 1`] = ` "value": true, }, ], + "inducedVariables": {}, "nodeType": "conjunction", "type": "not", }, LLBool { + "inducedVariables": {}, "nodeType": "bool", "value": false, }, @@ -226,6 +6350,7 @@ exports[`SmallStepEvaluator works with smaller example 1`] = ` LLExpression { "nodeType": "expression", "value": LLPredicate { + "inducedVariables": {}, "left": LLNumber { "nodeType": "number", "value": 11, diff --git a/apps/lil-buddy/src/lib/small-step-evaluator.ts b/apps/lil-buddy/src/lib/small-step-evaluator.ts index a02385c..8132f00 100644 --- a/apps/lil-buddy/src/lib/small-step-evaluator.ts +++ b/apps/lil-buddy/src/lib/small-step-evaluator.ts @@ -1,16 +1,115 @@ import { LLTypes, linter, Environment } from "color-buddy-palette-lint"; import { Color } from "color-buddy-palette"; import type { Palette } from "color-buddy-palette"; + +import { makePalFromString } from "color-buddy-palette"; + type LLNode = InstanceType<(typeof LLTypes)["LLNode"]>; +export type InducedVariables = Record; + +export function rewriteQuantifiers(node: any) { + if (!node || !node.nodeType) { + return node; + } + const newNode = node.copy(); + switch (node.nodeType) { + case "pairFunction": + case "numberOp": + case "predicate": + const left = rewriteQuantifiers(newNode.left); + const right = rewriteQuantifiers(newNode.right); + newNode.left = left; + newNode.right = right; + break; + case "aggregate": + case "array": + case "map": + const children = node.children; + if (Array.isArray(children)) { + newNode.children = children.map(rewriteQuantifiers); + } else { + newNode.children = rewriteQuantifiers(children); + } + break; + case "node": + case "expression": + newNode.value = rewriteQuantifiers(node.value); + break; + case "valueFunction": + newNode.input = rewriteQuantifiers(node.input); + break; + case "quantifier": + if (node.varbs.length === 1) { + newNode.where = rewriteQuantifiers(node.where); + newNode.predicate = rewriteQuantifiers(node.predicate); + } else { + const [head, ...tail] = node.varbs; + const newSubNode = node.copy(); + newSubNode.where = rewriteQuantifiers(node.where); + newSubNode.predicate = node.predicate; + newSubNode.varbs = tail; + newNode.where = undefined; + newNode.varbs = [head]; + newNode.predicate = rewriteQuantifiers(newSubNode); + } + break; + case "bool": + case "color": + case "number": + case "value": + case "variable": + default: + break; + } + return newNode; +} + +function checkWhere( + node: any, + color: Color, + varb: string, + pal: Palette, + inducedVariables: InducedVariables, + index: number +): boolean { + if (!node) return true; + const result = evaluateNode( + node, + { ...inducedVariables, [varb]: color, [`index(${varb})`]: index }, + pal + ); + return result.result; +} + +function getValues(node: any, pal: Palette) { + if (node?.input?.value === "colors") { + return pal.colors; + } + if ( + Array.isArray(node?.input?.children) && + typeof node.input.children?.at(0)?.constructorString + ) { + return makePalFromString( + node.input.children.map((x: any) => x.constructorString) + ).colors; + } + + return []; +} -export function evaluateNode( +const toVal = (x: Color | number) => { + if (typeof x === "number") { + return new LLTypes.LLValue(new LLTypes.LLNumber(x)); + } + return new LLTypes.LLValue(new LLTypes.LLColor(x, x.toHex())); +}; +function evaluateNode( node: any, - inducedVariables: Record, + inducedVariables: InducedVariables, pal: Palette ) { const opts = { debugParse: false, debugEval: false, debugCompare: false }; - const toVal = (x: Color) => - new LLTypes.LLValue(new LLTypes.LLColor(x, x.toHex())); + const newEnv = Object.entries(inducedVariables).reduce( (acc, [key, value]) => acc.set(key, toVal(value)), new Environment(pal, {}, opts, {}) @@ -38,7 +137,21 @@ function isValue(node: any) { return false; } } -function subTreeIsPureOp(node: any): boolean { +function deepCopyEnv(env: InducedVariables) { + return Object.entries(env).reduce( + (acc, [key, value]) => ({ + ...acc, + [key]: typeof value === "number" ? value : value.copy(), + }), + {} + ); +} + +function subTreeIsPureOp( + node: any, + inducedVariables: InducedVariables +): boolean { + node.inducedVariables = deepCopyEnv(inducedVariables); switch (node.nodeType) { case "pairFunction": case "numberOp": @@ -63,7 +176,7 @@ function subTreeIsPureOp(node: any): boolean { } case "node": case "expression": - return subTreeIsPureOp(node.value); + return subTreeIsPureOp(node.value, inducedVariables); case "bool": case "color": case "number": @@ -73,7 +186,8 @@ function subTreeIsPureOp(node: any): boolean { case "valueFunction": return isValue(node.input); case "quantifier": - throw new Error("Quantifiers should not be evaluated here", node); + return false; + // throw new Error("Quantifiers should not be evaluated here", node); default: return false; } @@ -82,7 +196,7 @@ function subTreeIsPureOp(node: any): boolean { let counter = 0; function traverseAndMaybeExecute( node: any, - inducedVariables: Record, + inducedVariables: InducedVariables, pal: Palette ): { result: any; @@ -92,7 +206,7 @@ function traverseAndMaybeExecute( if (counter > 500) { throw new Error("Too many iterations"); } - const thisIsPureOp = subTreeIsPureOp(node); + const thisIsPureOp = subTreeIsPureOp(node, inducedVariables); const allChildrenPureOps = Array.isArray(node?.children) ? (node?.children || []).every((x: any) => isValue(x)) : false; @@ -107,6 +221,7 @@ function traverseAndMaybeExecute( return { result: astResult, didEval: true }; } let updatedNode = node.copy(); + updatedNode.inducedVariables = inducedVariables; switch (node.nodeType) { case "pairFunction": case "numberOp": @@ -170,9 +285,10 @@ function traverseAndMaybeExecute( case "color": case "number": case "value": - case "variable": case undefined: return { result: node, didEval: false }; + case "variable": + return { result: node, didEval: false }; case "valueFunction": const arg = traverseAndMaybeExecute(node.input, inducedVariables, pal); if (arg.didEval) { @@ -183,7 +299,39 @@ function traverseAndMaybeExecute( } case "quantifier": - throw new Error("Quantifiers should not be evaluated here", node); + const values = getValues(node, pal); + // todo nested quantifiers + const results = values.map((color, i) => { + const whereResult = checkWhere( + node.where, + color, + node.varbs[0], + pal, + inducedVariables, + i + ); + if (!whereResult) { + return { result: "WHERE SKIP", didEval: true, color: color.copy() }; + } + const updatedVariables = { + ...inducedVariables, + [node.varbs[0]]: color, + [`index(${node.varbs[0]})`]: i, + }; + return { + color: color.copy(), + evals: generateEvaluations( + node.predicate.value || node.predicate, + updatedVariables, + pal + ), + }; + }); + // todo doesn't handle evaluation of the node + return { + result: { results, quant: node.type, varb: node.varbs[0] }, + didEval: true, + }; default: console.log(node.nodeType, " not implemented yet", node); @@ -193,16 +341,24 @@ function traverseAndMaybeExecute( } export function generateEvaluations( node: LLNode, - inducedVariables: Record, - pal: Palette + inducedVariables: InducedVariables, + pal: Palette, + init?: boolean ): LLNode[] { + if (init) { + counter = 0; + } const evalLog = [node.copy()]; let currentNode = node.copy(); - while (!subTreeIsPureOp(currentNode) && !isValue(currentNode)) { + while ( + !subTreeIsPureOp(currentNode, inducedVariables) && + !isValue(currentNode) + ) { const result = traverseAndMaybeExecute(currentNode, inducedVariables, pal); evalLog.push(result.result); currentNode = result.result; } + // get the final result const result = evaluateNode(node, inducedVariables, pal).result; const astResult = LLTypes.LLValue.tryToConstruct(result, {} as any); evalLog.push(astResult); diff --git a/apps/lil-buddy/src/linting/VisualSummarizer.svelte b/apps/lil-buddy/src/linting/VisualSummarizer.svelte index 42d51fd..e3fba81 100644 --- a/apps/lil-buddy/src/linting/VisualSummarizer.svelte +++ b/apps/lil-buddy/src/linting/VisualSummarizer.svelte @@ -2,31 +2,41 @@ import type { Palette } from "color-buddy-palette"; import DispatchNode from "./summary-nodes/DispatchNode.svelte"; import { GenerateAST } from "color-buddy-palette-lint"; + import { + generateEvaluations, + rewriteQuantifiers, + } from "../lib/small-step-evaluator"; import store from "../stores/store"; export let pal: Palette; export let lint: string; - $: ast = getAST(lint, $store.okayToExecute); + $: executionLog = getExecutionLog(lint, $store.okayToExecute); let error: any; - function getAST(lint: string, okayToExecute: boolean) { - console.log("ast"); + function getExecutionLog(lint: string, okayToExecute: boolean) { if (!okayToExecute) { error = "Changes in process"; return null; } try { - return GenerateAST(JSON.parse(lint)).value as any; + const ast = (GenerateAST(JSON.parse(lint) as any).value as any) + .children[0] as any; + const rewrittenAST = rewriteQuantifiers(ast); + const result = generateEvaluations(rewrittenAST, {}, pal, true).slice(1); + error = null; + return result; } catch (e) { error = e; } } - $: console.log("summarizer", $store.okayToExecute); + // $: console.log("summarizer", $store.okayToExecute, executionLog);
{#if error}
{error}
{:else} - + {#each executionLog || [] as log} + + {/each} {/if}
diff --git a/apps/lil-buddy/src/linting/summary-nodes/DispatchNode.svelte b/apps/lil-buddy/src/linting/summary-nodes/DispatchNode.svelte index 15d55a7..eb0486f 100644 --- a/apps/lil-buddy/src/linting/summary-nodes/DispatchNode.svelte +++ b/apps/lil-buddy/src/linting/summary-nodes/DispatchNode.svelte @@ -2,19 +2,11 @@ import type { Palette, Color } from "color-buddy-palette"; import InlineNode from "./InlineNode.svelte"; import QuantifierNode from "./QuantifierNode.svelte"; - import { getPredNodes, handleEval } from "./visual-summary-utils"; export let node: any; export let pal: Palette; - export let inducedVariables: Record = {}; - - $: predicateNodes = getPredNodes(node, inducedVariables, pal) as any[]; $: isNotNode = node.nodeType === "conjunction" && node.type === "not"; - function shouldComputeResult(node: any) { - const conjTypes = new Set(["and", "or"]); - return node.nodeType === "conjunction" && conjTypes.has(node.type); - } {#if node.nodeType == "conjunction" && !isNotNode} @@ -29,23 +21,15 @@ {/if} {#each node.children as child}
- +
{/each} - {#if shouldComputeResult(node)} -
→{handleEval(node, inducedVariables, pal).result}
- {/if} {:else if node.nodeType === "expression"} - -{:else if predicateNodes.length} - {#each predicateNodes as predicateNode} -
-
- -
- {/each} -{:else if node.nodeType === "quantifier"} - + +{:else if node.nodeType === "quantifier" || node.quant} + +{:else} + {/if} diff --git a/apps/lil-buddy/src/linting/summary-nodes/InlineNode.svelte b/apps/lil-buddy/src/linting/summary-nodes/InlineNode.svelte index db60cd9..19f54b2 100644 --- a/apps/lil-buddy/src/linting/summary-nodes/InlineNode.svelte +++ b/apps/lil-buddy/src/linting/summary-nodes/InlineNode.svelte @@ -1,39 +1,53 @@
{#if node.nodeType === "predicate"}
- -
{node.type}
- + +
{node.type}
+
{:else if node.nodeType === "conjunction" && node.type === "not"} -
+
NOT - +
{:else if node.nodeType === "conjunction"}
{node.type}
{#each node.children as child} - + {/each}
{:else if node.nodeType === "number"} -
{Math.round(node.value * 1000) / 1000}
+
{`${toThreeDigit(node.value)}`}
{:else if node.nodeType === "variable"} - {#if inducedVariables[node.value]} + {#if env[node.value]}
{:else if node.value === "colors"} {#each pal.colors as color} @@ -49,21 +63,21 @@
{node.type} {"("} - + {","} - + {")"}
{:else if node.nodeType === "valueFunction"}
{node.type} {"("} - + {")"}
{:else if node.nodeType === "color"} - {#if node.value.channels["L"] === 0 && node.value.channels["a"] === 0 && node.value.channels["b"] === 0} + {#if node.value.channels["L"] === 0 && node.value.channels["a"] === 0 && node.value.channels["b"] === 0 && node.constructorString !== "#000"} {node.constructorString} {:else}
{"("} {#if Array.isArray(node.children)} {#each node.children as child} - + {#if child !== node.children[node.children.length - 1]} {","} {/if} {/each} {:else} - + {/if} {")"}
@@ -94,13 +108,13 @@ {"["} {#if Array.isArray(node.children)} {#each node.children as child} - + {#if child !== node.children[node.children.length - 1]} {","} {/if} {/each} {:else} - + {/if} {"]"}
@@ -110,21 +124,21 @@ {"("} {#if Array.isArray(node.children)} {#each node.children as child} - + {#if child !== node.children[node.children.length - 1]} {","} {/if} {/each} {:else} - + {/if} {","}
{node.varb}
{"=>"} - + {")"}
{:else if node.nodeType === "expression"} - + {/if}
diff --git a/apps/lil-buddy/src/linting/summary-nodes/QuantifierNode.svelte b/apps/lil-buddy/src/linting/summary-nodes/QuantifierNode.svelte index d9606fd..d4f93c6 100644 --- a/apps/lil-buddy/src/linting/summary-nodes/QuantifierNode.svelte +++ b/apps/lil-buddy/src/linting/summary-nodes/QuantifierNode.svelte @@ -1,55 +1,54 @@ -
-
-
{node.type} - {node.varbs}
-
- {#each values as color} -
-
- {#each Object.values(inducedVariables) as innerColor} -
- {/each} -
-
-
-
- {#if checkWhere(node.where, color, node.varbs[0], pal, inducedVariables)} - +{#if node.nodeType !== "quantifier"} +
+
+ + {#if open} +
+ {#each node.results as result} +
+
+
- {:else} -
- removed by where - {/if} +
+
+
+
+ {#if result.result === "WHERE SKIP"} +
+ removed by where + {:else} + {#each result.evals as evaluation, idx} + + {#if idx < result.evals.length - 1} +
+ {/if} + {/each} + {/if} +
+
-
+ {/each}
- {/each} + {/if}
-
→{nodeResult.result}
- -
+{/if} diff --git a/apps/lil-buddy/src/linting/summary-nodes/visual-summary-utils.ts b/apps/lil-buddy/src/linting/summary-nodes/visual-summary-utils.ts deleted file mode 100644 index a641c34..0000000 --- a/apps/lil-buddy/src/linting/summary-nodes/visual-summary-utils.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { - generateEvaluations, - evaluateNode, -} from "../../lib/small-step-evaluator"; -import { makePalFromString } from "color-buddy-palette"; -import type { Palette, Color } from "color-buddy-palette"; - -const evalNodeTypes = new Set(["predicate"]); -export function getPredNodes( - node: any, - inducedVariables: Record = {}, - pal: Palette -) { - const isNotNode = node.nodeType === "conjunction" && node.type === "not"; - if (evalNodeTypes.has(node.nodeType) || isNotNode) { - try { - return generateEvaluations(node, inducedVariables, pal); - } catch (e) { - console.error(e); - } - } - return []; -} - -export function checkWhere( - node: any, - color: Color, - varb: string, - pal: Palette, - inducedVariables: Record -): boolean { - if (!node) return true; - const result = evaluateNode( - node, - { ...inducedVariables, [varb]: color }, - pal - ); - return result.result; -} - -export function handleEval(node: any, inducedVariables: any, pal: any) { - try { - return evaluateNode(node, inducedVariables, pal); - } catch (e) { - console.error(e); - return { result: "error" }; - } -} - -export function getValues(node: any, pal: Palette) { - if (node?.input?.value === "colors") { - return pal.colors; - } - if ( - Array.isArray(node?.input?.children) && - typeof node.input.children?.at(0)?.constructorString - ) { - return makePalFromString( - node.input.children.map((x: any) => x.constructorString) - ).colors; - } - - return []; -} diff --git a/packages/palette-lint/src/lint-language/lint-language.ts b/packages/palette-lint/src/lint-language/lint-language.ts index 40e0acb..1d62c55 100644 --- a/packages/palette-lint/src/lint-language/lint-language.ts +++ b/packages/palette-lint/src/lint-language/lint-language.ts @@ -162,7 +162,6 @@ export class LLNode { return "Node"; } copy() { - console.log("asd", this); return new LLNode(); } } @@ -825,6 +824,9 @@ export class LLPairFunction extends LLNode { this.type }(${this.left.toString()}, ${this.right.toString()}${paramString})`; } + copy() { + return new LLPairFunction(this.type, this.left, this.right, this.params); + } } let f = (a: any[], b: any[]) =>