Skip to content

Inline AND/OR#446

Draft
robknight wants to merge 3 commits intomulti_batch_splittingfrom
inline_junctions
Draft

Inline AND/OR#446
robknight wants to merge 3 commits intomulti_batch_splittingfrom
inline_junctions

Conversation

@robknight
Copy link
Collaborator

@robknight robknight commented Jan 1, 2026

Add support for inline conjunction blocks (AND/OR) within predicate definitions. This allows users to write nested predicates directly in their definitions, which are then lifted into anonymous predicates during the lowering pass.

Example:

my_pred(A, B) = AND(
    AND(
        Equal(A["foo"], 123)
    )
    Equal(A["bar"], B)
)

Gets transformed into:

my_pred$anon_0(A) = AND(
  Equal(A["foo"], 123)
)

my_pred(A, B) = AND(
  my_pred$anon_0(A)
  Equal(A["bar"], B)
)

Key changes:

  • Grammar: Add inline_conjunction and predicate_call rules
  • AST: Add StatementTmplKind enum with Call and InlineConjunction variants
  • Lifting: New frontend_ast_lift.rs with AnonPredicateLifter
  • Validation: Handle inline conjunction validation
  • Lower: Call lifting pass before splitting

robknight and others added 3 commits December 30, 2025 08:54
Add support for inline conjunction blocks (AND/OR) within predicate
definitions. This allows users to write nested predicates directly in
their definitions, which are then lifted into anonymous predicates during
the lowering pass.

Example:
```
my_pred(A, B) = AND(
    AND(
        Equal(A["foo"], 123)
    )
    Equal(A["bar"], B)
)
```

Gets transformed into:
```
my_pred$anon_0(A) = AND(Equal(A["foo"], 123))
my_pred(A, B) = AND(my_pred$anon_0(A), Equal(A["bar"], B))
```

Key changes:
- Grammar: Add inline_conjunction and predicate_call rules
- AST: Add StatementTmplKind enum with Call and InlineConjunction variants
- Lifting: New frontend_ast_lift.rs with AnonPredicateLifter
- Validation: Handle inline conjunction validation
- Lower: Call lifting pass before splitting

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@robknight robknight changed the title Multi-batch splitting Inline AND/OR Jan 1, 2026
@robknight robknight force-pushed the multi_batch_splitting branch 6 times, most recently from 125d34f to 5eb5bdd Compare January 23, 2026 03:57
@robknight robknight marked this pull request as draft January 23, 2026 04:39
@robknight robknight force-pushed the multi_batch_splitting branch from d46530b to 0beb632 Compare January 23, 2026 17:21
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