Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
7b3c56c
Wrap interface
Sicheng-Pan Jan 30, 2024
aef3ace
Prototype new DSL
Sicheng-Pan Mar 6, 2024
4cd8361
Merge branch 'main' into dsl
Sicheng-Pan Mar 13, 2024
7c58e66
Bump progress so far
Sicheng-Pan Apr 30, 2024
517c9b0
Checkpoint for thesis
Sicheng-Pan May 16, 2024
5a56caf
fill out rules ProjectJoinTranspose, SemiJoinFilterTranspose, SemiJoi…
yushinliang Mar 31, 2025
be54749
try generate Calcite code with ProjectJoinTranspose
yushinliang Apr 1, 2025
e8e58f0
try generating calcite code for rules
yushinliang Apr 2, 2025
51d00cd
changing string templates back to strings
WKaiZ Feb 25, 2025
6096e32
Merge pull request #9 from WKaiZ/partial-change
akcheung Apr 23, 2025
bb40277
add FilterSetOpTranspose IntersectMerge JoinExtractFilter SemiJoinFil…
zengzirong May 2, 2025
923118c
add rules FilterSetOpTranspose IntersectMerge JoinExtractFilter SemiJ…
zengzirong May 3, 2025
6844d81
Merge pull request #10 from zengzirong/zzr
Sicheng-Pan May 7, 2025
0e125f1
refactored rule instances
zengzirong May 13, 2025
1320f04
removed unnecessary comments, refactored tests
zengzirong May 21, 2025
949603d
refactored file structure
zengzirong May 21, 2025
91cf38c
Merge remote-tracking branch 'upstream/dsl'
May 23, 2025
df26af8
add rules projectfiltertranspose and joinpushtransitivepredicates
WKaiZ May 23, 2025
86dbedb
verified SemiJoinRemove rule in PipelineInstance.java
May 25, 2025
639d9ed
generated semijoinremove calcite code
May 27, 2025
aa6c5fc
Merge branch 'dsl' into dsl
yushinliang May 27, 2025
4afed1a
Merge pull request #7 from yushinliang/dsl
akcheung May 27, 2025
d78e725
refactor semijoinremove
WKaiZ May 27, 2025
8f8f65b
removing comments; adding semijoinjointranspose and semijoinprojecttr…
WKaiZ May 27, 2025
c127a56
filter out .vscode
joyemang33 May 31, 2025
827f2d5
workflow try 1
zengzirong May 31, 2025
a2c66bc
workflow try 1
zengzirong May 31, 2025
34202e5
workflow test 1
zengzirong May 31, 2025
3b786ac
workflow try 2
zengzirong May 31, 2025
992131c
workflow test 2
zengzirong May 31, 2025
07f9723
workflow test 3
zengzirong May 31, 2025
09d36ee
new workflow try
zengzirong May 31, 2025
c88b45e
new workflow try
zengzirong May 31, 2025
0427842
workflow new try
zengzirong May 31, 2025
f2a93ba
src/main/java/org/qed/Generated/RRuleInstances/FilterIntoJoin.java
zengzirong May 31, 2025
1edfc9a
update .gitignore
joyemang33 May 31, 2025
c33bb3f
new workflow
zengzirong May 31, 2025
fc46291
new test
zengzirong May 31, 2025
71b9eb9
updated pom.xml
zengzirong May 31, 2025
e74cc30
new test
zengzirong May 31, 2025
de4e7eb
new workflow
zengzirong May 31, 2025
8697048
new test
zengzirong May 31, 2025
d7ddac7
workflow
zengzirong May 31, 2025
62a12dd
new test
zengzirong May 31, 2025
6913915
new workflow
zengzirong May 31, 2025
f5a4383
new test
zengzirong May 31, 2025
8ead6a7
new workflow
zengzirong Jun 1, 2025
5c00f9e
new test
zengzirong Jun 1, 2025
5b56bc6
new workflow
zengzirong Jun 1, 2025
440de53
new test
zengzirong Jun 1, 2025
3b82055
new test
zengzirong Jun 1, 2025
9f6a48b
new test
zengzirong Jun 1, 2025
7dd23c3
delete join associate temporarily
zengzirong Jun 1, 2025
c878388
new test
zengzirong Jun 1, 2025
e304797
new test
zengzirong Jun 1, 2025
5a39e4e
new test
zengzirong Jun 1, 2025
36c6c46
new test
zengzirong Jun 1, 2025
0667797
restore FilterIntoJoin.java
zengzirong Jun 1, 2025
e164dda
update test.yml
zengzirong Jun 1, 2025
a25c7dd
delete unprovable rules
zengzirong Jun 1, 2025
7a86409
test rule that cannot compile
zengzirong Jun 1, 2025
357dcb9
update workflow
zengzirong Jun 1, 2025
248f038
restore FilterIntoJoin.java to correct version
zengzirong Jun 1, 2025
1257866
update java version
zengzirong Jun 1, 2025
a0b066b
test workflow
zengzirong Jun 1, 2025
2a2e9ce
update workflow
zengzirong Jun 1, 2025
d21779e
new update
zengzirong Jun 1, 2025
f601430
Merge pull request #12 from zengzirong/zzr
joyemang33 Jun 1, 2025
e8c7847
CI Testing
zengzirong Jun 3, 2025
a202d28
Adding Prune Rules
WKaiZ Jun 5, 2025
f024bd5
Fixing PruneEmptyJoins
WKaiZ Jun 5, 2025
54376c3
Fixing PruneEmptyJoin
WKaiZ Jun 5, 2025
8df3817
Adjusting
WKaiZ Jun 5, 2025
9ac74e6
Adding PruneEmptyIntersect
WKaiZ Jun 5, 2025
67c5536
Merge pull request #15 from WKaiZ/dsl
WKaiZ Jun 7, 2025
3837421
added minus operator and generated code for MinusMerge (#16)
yushinliang Jun 9, 2025
3844e90
Fixed JoinCommute (#17)
zengzirong Jun 14, 2025
f44de6b
Adding Prune Rules and Its Tests
WKaiZ Jun 19, 2025
60918b8
Testing Out Aggregate
WKaiZ Jun 19, 2025
28db8b2
Editing PruneEmptyUnion
WKaiZ Jun 19, 2025
192d685
Adding Its Test
WKaiZ Jun 19, 2025
727b434
Removing comments
WKaiZ Jun 19, 2025
30fc245
Updating FilterAggregateTranspose, should pass provability
WKaiZ Jun 19, 2025
c6810e6
Adding Everything Except for FilterAggregateTranpose since other works
WKaiZ Jun 28, 2025
75f0b8c
Reversing Target version for now
WKaiZ Jun 28, 2025
9ec1299
Adding Prune Rules and Its Test Cases
WKaiZ Jun 29, 2025
53e8cef
Adding AggregateFilterTranspose and FilterAggregateTranspose
WKaiZ Jul 4, 2025
ff3c353
Testing...
WKaiZ Jul 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/codegen-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Test Code Generation

on:
push:
pull_request:

jobs:
test-code-generation:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '23'
distribution: 'temurin'

- name: Cache Maven dependencies
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- name: Build project
run: mvn -B compile --file pom.xml

- name: Run Calcite tests
run: |
chmod +x scripts/test-codegen.sh
./scripts/test-codegen.sh

- name: Upload generated code
if: always()
uses: actions/upload-artifact@v4
with:
name: generated-code
path: |
src/main/java/org/qed/Generated/*.java
!src/main/java/org/qed/Generated/CalciteTester.java
!src/main/java/org/qed/Generated/CalciteGenerator.java
!src/main/java/org/qed/Generated/CalciteUtilities.java
!src/main/java/org/qed/Generated/EmptyConfig.java
58 changes: 58 additions & 0 deletions .github/workflows/prover-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Test Provability

on:
push:
pull_request:

jobs:
test-provability:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '23'
distribution: 'temurin'

- name: Cache Maven dependencies
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- name: Build project
run: mvn -B compile --file pom.xml

- name: Generate JSON for all rules
run: |
mkdir -p tmp-rules
mvn dependency:resolve
chmod +x scripts/generate-rule-json.sh
./scripts/generate-rule-json.sh

- name: Install dependencies
run: |
chmod +x scripts/install-dependencies.sh
./scripts/install-dependencies.sh

- name: Build qed-prover
run: |
chmod +x scripts/build-qed-prover.sh
./scripts/build-qed-prover.sh

- name: Test all rules
run: |
chmod +x scripts/test-rules.sh
./scripts/test-rules.sh

- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: results
path: tmp-rules/
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
target/
*.iml
.mvn/wrapper/maven-wrapper.jar
.vscode
.devcontainer
44 changes: 24 additions & 20 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 36 additions & 14 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,57 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
parser-release = {
cvc5-src = {
flake = false;
url = "https://github.com/qed-solver/parser/releases/download/latest/qed-parser-1.0-SNAPSHOT-jar-with-dependencies.jar";
url = "github:cvc5/cvc5";
};
};

outputs = { self, nixpkgs, flake-utils, parser-release }:
outputs = { self, nixpkgs, flake-utils, cvc5-src }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
parser = pkgs.stdenv.mkDerivation {
name = "qed-parser";
src = parser-release;
buildInputs = with pkgs; [ jre ];
nativeBuildInputs = with pkgs; [ makeWrapper ];
buildCommand = ''
jar=$out/share/java/qed-parser.jar
install -Dm444 $src $jar
makeWrapper ${pkgs.jre}/bin/java $out/bin/qed-parser --add-flags "--enable-preview --add-opens=java.base/java.lang.reflect=ALL-UNNAMED -jar $jar"
cvc5-pname = "cvc5-1.0.5";
cvc5-java = pkgs.stdenv.mkDerivation {
name = cvc5-pname;
src = cvc5-src;

nativeBuildInputs = with pkgs; [ pkg-config cmake flex ];

buildInputs = with pkgs; [
cadical.dev
symfpu
gmp
gtest
libantlr3c
antlr3_4
boost
jdk21
(python3.withPackages (ps: with ps; [ pyparsing toml ]))
];

cmakeFlags = [
"-DBUILD_BINDINGS_JAVA=ON"
"-DBUILD_SHARED_LIBS=1"
"-DCMAKE_BUILD_TYPE=Production"
"-DANTLR3_JAR=${pkgs.antlr3_4}/lib/antlr/antlr-3.4-complete.jar"
];

preConfigure = ''
patchShebangs ./src/
'';

};
in
{
packages.default = parser;
devShells.default = pkgs.mkShell {
packages = with pkgs; [
jdk
cvc5-java
jdk21
jetbrains.idea-community
];
CVC5_JAVA = "${cvc5-java}/share/java/cvc5.jar";
LD_LIBRARY_PATH = pkgs.lib.strings.makeLibraryPath [ cvc5-java ];
};
});
}
30 changes: 23 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
<argument>-classpath</argument>
<classpath/>
<argument>org.qed.Main</argument>
<argument>${args}</argument>
</arguments>
</configuration>
</plugin>
Expand Down Expand Up @@ -52,9 +51,11 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>19</source>
<target>19</target>
<compilerArgs>--enable-preview</compilerArgs>
<source>23</source>
<target>23</target>
<compilerArgs>
<arg>--enable-preview</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
Expand Down Expand Up @@ -88,13 +89,28 @@
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>2.0.5</version>
<artifactId>slf4j-api</artifactId>
<version>2.0.12</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.12</version>
</dependency>
<dependency>
<groupId>org.glavo.kala</groupId>
<artifactId>kala-common</artifactId>
<version>0.67.0</version>
</dependency>
<dependency>
<groupId>io.github.p-org.solvers</groupId>
<artifactId>cvc5</artifactId>
<version>0.0.7-v5</version>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.10.2</version>
</dependency>
</dependencies>
</project>
</project>
72 changes: 72 additions & 0 deletions rules/JoinCommute-.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"help" : [ "LogicalJoin(condition=[pred($0, $1)], joinType=[inner])\n LogicalTableScan(table=[[Left]])\n LogicalTableScan(table=[[Right]])\n", "LogicalProject(col-Left=[$1], col-Right=[$0])\n LogicalJoin(condition=[pred($1, $0)], joinType=[inner])\n LogicalTableScan(table=[[Right]])\n LogicalTableScan(table=[[Left]])\n" ],
"schemas" : [ {
"types" : [ "INTEGER" ],
"nullable" : [ true ],
"name" : "Left",
"guaranteed" : [ ],
"fields" : [ "col-Left" ],
"key" : [ ]
}, {
"types" : [ "INTEGER" ],
"nullable" : [ true ],
"name" : "Right",
"guaranteed" : [ ],
"fields" : [ "col-Right" ],
"key" : [ ]
} ],
"queries" : [ {
"join" : {
"condition" : {
"type" : "BOOLEAN",
"operand" : [ {
"column" : 0,
"type" : "INTEGER"
}, {
"column" : 1,
"type" : "INTEGER"
} ],
"operator" : "pred"
},
"left" : {
"scan" : 0
},
"kind" : "INNER",
"right" : {
"scan" : 1
}
}
}, {
"project" : {
"source" : {
"join" : {
"condition" : {
"type" : "BOOLEAN",
"operand" : [ {
"column" : 1,
"type" : "INTEGER"
}, {
"column" : 0,
"type" : "INTEGER"
} ],
"operator" : "pred"
},
"left" : {
"scan" : 1
},
"kind" : "INNER",
"right" : {
"scan" : 0
}
}
},
"target" : [ {
"column" : 1,
"type" : "INTEGER"
}, {
"column" : 0,
"type" : "INTEGER"
} ]
}
} ]
}
Loading
Loading