Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify and add Nat proofs #250

Merged
merged 4 commits into from
Jun 8, 2020
Merged

Simplify and add Nat proofs #250

merged 4 commits into from
Jun 8, 2020

Conversation

nickdrozd
Copy link
Contributor

Simplify some existing Nat proofs, then port over some proofs from Idris 1.

Some of the added proofs go through in Idris 1, but not Idris 2. Those proofs are commented out here, and they should be considered bugs.

These changes are strictly nonfunctional.
@nickdrozd
Copy link
Contributor Author

Looks like a test failure:

idris2/reflection003: FAILURE
Expected:
"1/1: Building refprims (refprims.idr)\nLOG 0: Name: Prelude.List.++\nLOG 0: Type: (%pi Rig0 Implicit Just a %type (%pi Rig1 Explicit Just _ (Prelude.List a) (%pi RigW Explicit Nothing (Prelude.List a) (Prelude.List a))))\nLOG 0: Name: Prelude.Strings.++\nLOG 0: Type: (%pi Rig1 Explicit Just _ String (%pi Rig1 Explicit Just _ String String))\nLOG 0: Resolved name: Prelude.Nat\nLOG 0: Constructors: [Prelude.Z, Prelude.S]\nrefprims.idr:37:10--39:1:While processing right hand side of dummy1 at refprims.idr:37:1--39:1:\nError during reflection: Not really trying\nrefprims.idr:40:10--42:1:While processing right hand side of dummy2 at refprims.idr:40:1--42:1:\nError during reflection: Still not trying\nrefprims.idr:43:10--45:1:While processing right hand side of dummy3 at refprims.idr:43:1--45:1:\nError during reflection: Undefined name\nrefprims.idr:46:10--48:1:While processing right hand side of dummy4 at refprims.idr:46:1--48:1:\nError during reflection: failed after generating Main.{plus:5841}\n"
Given:
"1/1: Building refprims (refprims.idr)\nLOG 0: Name: Prelude.List.++\nLOG 0: Type: (%pi Rig0 Implicit Just a %type (%pi Rig1 Explicit Just _ (Prelude.List a) (%pi RigW Explicit Nothing (Prelude.List a) (Prelude.List a))))\nLOG 0: Name: Prelude.Strings.++\nLOG 0: Type: (%pi Rig1 Explicit Just _ String (%pi Rig1 Explicit Just _ String String))\nLOG 0: Resolved name: Prelude.Nat\nLOG 0: Constructors: [Prelude.Z, Prelude.S]\nrefprims.idr:37:10--39:1:While processing right hand side of dummy1 at refprims.idr:37:1--39:1:\nError during reflection: Not really trying\nrefprims.idr:40:10--42:1:While processing right hand side of dummy2 at refprims.idr:40:1--42:1:\nError during reflection: Still not trying\nrefprims.idr:43:10--45:1:While processing right hand side of dummy3 at refprims.idr:43:1--45:1:\nError during reflection: Undefined name\nrefprims.idr:46:10--48:1:While processing right hand side of dummy4 at refprims.idr:46:1--48:1:\nError during reflection: failed after generating Main.{plus:6081}\n"

I'm not sure what that means.

@edwinb
Copy link
Collaborator

edwinb commented Jun 7, 2020

If you update the prelude some of the internal names will change, and the reflection mechanism will expose that. So this is fine, you just need to update the test output. "make test" will let you do that interactively.

@edwinb
Copy link
Collaborator

edwinb commented Jun 8, 2020

Of course I resolved the conflict wrongly, didn't I... I will fix it.

@edwinb edwinb merged commit 4cc4099 into idris-lang:master Jun 8, 2020
@nickdrozd nickdrozd deleted the nats branch June 8, 2020 17:37
@nickdrozd
Copy link
Contributor Author

@edwinb FYI, this one contained unimplemented theorems. As with #242, their proofs go through in Idris 1 but not 2. So master now has some uncontroversial but nevertheless unproved statements. Then again, they do serve as convenient test cases for any proposed fixes.

attila-lendvai pushed a commit to attila-lendvai-patches/Idris2 that referenced this pull request Jul 27, 2021
Fix runtime error in `the Int (cast "")`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants