Skip to content

Commit 911c42e

Browse files
committed
fix(tools): correct binary tree constraint validation logic
- Fix binaryTree constraint to use positive checks for specific types - Prevents false positives when binaryTree is undefined - Changes from negative to positive validation logic - Ensures correct constraint validation for binary tree generators
1 parent 8c9de7a commit 911c42e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/graph-gen/src/constraints.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,9 @@ export const analyzeGraphSpecConstraints = (spec: GraphSpec): GraphSpecImpossibi
302302
// This is just a note for documentation purposes
303303

304304
// 24. Binary trees are trees
305-
if (spec.binaryTree?.kind !== "not_binary_tree" &&
306-
spec.binaryTree?.kind !== "unconstrained" &&
305+
if ((spec.binaryTree?.kind === "binary_tree" ||
306+
spec.binaryTree?.kind === "full_binary" ||
307+
spec.binaryTree?.kind === "complete_binary") &&
307308
spec.cycles.kind === "cycles_allowed") {
308309
impossibilities.push({
309310
property: "binaryTree/cycles",

0 commit comments

Comments
 (0)