Skip to content

Fix #957: Agsy copattern support - #5827

Merged
andreasabel merged 4 commits into
agda:masterfrom
isovector:agsy-copatterns
Mar 16, 2022
Merged

andreasabel merged 4 commits into
agda:masterfrom
isovector:agsy-copatterns

Conversation

@isovector

@isovector isovector commented Mar 11, 2022 •

Copy link
Copy Markdown
Contributor

I got frustrated today by not having copattern support for auto, and decided to dive in to see what I could find.

There was a commented out datacon for Agda.Auto.Syntax.Pat corresponding to PatProj. Uncommenting this, and then copying code from other cases to make everything exhaustive again seems to fix the issue.

Comes with the warranty that I have no idea what I'm doing, but am happy to add some tests.

Fixes #957

@isovector isovector changed the title Agsy copattern support Fix #957: Agsy copattern support Mar 11, 2022
@andreasabel

Copy link
Copy Markdown
Member

Excellent, @isovector !

Tests go into test/interaction/:

  • An .agda file with open interaction points (holes).
  • An .in file to steer the interaction. The syntax is awkward, grep the existing .in files for auto if you want to learn the magic incantations.
  • An .out file recording the responses of Agda. foo.out can be constructed by make foo.out in the test/interaction/ directory (so you do not always have to run the whole make interaction goal).

@isovector

Copy link
Copy Markdown
Contributor Author

Thanks @andreasabel ! Some suggestions on what exactly to test here would also be greatly appreciated :) I"m a complete beginner to Agda, so I might not come up with particularly good things to check on my own.

@andreasabel

Copy link
Copy Markdown
Member

Some suggestions on what exactly to test here would also be greatly appreciated :)

Well, for instance:

  • an .agda file that has definition(s) by copatterns
  • some holes you expect auto to fill
  • commands that invoke auto on these holes

Basically, you contribute a new feature and want some unit-tests that demonstrate that the feature does what you expect it to do. I mean, you had some incentive to fix this problem, most likely an Agda file with defs. by copatterns that you wanted to use auto on. This file might be too large for the testsuite, but you could distill a test from it.

@andreasabel andreasabel added type: enhancement Issues and pull requests about possible improvements auto Issues to do with the Auto proof search (Mimer, Agsy) copatterns Definitions by copattern matching: projections on the LHS labels Mar 12, 2022
@andreasabel

Copy link
Copy Markdown
Member

@isovector : You could e.g. copy https://github.com/agda/agda/blob/master/test/Succeed/Copatterns.agda , poke some holes into the function definitions, and see which Auto can solve...

@isovector

Copy link
Copy Markdown
Contributor Author

@andreasabel thanks, done!

@andreasabel andreasabel added this to the 2.6.3 milestone Mar 16, 2022
@andreasabel
andreasabel merged commit 2816605 into agda:master Mar 16, 2022
@andreasabel

andreasabel commented Mar 16, 2022 •

Copy link
Copy Markdown
Member

I merged this to master so more folks will play with it.
Left TODO:

@andreasabel andreasabel self-assigned this Mar 16, 2022
plt-amy added a commit that referenced this pull request Oct 24, 2022
Also removes the mention of copatterns not being supported from the Agsy
docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto Issues to do with the Auto proof search (Mimer, Agsy) copatterns Definitions by copattern matching: projections on the LHS type: enhancement Issues and pull requests about possible improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto missing support for Copatterns

2 participants