Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AST: Lazy evaluate boolean child nodes. #799

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

apognu
Copy link

@apognu apognu commented Jan 14, 2025

This adds circuit breaking to boolean evaluation.

An AND boolean resolves to false if the first operand is false, and an OR boolean resolves to true if the first operand is true. With this, second operands and skipped if they can have no sway on the node's result.

Circuit breaking is disabled when trying to validate a scenario, so all cases are considered.

@apognu apognu self-assigned this Jan 14, 2025
@apognu apognu requested a review from Pascal-Delange January 14, 2025 15:04
Copy link
Contributor

@Pascal-Delange Pascal-Delange left a comment

Choose a reason for hiding this comment

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

nice 👍

usecases/ast_eval/evaluate_ast.go Outdated Show resolved Hide resolved
usecases/ast_eval/evaluate_ast.go Outdated Show resolved Hide resolved
integration_test/scenario_flow_test.go Show resolved Hide resolved
@apognu
Copy link
Author

apognu commented Jan 14, 2025

Will amend tomorrow morning with the discussed edits.

This adds circuit breaking to boolean evaluation.
An AND boolean resolves to false if the first operand is false, and an OR boolean resolves to true if the first operand is true.
With this, second operands and skipped if they can have no sway on the node's result.
@apognu apognu force-pushed the feat/ast-boolean-lazy-evaluation branch from 896f4f0 to d0d3c04 Compare January 15, 2025 07:31
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.

2 participants