uw-pluverse / perses

language-agnostic program reducer.
GNU General Public License v3.0
162 stars 22 forks source link

Feature request: SQL support #19

Closed mrigger closed 1 year ago

mrigger commented 2 years ago

It would be great to add SQL support to Perses (e.g., I noticed that several SQL dialects are available at https://github.com/antlr/grammars-v4/tree/master/sql). What would be the estimated effort for adding a dialect?

chengniansun commented 2 years ago

I can cut a release by next week to support SQL.

There are so many dialects. Is there a universal syntax for SQLs?

mrigger commented 2 years ago

That would be awesome! Unfortunately, there is no universal SQL grammar. Perhaps supporting the SQLite grammar might be a good starting point?

chengniansun commented 2 years ago

Sounds good. I will let you know when it is done.

Curious, do you want to use perses for reducing bugs, or as a baseline for evaluation?

mrigger commented 2 years ago

For now, I'm mainly interested in using Perses to reduce SQL test cases for a study. Typically, I use C-Reduce + manual reduction, which works reasonably well. There are some patterns that C-Reduce fails to reduce. In the past, I reduced them manually, but for the current use case (a larger evaluation), this is not feasible.

I also have had some thoughts on a new SQL-specific reducer, so having Perses as another baseline would be an additional benefit.

chengniansun commented 2 years ago

I cut a release. As there are many dialects, you have to name the input file with the extension .sqlite.

You might also want to enable --enable-token-slicer true --enable-tree-slicer true to further reduce the input file.

Any feedback is appreciated.

mrigger commented 2 years ago

Great, thanks a lot! I'll try and let you know.