wilbowma / cur

A less devious proof assistant
BSD 2-Clause "Simplified" License
222 stars 18 forks source link

Add support for alternative pattern matching and totality checking #103

Closed pwang347 closed 4 years ago

pwang347 commented 4 years ago

Description

This change presents an initial solution for #92, as well as various other features listed below.

Notes

Tests performed:

pwang347 commented 4 years ago

Some notes/questions:

pwang347 commented 4 years ago

Current state of affairs:

TODO (blocked?):

pwang347 commented 4 years ago

Summary of latest change:

Outstanding items:

Some notes:

wilbowma commented 4 years ago

Finally working on this, in pr-103-totality-checking

When I merged, I got some odd totality failures in bool. My guess would be either automatic merge did the wrong thing, or something about the merged termination checker broke something.

pwang347 commented 4 years ago

Finally working on this, in pr-103-totality-checking

When I merged, I got some odd totality failures in bool. My guess would be either automatic merge did the wrong thing, or something about the merged termination checker broke something.

Weird, I'm guessing it may be a sugar.rkt thing. Will take a look later, thanks!

wilbowma commented 4 years ago

Might be my fault. Looks like one of these depends on 7.6 and I was using 7.5. Updating know and will keep this PR updated.

wilbowma commented 4 years ago

Wasn't due to 7.6. Must be because define/rec/match got wrapped, to support totality checking. This is a bit strange since bool is one of the few places that didn't use the additional syntax added by the termination checker.

pwang347 commented 4 years ago

Most likely this: https://github.com/wilbowma/cur/pull/100/files#diff-bc56fe40e5300f5b41ec73c652f230c5R228

I moved the totality check up to the main call and I'm running travis on it right now. Will let you know how it goes!

wilbowma commented 4 years ago

You're a champ!

I agree that change looks suspicious, although it looks like I reverted it when I merged.

pwang347 commented 4 years ago

I was so deeply bothered by that coding artifact that I still remembered about it lol Looks like it's working so far (~7mins in)

wilbowma commented 4 years ago

We all know where our hacks are buried.

wilbowma commented 4 years ago

I replicated your changes locally and they seem to work---cur-lib builds properly now.

I'm a little confused by this change: https://github.com/wilbowma/cur/commit/4122d0d04bcd52ae2c7eb77f9c874b2f77a1e022#diff-bc56fe40e5300f5b41ec73c652f230c5R274

Given that the input was ((pat ...) => body) in the define/rec/match macro, and we didn't do any munges (as far as I can tell), this looks like it shouldn't match.

pwang347 commented 4 years ago

If I recall correctly, it's because I needed to pass the pat-bodies as literals back into the syntax expression but I couldn't find a way to preserve it exactly as before; in this case I wanted a flattened form [p1 p2 => body] but the closest I got was [(p1 p2) => body].

--

Also, see some other minor fixes I added here: https://github.com/wilbowma/cur/compare/pr-103-totality-checking...pwang347:pr-103-totality-checking?expand=1

Accidentally triggered several travis requests without killing previous ones, so they all got queued up and it's still running.

wilbowma commented 4 years ago

Okay. I'll investigate. I might rewrite it to get rid of those local-expands and the repeated syntax-parsing.

I'll do a proper merge off your branch shortly.

Thanks again, and sorry it took me so long to get to merging this... last semester, 411 was all consuming.

pwang347 commented 4 years ago

Sounds good, do keep me updated if there are any other issues that arise. Also no worries at all, I do hope it was a successful reboot despite the abrupt ending to the term!

Hope you and your family are doing well!

wilbowma commented 4 years ago

Yeah it went great. Will be even better next time.

Thanks, you too. Stay safe.

wilbowma commented 4 years ago

Moved this to #105 so I can get github to run checks against my copy of the branch.

wilbowma commented 4 years ago

Closed by 9b3dc826660a21fdd14690a18cad0eaf5e301086