-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_children.js
More file actions
54 lines (43 loc) · 2.81 KB
/
debug_children.js
File metadata and controls
54 lines (43 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Debug children generation for log_sum_exp
console.log("=== DEBUGGING CHILDREN GENERATION ===");
const logSumExpOp = QUIZ_OPERATORS.find(op => op.prefix === "log_sum_exp(");
const geoMeanOp = QUIZ_OPERATORS.find(op => op.prefix === "geo_mean(");
console.log("log_sum_exp operator:", logSumExpOp);
console.log("geo_mean operator:", geoMeanOp);
if (logSumExpOp && geoMeanOp) {
console.log("\nlog_sum_exp argument constraints:");
logSumExpOp.arguments.forEach((arg, i) => {
console.log(` Position ${i}: convex=${arg.convex}, concave=${arg.concave}, positive=${arg.positive}, negative=${arg.negative}`);
});
console.log("\ngeo_mean properties:");
console.log(` convex=${geoMeanOp.convex}, concave=${geoMeanOp.concave}, positive=${geoMeanOp.positive}, negative=${geoMeanOp.negative}`);
// Test if geo_mean would be filtered for log_sum_exp's first argument
const argConstraint = logSumExpOp.arguments.find(arg => arg.position === 0);
console.log("\nTesting if geo_mean matches log_sum_exp's first argument constraint:");
if (argConstraint) {
const possibleType = {
positive: argConstraint.positive,
negative: argConstraint.negative,
convex: argConstraint.convex,
concave: argConstraint.concave
};
console.log("Required type:", possibleType);
// Test the filtering logic
const positiveMatch = (geoMeanOp.positive === possibleType.positive) || (geoMeanOp.positive === true);
const negativeMatch = (geoMeanOp.negative === possibleType.negative) || (geoMeanOp.negative === true);
const convexMatch = (geoMeanOp.convex === possibleType.convex) || (geoMeanOp.convex === true);
const concaveMatch = (geoMeanOp.concave === possibleType.concave) || (geoMeanOp.concave === true);
console.log("Filtering results:");
console.log(` positive: ${geoMeanOp.positive} === ${possibleType.positive} || ${geoMeanOp.positive} === true => ${positiveMatch}`);
console.log(` negative: ${geoMeanOp.negative} === ${possibleType.negative} || ${geoMeanOp.negative} === true => ${negativeMatch}`);
console.log(` convex: ${geoMeanOp.convex} === ${possibleType.convex} || ${geoMeanOp.convex} === true => ${convexMatch}`);
console.log(` concave: ${geoMeanOp.concave} === ${possibleType.concave} || ${geoMeanOp.concave} === true => ${concaveMatch}`);
const wouldMatch = positiveMatch && negativeMatch && convexMatch && concaveMatch;
console.log(` OVERALL MATCH: ${wouldMatch}`);
if (wouldMatch) {
console.log("❌ BUG: geo_mean incorrectly matches log_sum_exp's argument constraints!");
} else {
console.log("✅ CORRECT: geo_mean correctly rejected for log_sum_exp arguments");
}
}
}