@logic-pad/core 0.25.2 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/logic-core.global.d.ts +17 -104
- package/dist/src/data/grid.d.ts +1 -0
- package/dist/src/data/grid.js +10 -0
- package/dist/src/data/rules/noLoopsRule.js +123 -19
- package/dist/src/data/rules/offByXRule.js +2 -0
- package/dist/src/data/solver/allSolvers.js +0 -2
- package/dist/src/data/solver/auto/autoSolver.d.ts +2 -1
- package/dist/src/data/solver/auto/autoSolver.js +13 -17
- package/dist/src/data/solver/backtrack/backtrackSolver.d.ts +3 -1
- package/dist/src/data/solver/backtrack/backtrackSolver.js +2 -2
- package/dist/src/data/solver/backtrack/backtrackWorker.js +2 -2
- package/dist/src/data/solver/backtrack/data.d.ts +1 -0
- package/dist/src/data/solver/backtrack/data.js +43 -0
- package/dist/src/data/solver/backtrack/symbols/areaNumber.js +4 -1
- package/dist/src/data/solver/backtrack/symbols/letter.js +4 -1
- package/dist/src/data/solver/cspuz/cspuzSolver.d.ts +2 -1
- package/dist/src/data/solver/cspuz/cspuzSolver.js +46 -19
- package/dist/src/data/solver/solver.d.ts +2 -1
- package/dist/src/data/solver/solver.js +8 -7
- package/dist/src/data/solver/universal/universalSolver.d.ts +0 -1
- package/dist/src/data/solver/universal/universalSolver.js +0 -7
- package/dist/src/data/symbols/areaNumberSymbol.d.ts +1 -1
- package/dist/src/data/symbols/areaNumberSymbol.js +2 -0
- package/dist/src/data/symbols/everyLetterSymbol.js +2 -0
- package/dist/src/data/symbols/houseSymbol.d.ts +1 -1
- package/dist/src/data/symbols/houseSymbol.js +2 -0
- package/dist/src/data/symbols/letterSymbol.js +2 -0
- package/dist/src/data/symbols/numberSymbol.d.ts +1 -1
- package/dist/src/data/symbols/numberSymbol.js +4 -1
- package/dist/src/data/symbols/symbol.d.ts +5 -0
- package/dist/src/data/symbols/symbol.js +32 -0
- package/dist/src/index.d.ts +3 -16
- package/dist/src/index.js +3 -16
- package/package.json +1 -3
- package/dist/src/data/solver/z3/modules/areaNumberModule.d.ts +0 -9
- package/dist/src/data/solver/z3/modules/areaNumberModule.js +0 -27
- package/dist/src/data/solver/z3/modules/cellCountModule.d.ts +0 -9
- package/dist/src/data/solver/z3/modules/cellCountModule.js +0 -51
- package/dist/src/data/solver/z3/modules/connectAllModule.d.ts +0 -9
- package/dist/src/data/solver/z3/modules/connectAllModule.js +0 -24
- package/dist/src/data/solver/z3/modules/dartModule.d.ts +0 -9
- package/dist/src/data/solver/z3/modules/dartModule.js +0 -61
- package/dist/src/data/solver/z3/modules/index.d.ts +0 -3
- package/dist/src/data/solver/z3/modules/index.js +0 -10
- package/dist/src/data/solver/z3/modules/letterModule.d.ts +0 -9
- package/dist/src/data/solver/z3/modules/letterModule.js +0 -33
- package/dist/src/data/solver/z3/modules/modules.gen.d.ts +0 -8
- package/dist/src/data/solver/z3/modules/modules.gen.js +0 -12
- package/dist/src/data/solver/z3/modules/myopiaModule.d.ts +0 -9
- package/dist/src/data/solver/z3/modules/myopiaModule.js +0 -56
- package/dist/src/data/solver/z3/modules/regionAreaModule.d.ts +0 -9
- package/dist/src/data/solver/z3/modules/regionAreaModule.js +0 -40
- package/dist/src/data/solver/z3/modules/viewpointModule.d.ts +0 -9
- package/dist/src/data/solver/z3/modules/viewpointModule.js +0 -29
- package/dist/src/data/solver/z3/modules/z3Module.d.ts +0 -7
- package/dist/src/data/solver/z3/modules/z3Module.js +0 -3
- package/dist/src/data/solver/z3/utils.d.ts +0 -2
- package/dist/src/data/solver/z3/utils.js +0 -26
- package/dist/src/data/solver/z3/z3Solver.d.ts +0 -12
- package/dist/src/data/solver/z3/z3Solver.js +0 -123
- package/dist/src/data/solver/z3/z3SolverContext.d.ts +0 -13
- package/dist/src/data/solver/z3/z3SolverContext.js +0 -40
|
@@ -6,10 +6,10 @@ import { instance as symbolsPerRegionInstance } from '../../rules/symbolsPerRegi
|
|
|
6
6
|
import { instance as undercluedInstance } from '../../rules/undercluedRule.js';
|
|
7
7
|
import { instance as uniqueShapeInstance } from '../../rules/uniqueShapeRule.js';
|
|
8
8
|
import { instance as offByXInstance } from '../../rules/offByXRule.js';
|
|
9
|
-
import { instance as areaNumberInstance } from '../../symbols/areaNumberSymbol.js';
|
|
9
|
+
import AreaNumberSymbol, { instance as areaNumberInstance, } from '../../symbols/areaNumberSymbol.js';
|
|
10
10
|
import { instance as dartInstance } from '../../symbols/dartSymbol.js';
|
|
11
11
|
import GalaxySymbol, { instance as galaxyInstance, } from '../../symbols/galaxySymbol.js';
|
|
12
|
-
import { instance as letterInstance } from '../../symbols/letterSymbol.js';
|
|
12
|
+
import LetterSymbol, { instance as letterInstance, } from '../../symbols/letterSymbol.js';
|
|
13
13
|
import LotusSymbol, { instance as lotusInstance, } from '../../symbols/lotusSymbol.js';
|
|
14
14
|
import { instance as minesweeperInstance } from '../../symbols/minesweeperSymbol.js';
|
|
15
15
|
import { instance as viewpointInstance } from '../../symbols/viewpointSymbol.js';
|
|
@@ -50,31 +50,58 @@ export default class CspuzSolver extends EventIteratingSolver {
|
|
|
50
50
|
if (!super.isGridSupported(grid)) {
|
|
51
51
|
return false;
|
|
52
52
|
}
|
|
53
|
-
// special handling for
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
// special handling for fixed gray tiles
|
|
54
|
+
if (grid.getTileCount(true, true, Color.Gray) > 0) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
isInstructionSupported(grid, instruction) {
|
|
60
|
+
if (instruction instanceof LotusSymbol ||
|
|
61
|
+
instruction instanceof GalaxySymbol) {
|
|
62
|
+
if (instruction.x % 1 !== 0 && instruction.y % 1 !== 0) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (instruction instanceof LotusSymbol ||
|
|
67
|
+
instruction instanceof GalaxySymbol ||
|
|
68
|
+
instruction instanceof AreaNumberSymbol ||
|
|
69
|
+
instruction instanceof LetterSymbol) {
|
|
70
|
+
if (instruction.x % 1 !== 0 || instruction.y % 1 !== 0) {
|
|
71
|
+
const minX = Math.floor(instruction.x);
|
|
72
|
+
const minY = Math.floor(instruction.y);
|
|
73
|
+
const maxX = Math.ceil(instruction.x);
|
|
74
|
+
const maxY = Math.ceil(instruction.y);
|
|
75
|
+
const connectedTiles = grid.connections.getConnectedTiles({
|
|
76
|
+
x: minX,
|
|
77
|
+
y: minY,
|
|
78
|
+
});
|
|
79
|
+
if (connectedTiles.some(tile => tile.x === minX && tile.y === maxY) &&
|
|
80
|
+
connectedTiles.some(tile => tile.x === maxX && tile.y === minY) &&
|
|
81
|
+
connectedTiles.some(tile => tile.x === maxX && tile.y === maxY)) {
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
let color = Color.Gray;
|
|
85
|
+
for (let i = 0; i < 4; i++) {
|
|
86
|
+
const x = i % 2 === 0 ? minX : maxX;
|
|
87
|
+
const y = i < 2 ? minY : maxY;
|
|
88
|
+
const tile = grid.getTile(x, y);
|
|
89
|
+
if (!tile.fixed || !tile.exists) {
|
|
58
90
|
return false;
|
|
59
91
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
92
|
+
if (tile.color !== Color.Gray) {
|
|
93
|
+
if (color === Color.Gray) {
|
|
94
|
+
color = tile.color;
|
|
95
|
+
}
|
|
96
|
+
else if (color !== tile.color) {
|
|
64
97
|
return false;
|
|
65
98
|
}
|
|
66
99
|
}
|
|
67
100
|
}
|
|
101
|
+
return true;
|
|
68
102
|
}
|
|
69
103
|
}
|
|
70
|
-
|
|
71
|
-
if (grid.getTileCount(true, true, Color.Gray) > 0) {
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
return true;
|
|
75
|
-
}
|
|
76
|
-
isInstructionSupported(instructionId) {
|
|
77
|
-
return CspuzSolver.supportedInstrs.includes(instructionId);
|
|
104
|
+
return CspuzSolver.supportedInstrs.includes(instruction.id);
|
|
78
105
|
}
|
|
79
106
|
async isEnvironmentSupported() {
|
|
80
107
|
try {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CachedAccess } from '../dataHelper.js';
|
|
2
2
|
import GridData from '../grid.js';
|
|
3
|
+
import { Instruction } from '../../index.js';
|
|
3
4
|
/**
|
|
4
5
|
* Base class that all solvers must extend.
|
|
5
6
|
*/
|
|
@@ -61,7 +62,7 @@ export default abstract class Solver {
|
|
|
61
62
|
*
|
|
62
63
|
* @param instructionId The unique identifier of the instruction.
|
|
63
64
|
*/
|
|
64
|
-
isInstructionSupported(
|
|
65
|
+
isInstructionSupported(_grid: GridData, instruction: Instruction): boolean;
|
|
65
66
|
/**
|
|
66
67
|
* Check if the solver supports the given grid. This methid is frequently called when the user changes the grid, and
|
|
67
68
|
* the result is used to enable or disable the "Solve" button.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CachedAccess } from '../dataHelper.js';
|
|
2
2
|
import { allRules } from '../rules/index.js';
|
|
3
3
|
import { allSymbols } from '../symbols/index.js';
|
|
4
|
+
import { instance as undercluedInstance } from '../rules/undercluedRule.js';
|
|
4
5
|
/**
|
|
5
6
|
* Base class that all solvers must extend.
|
|
6
7
|
*/
|
|
@@ -24,14 +25,14 @@ export default class Solver {
|
|
|
24
25
|
*
|
|
25
26
|
* @param instructionId The unique identifier of the instruction.
|
|
26
27
|
*/
|
|
27
|
-
isInstructionSupported(
|
|
28
|
-
const symbol = allSymbols.get(
|
|
28
|
+
isInstructionSupported(_grid, instruction) {
|
|
29
|
+
const symbol = allSymbols.get(instruction.id);
|
|
29
30
|
if (symbol) {
|
|
30
31
|
return !symbol.validateWithSolution;
|
|
31
32
|
}
|
|
32
|
-
const rule = allRules.get(
|
|
33
|
+
const rule = allRules.get(instruction.id);
|
|
33
34
|
if (rule) {
|
|
34
|
-
return !rule.validateWithSolution;
|
|
35
|
+
return !rule.validateWithSolution || rule.id === undercluedInstance.id;
|
|
35
36
|
}
|
|
36
37
|
return false;
|
|
37
38
|
}
|
|
@@ -46,11 +47,11 @@ export default class Solver {
|
|
|
46
47
|
* @returns `true` if the grid is supported, or `false` otherwise.
|
|
47
48
|
*/
|
|
48
49
|
isGridSupported(grid) {
|
|
49
|
-
if (grid.rules.some(rule => rule.necessaryForCompletion &&
|
|
50
|
+
if (grid.rules.some(rule => rule.necessaryForCompletion &&
|
|
51
|
+
!this.isInstructionSupported(grid, rule))) {
|
|
50
52
|
return false;
|
|
51
53
|
}
|
|
52
|
-
if ([...grid.symbols.
|
|
53
|
-
!this.isInstructionSupported(id))) {
|
|
54
|
+
if ([...grid.symbols.values()].some(symbols => symbols.some(s => s.necessaryForCompletion && !this.isInstructionSupported(grid, s)))) {
|
|
54
55
|
return false;
|
|
55
56
|
}
|
|
56
57
|
return true;
|
|
@@ -4,5 +4,4 @@ export default class UniversalSolver extends EventIteratingSolver {
|
|
|
4
4
|
readonly author = "romain22222, Lysine";
|
|
5
5
|
readonly description = "A backtracking solver that supports all rules and symbols (including underclued) but is less optimized.";
|
|
6
6
|
protected createWorker(): Worker;
|
|
7
|
-
isInstructionSupported(instructionId: string): boolean;
|
|
8
7
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { instance as undercluedInstance } from '../../rules/undercluedRule.js';
|
|
2
1
|
import EventIteratingSolver from '../eventIteratingSolver.js';
|
|
3
2
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
4
3
|
('vite-apply-code-mod');
|
|
@@ -11,10 +10,4 @@ export default class UniversalSolver extends EventIteratingSolver {
|
|
|
11
10
|
type: 'module',
|
|
12
11
|
});
|
|
13
12
|
}
|
|
14
|
-
isInstructionSupported(instructionId) {
|
|
15
|
-
if (super.isInstructionSupported(instructionId)) {
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
return instructionId === undercluedInstance.id;
|
|
19
|
-
}
|
|
20
13
|
}
|
|
@@ -53,6 +53,8 @@ export default class AreaNumberSymbol extends NumberSymbol {
|
|
|
53
53
|
return AreaNumberSymbol.EXAMPLE_GRID;
|
|
54
54
|
}
|
|
55
55
|
countTiles(grid) {
|
|
56
|
+
if (!this.validateSubtilePlacement(grid))
|
|
57
|
+
return null;
|
|
56
58
|
const thisX = Math.floor(this.x);
|
|
57
59
|
const thisY = Math.floor(this.y);
|
|
58
60
|
const color = grid.getTile(thisX, thisY).color;
|
|
@@ -64,6 +64,8 @@ export default class EveryLetterSymbol extends Symbol {
|
|
|
64
64
|
return EveryLetterSymbol.EXAMPLE_GRID;
|
|
65
65
|
}
|
|
66
66
|
validateSymbol(grid) {
|
|
67
|
+
if (!this.validateSubtilePlacement(grid))
|
|
68
|
+
return State.Error;
|
|
67
69
|
const uniqueLetters = new Set(grid.symbols.get(this.id)?.map(s => s.letter));
|
|
68
70
|
if (uniqueLetters.size === 0) {
|
|
69
71
|
return State.Satisfied;
|
|
@@ -65,6 +65,8 @@ export default class HouseSymbol extends NumberSymbol {
|
|
|
65
65
|
return HouseSymbol.EXAMPLE_GRID;
|
|
66
66
|
}
|
|
67
67
|
countTiles(grid) {
|
|
68
|
+
if (!this.validateSubtilePlacement(grid))
|
|
69
|
+
return null;
|
|
68
70
|
const thisX = Math.floor(this.x);
|
|
69
71
|
const thisY = Math.floor(this.y);
|
|
70
72
|
const visited = array(grid.width, grid.height, () => false);
|
|
@@ -67,6 +67,8 @@ export default class LetterSymbol extends Symbol {
|
|
|
67
67
|
return LetterSymbol.EXAMPLE_GRID;
|
|
68
68
|
}
|
|
69
69
|
validateSymbol(grid) {
|
|
70
|
+
if (!this.validateSubtilePlacement(grid))
|
|
71
|
+
return State.Error;
|
|
70
72
|
const thisX = Math.floor(this.x);
|
|
71
73
|
const thisY = Math.floor(this.y);
|
|
72
74
|
let complete = true;
|
|
@@ -15,7 +15,10 @@ export default class NumberSymbol extends Symbol {
|
|
|
15
15
|
this.number = number;
|
|
16
16
|
}
|
|
17
17
|
validateSymbol(grid) {
|
|
18
|
-
const
|
|
18
|
+
const countResult = this.countTiles(grid);
|
|
19
|
+
if (countResult === null)
|
|
20
|
+
return State.Error;
|
|
21
|
+
const { completed, possible } = countResult;
|
|
19
22
|
if (completed > this.number || possible < this.number)
|
|
20
23
|
return State.Error;
|
|
21
24
|
if (completed === this.number && possible === this.number)
|
|
@@ -20,5 +20,10 @@ export default abstract class Symbol extends Instruction implements GridResizeHa
|
|
|
20
20
|
withX(x: number): this;
|
|
21
21
|
withY(y: number): this;
|
|
22
22
|
withPosition(x: number, y: number): this;
|
|
23
|
+
/**
|
|
24
|
+
* For symbols that can be placed between tiles, this method implements the default validation logic,
|
|
25
|
+
* which requires all tiles touching the symbol to be either gray or of the same color.
|
|
26
|
+
*/
|
|
27
|
+
protected validateSubtilePlacement(grid: GridData): boolean;
|
|
23
28
|
}
|
|
24
29
|
export declare const instance: undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Instruction from '../instruction.js';
|
|
2
|
+
import { Color } from '../primitives.js';
|
|
2
3
|
export default class Symbol extends Instruction {
|
|
3
4
|
x;
|
|
4
5
|
y;
|
|
@@ -51,5 +52,36 @@ export default class Symbol extends Instruction {
|
|
|
51
52
|
withPosition(x, y) {
|
|
52
53
|
return this.copyWith({ x, y });
|
|
53
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* For symbols that can be placed between tiles, this method implements the default validation logic,
|
|
57
|
+
* which requires all tiles touching the symbol to be either gray or of the same color.
|
|
58
|
+
*/
|
|
59
|
+
validateSubtilePlacement(grid) {
|
|
60
|
+
if (this.placementStep >= 1)
|
|
61
|
+
return true;
|
|
62
|
+
const minX = Math.floor(this.x);
|
|
63
|
+
const minY = Math.floor(this.y);
|
|
64
|
+
if (minX === this.x && minY === this.y)
|
|
65
|
+
return true;
|
|
66
|
+
const maxX = Math.ceil(this.x);
|
|
67
|
+
const maxY = Math.ceil(this.y);
|
|
68
|
+
let color = Color.Gray;
|
|
69
|
+
for (let i = 0; i < 4; i++) {
|
|
70
|
+
const x = i % 2 === 0 ? minX : maxX;
|
|
71
|
+
const y = i < 2 ? minY : maxY;
|
|
72
|
+
const tile = grid.getTile(x, y);
|
|
73
|
+
if (!tile.exists)
|
|
74
|
+
return false;
|
|
75
|
+
if (tile.color !== Color.Gray) {
|
|
76
|
+
if (color === Color.Gray) {
|
|
77
|
+
color = tile.color;
|
|
78
|
+
}
|
|
79
|
+
else if (color !== tile.color) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
54
86
|
}
|
|
55
87
|
export const instance = undefined;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { handlesSetGrid, invokeSetGrid } from './data/events/onSetGrid.js';
|
|
|
10
10
|
import { handlesSymbolDisplay } from './data/events/onSymbolDisplay.js';
|
|
11
11
|
import { handlesSymbolMerge } from './data/events/onSymbolMerge.js';
|
|
12
12
|
import { handlesSymbolValidation } from './data/events/onSymbolValidation.js';
|
|
13
|
-
import GridData, { NEIGHBOR_OFFSETS } from './data/grid.js';
|
|
13
|
+
import GridData, { NEIGHBOR_OFFSETS, NEIGHBOR_OFFSETS_8 } from './data/grid.js';
|
|
14
14
|
import GridConnections from './data/gridConnections.js';
|
|
15
15
|
import GridZones from './data/gridZones.js';
|
|
16
16
|
import Instruction from './data/instruction.js';
|
|
@@ -58,7 +58,7 @@ import { getShapeVariants, normalizeShape, positionsToShape, sanitizePatternGrid
|
|
|
58
58
|
import { allSolvers } from './data/solver/allSolvers.js';
|
|
59
59
|
import AutoSolver from './data/solver/auto/autoSolver.js';
|
|
60
60
|
import BacktrackSolver from './data/solver/backtrack/backtrackSolver.js';
|
|
61
|
-
import BTModule, { BTGridData, BTTile, IntArray2D, colorToBTTile, createOneTileResult, getOppositeColor } from './data/solver/backtrack/data.js';
|
|
61
|
+
import BTModule, { BTGridData, BTTile, IntArray2D, checkSubtilePlacement, colorToBTTile, createOneTileResult, getOppositeColor } from './data/solver/backtrack/data.js';
|
|
62
62
|
import BanPatternBTModule from './data/solver/backtrack/rules/banPattern.js';
|
|
63
63
|
import CellCountBTModule from './data/solver/backtrack/rules/cellCount.js';
|
|
64
64
|
import ConnectAllBTModule from './data/solver/backtrack/rules/connectAll.js';
|
|
@@ -82,19 +82,6 @@ import { gridToJson } from './data/solver/cspuz/jsonify.js';
|
|
|
82
82
|
import EventIteratingSolver from './data/solver/eventIteratingSolver.js';
|
|
83
83
|
import Solver from './data/solver/solver.js';
|
|
84
84
|
import UniversalSolver from './data/solver/universal/universalSolver.js';
|
|
85
|
-
import AreaNumberModule from './data/solver/z3/modules/areaNumberModule.js';
|
|
86
|
-
import CellCountModule from './data/solver/z3/modules/cellCountModule.js';
|
|
87
|
-
import ConnectAllModule from './data/solver/z3/modules/connectAllModule.js';
|
|
88
|
-
import DartModule from './data/solver/z3/modules/dartModule.js';
|
|
89
|
-
import { allZ3Modules } from './data/solver/z3/modules/index.js';
|
|
90
|
-
import LetterModule from './data/solver/z3/modules/letterModule.js';
|
|
91
|
-
import MyopiaModule from './data/solver/z3/modules/myopiaModule.js';
|
|
92
|
-
import RegionAreaModule from './data/solver/z3/modules/regionAreaModule.js';
|
|
93
|
-
import ViewpointModule from './data/solver/z3/modules/viewpointModule.js';
|
|
94
|
-
import Z3Module from './data/solver/z3/modules/z3Module.js';
|
|
95
|
-
import { convertDirection } from './data/solver/z3/utils.js';
|
|
96
|
-
import Z3Solver from './data/solver/z3/z3Solver.js';
|
|
97
|
-
import Z3SolverContext from './data/solver/z3/z3SolverContext.js';
|
|
98
85
|
import AreaNumberSymbol from './data/symbols/areaNumberSymbol.js';
|
|
99
86
|
import CustomIconSymbol from './data/symbols/customIconSymbol.js';
|
|
100
87
|
import CustomSymbol from './data/symbols/customSymbol.js';
|
|
@@ -118,4 +105,4 @@ import TileData from './data/tile.js';
|
|
|
118
105
|
import TileConnections from './data/tileConnections.js';
|
|
119
106
|
import validateGrid, { aggregateState, applyFinalOverrides } from './data/validate.js';
|
|
120
107
|
import { GridValidator } from './data/validateAsync.js';
|
|
121
|
-
export { ConfigType, configEquals, Configurable, CachedAccess, allEqual, array, directionToRotation, escape, isSameEdge, maxBy, minBy, move, orientationToRotation, resize, unescape, isEventHandler, handlesFinalValidation, handlesGetTile, handlesGridChange, handlesGridResize, handlesSetGrid, invokeSetGrid, handlesSymbolDisplay, handlesSymbolMerge, handlesSymbolValidation, GridData, NEIGHBOR_OFFSETS, GridConnections, GridZones, Instruction, COMPARISONS, Color, Comparison, DIRECTIONS, DRUM_SAMPLES, Direction, INSTRUMENTS, Instrument, MajorRule, Mode, ORIENTATIONS, Orientation, PuzzleType, State, WRAPPINGS, Wrapping, directionToggle, isDrumSample, orientationToggle, MetadataSchema, PuzzleSchema, getPuzzleTypes, puzzleEquals, validatePuzzleChecklist, BanPatternRule, CellCountPerZoneRule, CellCountRule, CompletePatternRule, ConnectAllRule, ConnectZonesRule, ContainsShapeRule, CustomRule, DifferentCountPerZoneRule, ExactCountPerZoneRule, ForesightRule, allRules, LyingSymbolRule, ControlLine, Row, MusicGridRule, MysteryRule, NoLoopsRule, OffByXRule, PerfectionRule, RegionAreaRule, RegionShapeRule, Rule, SameCountPerZoneRule, SameShapeRule, SymbolsPerRegionRule, UndercluedRule, UniqueShapeRule, WrapAroundRule, Serializer, Compressor, ChecksumCompressor, CompressorBase, DeflateCompressor, GzipCompressor, StreamCompressor, SerializerBase, SerializerChecksum, SerializerV0, OFFSETS, orientationChars, getShapeVariants, normalizeShape, positionsToShape, sanitizePatternGrid, shapeEquals, tilesToShape, allSolvers, AutoSolver, BacktrackSolver, BTModule, BTGridData, BTTile, IntArray2D, colorToBTTile, createOneTileResult, getOppositeColor, BanPatternBTModule, CellCountBTModule, ConnectAllBTModule, RegionAreaBTModule, RegionShapeBTModule, SameShapeBTModule, SymbolsPerRegionBTModule, UniqueShapeBTModule, AreaNumberBTModule, DartBTModule, DirectionLinkerBTModule, FocusBTModule, GalaxyBTModule, LetterBTModule, LotusBTModule, MinesweeperBTModule, MyopiaBTModule, ViewpointBTModule, CspuzSolver, gridToJson, EventIteratingSolver, Solver, UniversalSolver,
|
|
108
|
+
export { ConfigType, configEquals, Configurable, CachedAccess, allEqual, array, directionToRotation, escape, isSameEdge, maxBy, minBy, move, orientationToRotation, resize, unescape, isEventHandler, handlesFinalValidation, handlesGetTile, handlesGridChange, handlesGridResize, handlesSetGrid, invokeSetGrid, handlesSymbolDisplay, handlesSymbolMerge, handlesSymbolValidation, GridData, NEIGHBOR_OFFSETS, NEIGHBOR_OFFSETS_8, GridConnections, GridZones, Instruction, COMPARISONS, Color, Comparison, DIRECTIONS, DRUM_SAMPLES, Direction, INSTRUMENTS, Instrument, MajorRule, Mode, ORIENTATIONS, Orientation, PuzzleType, State, WRAPPINGS, Wrapping, directionToggle, isDrumSample, orientationToggle, MetadataSchema, PuzzleSchema, getPuzzleTypes, puzzleEquals, validatePuzzleChecklist, BanPatternRule, CellCountPerZoneRule, CellCountRule, CompletePatternRule, ConnectAllRule, ConnectZonesRule, ContainsShapeRule, CustomRule, DifferentCountPerZoneRule, ExactCountPerZoneRule, ForesightRule, allRules, LyingSymbolRule, ControlLine, Row, MusicGridRule, MysteryRule, NoLoopsRule, OffByXRule, PerfectionRule, RegionAreaRule, RegionShapeRule, Rule, SameCountPerZoneRule, SameShapeRule, SymbolsPerRegionRule, UndercluedRule, UniqueShapeRule, WrapAroundRule, Serializer, Compressor, ChecksumCompressor, CompressorBase, DeflateCompressor, GzipCompressor, StreamCompressor, SerializerBase, SerializerChecksum, SerializerV0, OFFSETS, orientationChars, getShapeVariants, normalizeShape, positionsToShape, sanitizePatternGrid, shapeEquals, tilesToShape, allSolvers, AutoSolver, BacktrackSolver, BTModule, BTGridData, BTTile, IntArray2D, checkSubtilePlacement, colorToBTTile, createOneTileResult, getOppositeColor, BanPatternBTModule, CellCountBTModule, ConnectAllBTModule, RegionAreaBTModule, RegionShapeBTModule, SameShapeBTModule, SymbolsPerRegionBTModule, UniqueShapeBTModule, AreaNumberBTModule, DartBTModule, DirectionLinkerBTModule, FocusBTModule, GalaxyBTModule, LetterBTModule, LotusBTModule, MinesweeperBTModule, MyopiaBTModule, ViewpointBTModule, CspuzSolver, gridToJson, EventIteratingSolver, Solver, UniversalSolver, AreaNumberSymbol, CustomIconSymbol, CustomSymbol, CustomTextSymbol, DartSymbol, DirectionLinkerSymbol, EveryLetterSymbol, FocusSymbol, GalaxySymbol, HiddenSymbol, HouseSymbol, allSymbols, LetterSymbol, LotusSymbol, MinesweeperSymbol, MyopiaSymbol, NumberSymbol, Symbol, ViewpointSymbol, TileData, TileConnections, validateGrid, aggregateState, applyFinalOverrides, GridValidator, };
|
package/dist/src/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import { handlesSetGrid, invokeSetGrid } from './data/events/onSetGrid.js';
|
|
|
13
13
|
import { handlesSymbolDisplay } from './data/events/onSymbolDisplay.js';
|
|
14
14
|
import { handlesSymbolMerge } from './data/events/onSymbolMerge.js';
|
|
15
15
|
import { handlesSymbolValidation } from './data/events/onSymbolValidation.js';
|
|
16
|
-
import GridData, { NEIGHBOR_OFFSETS } from './data/grid.js';
|
|
16
|
+
import GridData, { NEIGHBOR_OFFSETS, NEIGHBOR_OFFSETS_8 } from './data/grid.js';
|
|
17
17
|
import GridConnections from './data/gridConnections.js';
|
|
18
18
|
import GridZones from './data/gridZones.js';
|
|
19
19
|
import Instruction from './data/instruction.js';
|
|
@@ -61,7 +61,7 @@ import { getShapeVariants, normalizeShape, positionsToShape, sanitizePatternGrid
|
|
|
61
61
|
import { allSolvers } from './data/solver/allSolvers.js';
|
|
62
62
|
import AutoSolver from './data/solver/auto/autoSolver.js';
|
|
63
63
|
import BacktrackSolver from './data/solver/backtrack/backtrackSolver.js';
|
|
64
|
-
import BTModule, { BTGridData, BTTile, IntArray2D, colorToBTTile, createOneTileResult, getOppositeColor } from './data/solver/backtrack/data.js';
|
|
64
|
+
import BTModule, { BTGridData, BTTile, IntArray2D, checkSubtilePlacement, colorToBTTile, createOneTileResult, getOppositeColor } from './data/solver/backtrack/data.js';
|
|
65
65
|
import BanPatternBTModule from './data/solver/backtrack/rules/banPattern.js';
|
|
66
66
|
import CellCountBTModule from './data/solver/backtrack/rules/cellCount.js';
|
|
67
67
|
import ConnectAllBTModule from './data/solver/backtrack/rules/connectAll.js';
|
|
@@ -85,19 +85,6 @@ import { gridToJson } from './data/solver/cspuz/jsonify.js';
|
|
|
85
85
|
import EventIteratingSolver from './data/solver/eventIteratingSolver.js';
|
|
86
86
|
import Solver from './data/solver/solver.js';
|
|
87
87
|
import UniversalSolver from './data/solver/universal/universalSolver.js';
|
|
88
|
-
import AreaNumberModule from './data/solver/z3/modules/areaNumberModule.js';
|
|
89
|
-
import CellCountModule from './data/solver/z3/modules/cellCountModule.js';
|
|
90
|
-
import ConnectAllModule from './data/solver/z3/modules/connectAllModule.js';
|
|
91
|
-
import DartModule from './data/solver/z3/modules/dartModule.js';
|
|
92
|
-
import { allZ3Modules } from './data/solver/z3/modules/index.js';
|
|
93
|
-
import LetterModule from './data/solver/z3/modules/letterModule.js';
|
|
94
|
-
import MyopiaModule from './data/solver/z3/modules/myopiaModule.js';
|
|
95
|
-
import RegionAreaModule from './data/solver/z3/modules/regionAreaModule.js';
|
|
96
|
-
import ViewpointModule from './data/solver/z3/modules/viewpointModule.js';
|
|
97
|
-
import Z3Module from './data/solver/z3/modules/z3Module.js';
|
|
98
|
-
import { convertDirection } from './data/solver/z3/utils.js';
|
|
99
|
-
import Z3Solver from './data/solver/z3/z3Solver.js';
|
|
100
|
-
import Z3SolverContext from './data/solver/z3/z3SolverContext.js';
|
|
101
88
|
import AreaNumberSymbol from './data/symbols/areaNumberSymbol.js';
|
|
102
89
|
import CustomIconSymbol from './data/symbols/customIconSymbol.js';
|
|
103
90
|
import CustomSymbol from './data/symbols/customSymbol.js';
|
|
@@ -121,4 +108,4 @@ import TileData from './data/tile.js';
|
|
|
121
108
|
import TileConnections from './data/tileConnections.js';
|
|
122
109
|
import validateGrid, { aggregateState, applyFinalOverrides } from './data/validate.js';
|
|
123
110
|
import { GridValidator } from './data/validateAsync.js';
|
|
124
|
-
export { ConfigType, configEquals, Configurable, CachedAccess, allEqual, array, directionToRotation, escape, isSameEdge, maxBy, minBy, move, orientationToRotation, resize, unescape, isEventHandler, handlesFinalValidation, handlesGetTile, handlesGridChange, handlesGridResize, handlesSetGrid, invokeSetGrid, handlesSymbolDisplay, handlesSymbolMerge, handlesSymbolValidation, GridData, NEIGHBOR_OFFSETS, GridConnections, GridZones, Instruction, COMPARISONS, Color, Comparison, DIRECTIONS, DRUM_SAMPLES, Direction, INSTRUMENTS, Instrument, MajorRule, Mode, ORIENTATIONS, Orientation, PuzzleType, State, WRAPPINGS, Wrapping, directionToggle, isDrumSample, orientationToggle, MetadataSchema, PuzzleSchema, getPuzzleTypes, puzzleEquals, validatePuzzleChecklist, BanPatternRule, CellCountPerZoneRule, CellCountRule, CompletePatternRule, ConnectAllRule, ConnectZonesRule, ContainsShapeRule, CustomRule, DifferentCountPerZoneRule, ExactCountPerZoneRule, ForesightRule, allRules, LyingSymbolRule, ControlLine, Row, MusicGridRule, MysteryRule, NoLoopsRule, OffByXRule, PerfectionRule, RegionAreaRule, RegionShapeRule, Rule, SameCountPerZoneRule, SameShapeRule, SymbolsPerRegionRule, UndercluedRule, UniqueShapeRule, WrapAroundRule, Serializer, Compressor, ChecksumCompressor, CompressorBase, DeflateCompressor, GzipCompressor, StreamCompressor, SerializerBase, SerializerChecksum, SerializerV0, OFFSETS, orientationChars, getShapeVariants, normalizeShape, positionsToShape, sanitizePatternGrid, shapeEquals, tilesToShape, allSolvers, AutoSolver, BacktrackSolver, BTModule, BTGridData, BTTile, IntArray2D, colorToBTTile, createOneTileResult, getOppositeColor, BanPatternBTModule, CellCountBTModule, ConnectAllBTModule, RegionAreaBTModule, RegionShapeBTModule, SameShapeBTModule, SymbolsPerRegionBTModule, UniqueShapeBTModule, AreaNumberBTModule, DartBTModule, DirectionLinkerBTModule, FocusBTModule, GalaxyBTModule, LetterBTModule, LotusBTModule, MinesweeperBTModule, MyopiaBTModule, ViewpointBTModule, CspuzSolver, gridToJson, EventIteratingSolver, Solver, UniversalSolver,
|
|
111
|
+
export { ConfigType, configEquals, Configurable, CachedAccess, allEqual, array, directionToRotation, escape, isSameEdge, maxBy, minBy, move, orientationToRotation, resize, unescape, isEventHandler, handlesFinalValidation, handlesGetTile, handlesGridChange, handlesGridResize, handlesSetGrid, invokeSetGrid, handlesSymbolDisplay, handlesSymbolMerge, handlesSymbolValidation, GridData, NEIGHBOR_OFFSETS, NEIGHBOR_OFFSETS_8, GridConnections, GridZones, Instruction, COMPARISONS, Color, Comparison, DIRECTIONS, DRUM_SAMPLES, Direction, INSTRUMENTS, Instrument, MajorRule, Mode, ORIENTATIONS, Orientation, PuzzleType, State, WRAPPINGS, Wrapping, directionToggle, isDrumSample, orientationToggle, MetadataSchema, PuzzleSchema, getPuzzleTypes, puzzleEquals, validatePuzzleChecklist, BanPatternRule, CellCountPerZoneRule, CellCountRule, CompletePatternRule, ConnectAllRule, ConnectZonesRule, ContainsShapeRule, CustomRule, DifferentCountPerZoneRule, ExactCountPerZoneRule, ForesightRule, allRules, LyingSymbolRule, ControlLine, Row, MusicGridRule, MysteryRule, NoLoopsRule, OffByXRule, PerfectionRule, RegionAreaRule, RegionShapeRule, Rule, SameCountPerZoneRule, SameShapeRule, SymbolsPerRegionRule, UndercluedRule, UniqueShapeRule, WrapAroundRule, Serializer, Compressor, ChecksumCompressor, CompressorBase, DeflateCompressor, GzipCompressor, StreamCompressor, SerializerBase, SerializerChecksum, SerializerV0, OFFSETS, orientationChars, getShapeVariants, normalizeShape, positionsToShape, sanitizePatternGrid, shapeEquals, tilesToShape, allSolvers, AutoSolver, BacktrackSolver, BTModule, BTGridData, BTTile, IntArray2D, checkSubtilePlacement, colorToBTTile, createOneTileResult, getOppositeColor, BanPatternBTModule, CellCountBTModule, ConnectAllBTModule, RegionAreaBTModule, RegionShapeBTModule, SameShapeBTModule, SymbolsPerRegionBTModule, UniqueShapeBTModule, AreaNumberBTModule, DartBTModule, DirectionLinkerBTModule, FocusBTModule, GalaxyBTModule, LetterBTModule, LotusBTModule, MinesweeperBTModule, MyopiaBTModule, ViewpointBTModule, CspuzSolver, gridToJson, EventIteratingSolver, Solver, UniversalSolver, AreaNumberSymbol, CustomIconSymbol, CustomSymbol, CustomTextSymbol, DartSymbol, DirectionLinkerSymbol, EveryLetterSymbol, FocusSymbol, GalaxySymbol, HiddenSymbol, HouseSymbol, allSymbols, LetterSymbol, LotusSymbol, MinesweeperSymbol, MyopiaSymbol, NumberSymbol, Symbol, ViewpointSymbol, TileData, TileConnections, validateGrid, aggregateState, applyFinalOverrides, GridValidator, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logic-pad/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -54,10 +54,8 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"compression-streams-polyfill": "^0.1.7",
|
|
56
56
|
"event-iterator": "^2.0.0",
|
|
57
|
-
"grilops": "^0.1.2",
|
|
58
57
|
"lodash": "^4.17.21",
|
|
59
58
|
"logic-pad-solver-core": "^0.1.2",
|
|
60
|
-
"z3-solver": "^4.13.0",
|
|
61
59
|
"zod": "^4.0.17"
|
|
62
60
|
},
|
|
63
61
|
"devDependencies": {
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Solver, Optimize } from 'z3-solver';
|
|
2
|
-
import GridData from '../../../grid.js';
|
|
3
|
-
import Z3SolverContext from '../z3SolverContext.js';
|
|
4
|
-
import Z3Module from './z3Module.js';
|
|
5
|
-
export default class AreaNumberModule extends Z3Module {
|
|
6
|
-
readonly id: string;
|
|
7
|
-
encode<Name extends string>(grid: GridData, ctx: Z3SolverContext<Name, Solver<Name> | Optimize<Name>>): void;
|
|
8
|
-
}
|
|
9
|
-
export declare const instance: AreaNumberModule;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import Z3Module from './z3Module.js';
|
|
2
|
-
import { instance as areaNumberInstance, } from '../../../symbols/areaNumberSymbol.js';
|
|
3
|
-
import { Point } from 'grilops';
|
|
4
|
-
export default class AreaNumberModule extends Z3Module {
|
|
5
|
-
id = areaNumberInstance.id;
|
|
6
|
-
encode(grid, ctx) {
|
|
7
|
-
const symbols = grid.symbols.get(this.id);
|
|
8
|
-
// optimizations
|
|
9
|
-
if (!symbols || symbols.length === 0) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
for (const symbol of symbols) {
|
|
13
|
-
if (symbol.number < 1) {
|
|
14
|
-
ctx.solver.add(ctx.ctx.Bool.val(false));
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
// encode for real
|
|
19
|
-
const rc = ctx.regionConstrainer;
|
|
20
|
-
for (const symbol of symbols) {
|
|
21
|
-
const x = Math.floor(symbol.x);
|
|
22
|
-
const y = Math.floor(symbol.y);
|
|
23
|
-
ctx.solver.add(rc.regionSizeGrid.get(new Point(y, x)).eq(Math.round(symbol.number)));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
export const instance = new AreaNumberModule();
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Solver, Optimize } from 'z3-solver';
|
|
2
|
-
import GridData from '../../../grid.js';
|
|
3
|
-
import Z3SolverContext from '../z3SolverContext.js';
|
|
4
|
-
import Z3Module from './z3Module.js';
|
|
5
|
-
export default class CellCountModule extends Z3Module {
|
|
6
|
-
readonly id: string;
|
|
7
|
-
encode<Name extends string>(grid: GridData, ctx: Z3SolverContext<Name, Solver<Name> | Optimize<Name>>): void;
|
|
8
|
-
}
|
|
9
|
-
export declare const instance: CellCountModule;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import Z3Module from './z3Module.js';
|
|
2
|
-
import { Point } from 'grilops';
|
|
3
|
-
import { instance as cellCountInstance, } from '../../../rules/cellCountRule.js';
|
|
4
|
-
import { Color } from '../../../primitives.js';
|
|
5
|
-
export default class CellCountModule extends Z3Module {
|
|
6
|
-
id = cellCountInstance.id;
|
|
7
|
-
encode(grid, ctx) {
|
|
8
|
-
const rules = grid.rules.filter(rule => rule.id === this.id);
|
|
9
|
-
// optimizations
|
|
10
|
-
if (rules.length === 0) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
const colorMap = new Map();
|
|
14
|
-
for (const rule of rules) {
|
|
15
|
-
if (colorMap.has(rule.color)) {
|
|
16
|
-
if (colorMap.get(rule.color) !== rule.count) {
|
|
17
|
-
ctx.solver.add(ctx.ctx.Bool.val(false));
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
colorMap.set(rule.color, rule.count);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
for (const [color, count] of colorMap.entries()) {
|
|
26
|
-
const { min, max } = grid.getColorCount(color);
|
|
27
|
-
if (min > count || max < count) {
|
|
28
|
-
ctx.solver.add(ctx.ctx.Bool.val(false));
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
if (colorMap.has(Color.Light) && colorMap.has(Color.Dark)) {
|
|
33
|
-
if (colorMap.get(Color.Light) + colorMap.get(Color.Dark) !==
|
|
34
|
-
grid.getTileCount(true)) {
|
|
35
|
-
ctx.solver.add(ctx.ctx.Bool.val(false));
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
// encode for real
|
|
40
|
-
for (const [color, count] of colorMap.entries()) {
|
|
41
|
-
const sumTerms = [];
|
|
42
|
-
grid.forEach((tile, x, y) => {
|
|
43
|
-
if (tile.exists) {
|
|
44
|
-
sumTerms.push(ctx.ctx.If(ctx.grid.cellAt(new Point(y, x)).eq(ctx.symbolSet.indices[color]), 1, 0));
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
ctx.solver.add(ctx.ctx.Sum(sumTerms[0], ...sumTerms.slice(1)).eq(count));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
export const instance = new CellCountModule();
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Solver, Optimize } from 'z3-solver';
|
|
2
|
-
import GridData from '../../../grid.js';
|
|
3
|
-
import Z3SolverContext from '../z3SolverContext.js';
|
|
4
|
-
import Z3Module from './z3Module.js';
|
|
5
|
-
export default class ConnectAllModule extends Z3Module {
|
|
6
|
-
readonly id: string;
|
|
7
|
-
encode<Name extends string>(grid: GridData, ctx: Z3SolverContext<Name, Solver<Name> | Optimize<Name>>): void;
|
|
8
|
-
}
|
|
9
|
-
export declare const instance: ConnectAllModule;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import Z3Module from './z3Module.js';
|
|
2
|
-
import { instance as connectAllInstance, } from '../../../rules/connectAllRule.js';
|
|
3
|
-
export default class ConnectAllModule extends Z3Module {
|
|
4
|
-
id = connectAllInstance.id;
|
|
5
|
-
encode(grid, ctx) {
|
|
6
|
-
const rules = grid.rules.filter(rule => rule.id === this.id);
|
|
7
|
-
// optimizations to try to simplify the encoding
|
|
8
|
-
if (rules.length === 0) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
// encode for real
|
|
12
|
-
const rc = ctx.regionConstrainer;
|
|
13
|
-
for (const color of new Set(rules.map(rule => rule.color))) {
|
|
14
|
-
const sumTerms = [];
|
|
15
|
-
for (const [p, cell] of ctx.grid.grid.entries()) {
|
|
16
|
-
sumTerms.push(ctx.ctx.If(cell
|
|
17
|
-
.eq(ctx.symbolSet.indices[color])
|
|
18
|
-
.and(rc.parentGrid.get(p).eq(1)), 1, 0));
|
|
19
|
-
}
|
|
20
|
-
ctx.solver.add(ctx.ctx.Sum(sumTerms[0], ...sumTerms.slice(1)).eq(1));
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
export const instance = new ConnectAllModule();
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Solver, Optimize } from 'z3-solver';
|
|
2
|
-
import GridData from '../../../grid.js';
|
|
3
|
-
import Z3SolverContext from '../z3SolverContext.js';
|
|
4
|
-
import Z3Module from './z3Module.js';
|
|
5
|
-
export default class DartModule extends Z3Module {
|
|
6
|
-
readonly id: string;
|
|
7
|
-
encode<Name extends string>(grid: GridData, ctx: Z3SolverContext<Name, Solver<Name> | Optimize<Name>>): void;
|
|
8
|
-
}
|
|
9
|
-
export declare const instance: DartModule;
|