ssm-lang / sslang

A language built atop the Sparse Synchronous Model
BSD 3-Clause "New" or "Revised" License
18 stars 0 forks source link

Pattern match anomaly checker #84

Closed leoqiao18 closed 2 years ago

leoqiao18 commented 2 years ago

Based on "Warnings for pattern matching" paper (link).

Currently implemented as a separate module that does not affect the rest of the compiler pipeline. Supports exhaustion check and finding useless clause. Unit test written in match test module.

Possible further improvements: provide counter-example for non-exhaustion case.

TODO: combine and merge with AST patterns.

j-hui commented 2 years ago

Marking as Draft until thus lands changes to the main compiler pipeline

leoqiao18 commented 2 years ago

This commit is a very ugly/work-in-progress version of the exhaustion check. I will now work on integration tests for this checker pass. With the tests, I will refactor the code to a more stylistically reasonable state.