Skip to content

Added some rules and generated Calcite codes for them#10

Merged
Sicheng-Pan merged 2 commits intoqed-solver:dslfrom
zengzirong:zzr
May 7, 2025
Merged

Added some rules and generated Calcite codes for them#10
Sicheng-Pan merged 2 commits intoqed-solver:dslfrom
zengzirong:zzr

Conversation

@zengzirong
Copy link
Collaborator

I added the rules of UnionMerge, IntersectMerge, JoinExtractFilter, SemiJoinFilterTranspose, and FilterSetOpTranspose in RRuleInstance.java.

For now, the set operation in FilterSetOpTranspose is supposed to be a union operation. Maybe it can later be extended to include an intersection operation and become a rule family. By the way, it seems we don't support generating and applying Java code for a rule family currently.

I implemented some onMatch rules and transform rules in CalciteGenerator.java so that Java code can be generated for these five rules. These five rules can work correctly by testing them in CalciteTest.java.

After implementing these onMatch and transform rules, Java code can also be generated for some other rules. However, some of these rules cannot work correctly, and I am still looking for the reasons.

I also noticed that some rules, like ProjectMerge, FilterReduceFalse, and FilterReduceTrue, might be automatically optimized by the RuleBuilder. I have commented out the code for testing them in CalciteTest.java.

@Sicheng-Pan
Copy link
Collaborator

Sicheng-Pan commented May 3, 2025

Looks good. Have you tried to verify your rules with the prover?

@zengzirong
Copy link
Collaborator Author

Looks good. Have you tried to verify your rules with the prover?

Yes. They are provable.

@Sicheng-Pan Sicheng-Pan merged commit 6844d81 into qed-solver:dsl May 7, 2025
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