Skip to content

Fix default BoolExpr accumulator construction#216

Open
zayenz wants to merge 2 commits into
mainfrom
feature/bool-expr-default-consrruction
Open

Fix default BoolExpr accumulator construction#216
zayenz wants to merge 2 commits into
mainfrom
feature/bool-expr-default-consrruction

Conversation

@zayenz

@zayenz zayenz commented Jul 7, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #139 by making a default-constructed BoolExpr behave as an empty accumulator during Boolean expression composition.

A default BoolExpr now acts as an identity for both && and || composition, so empty && x, x && empty, empty || x, and x || empty all collapse to x. This avoids choosing a global true/false meaning that would make one accumulator style silently wrong.

Posting or materializing a still-empty BoolExpr now fails explicitly with MiniModel::TooFewArguments("BoolExpr") instead of reading uninitialized node state.

Validation

  • cmake -S . -B /tmp/gecode-bool-expr-build -DCMAKE_BUILD_TYPE=Debug -DGECODE_ENABLE_EXAMPLES=OFF -DGECODE_ENABLE_GIST=OFF -DGECODE_ENABLE_QT=OFF
  • cmake --build /tmp/gecode-bool-expr-build --target gecode-test -j 8
  • /tmp/gecode-bool-expr-build/bin/gecode-test -test MiniModel::BoolExpr::Default
  • /tmp/gecode-bool-expr-build/bin/gecode-test -test MiniModel::BoolExpr
  • worker also validated the autoconf path: ./configure --disable-qt --disable-gist --disable-examples --disable-flatzinc --disable-float-vars --disable-set-vars --disable-mpfr, make -j4 test, and DYLD_LIBRARY_PATH=. ./test/test -test MiniModel::BoolExpr

@zayenz zayenz marked this pull request as ready for review July 7, 2026 14:30

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant