Skip to content

apply-reduction-relation* insensitive to alpha-equivalence #96

Closed

Description

@howell

I'm working on a model that makes use of Redex's binding forms support (which has been great). However, I ran into something unexpected today: apply-reduction-relation* returned a list of 16 terms, all of which were alpha-equivalent? to one another.

This was even more surprising given that I had looked at the traces output for reducing the term in question which had merged alpha-equivalent terms.

Using this previous commit as a template, I was able to get apply-reduction-relation* behaving the way I expected for my language by using the equivalence and hash constructs from binding-forms.rkt (see here).

(It has occurred to me that maybe this is the desired behavior for apply-reduction-relation*, though I'm not sure why that would be; I would be interested to hear)

Activity

  1. howell commented on May 23, 2017

    @howell
    ContributorAuthor

    any thoughts on this?

    I don't think I made this clear in my initial report, but I patched my local version of Redex to consider alpha-equivalence in apply-reduction-relation* (see here) which I'd be happy to submit as a PR if that is indeed the desired behavior.

  2. paulstansifer commented on May 23, 2017

    @paulstansifer
    Collaborator
  3. rfindler commented on May 23, 2017

    @rfindler
    Member
  4. paulstansifer commented on May 23, 2017

    @paulstansifer
    Collaborator
  5. howell commented on May 24, 2017

    @howell
    ContributorAuthor

    There is make-α-hash in binding-forms.rkt which I missed on my first go around. I can update my patch to use make-α-hash (as well as the code that I copied went off of implementing the same functionality for traces).

    I have one bit of uncertainty with making this change, though. The loop inside traverse-reduction-graph uses a path variable for an immutable hash that needs to use alpha-equivalence. I can either convert it to a mutable hash using make-α-hash, or add a make-immutable-α-hash function and use that instead.

    I'm uncertain about which way to go because there is a comment suggesting this path variable has been the subject of performance tuning and I want to be careful where I tread in that regard!

  6. rfindler commented on May 24, 2017

    @rfindler
    Member

    I think we need a make-immutable-α-hash function. Thanks for helping out with this!

  7. added a commit that references this issue on May 25, 2017
    1e7ff97
  8. wilbowma commented on Sep 26, 2017

    @wilbowma
    Collaborator

    Are this and #102 closed by 24f0c5c?

  9. rfindler commented on Sep 26, 2017

    @rfindler
    Member

    Oh, rats! I totally forgot about this and just changed only one part of the problem! I'm sorry about that.

    So, no, they aren't closed, because I changed only the one for that specific bug.

    Looking at the diff, I think that the fixes to traces and stepper are still needed. But test cases are also needed.

    Shall I do that?

    And where do we stand with the performance issues? I am guessing that there is not much to be helped there. We knew that alpha stuff would slow various things down, but I can try to investigate if there is a specific file that's problematically slower.

  10. wilbowma commented on Sep 27, 2017

    @wilbowma
    Collaborator

    For apply-reduction-relation*, it actually improves performance in my experience. So I don't see any reason to not merge #102, other than the minor issue of using the depricated interface.

    #103 is my attempt to make similar changes to judgment forms and metafunctions, but it really hurts performance.

  11. rfindler commented on Aug 9, 2018

    @rfindler
    Member

    @howell do you have the example (or one like it) that returned too many things so I can add it to the test suites?

  12. howell commented on Aug 24, 2018

    @howell
    ContributorAuthor

    I wasn't able to reproduce the errors I was getting in the model I was working on at the time. I had to remove some binding directives to be able to run the model, which may be related.

    The directive

    (facet X A ([D S #:refers-to (shadow D X)] ...))

    now produces an error message

    define-language: found the same binder, X, at different depths, 1 and 0

    Redex used to accept this directive, and as far as I could tell interpreted it the way I intended.

  13. wilbowma commented on Mar 20, 2020

    @wilbowma
    Collaborator

    Think this should have been closed by #102

  14. rfindler commented on Mar 21, 2020

    @rfindler
    Member

    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions