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

More flexibel reflection solving #585

Merged
merged 23 commits into from
Oct 22, 2021

Conversation

felixwellen
Copy link
Collaborator

@felixwellen felixwellen commented Jul 29, 2021

This is an attempt to solve #521. So far, it is possible to use one variable from context. Like in
the following example:

testWithOneVariable : (x : fst R) → x + 0r ≡ 0r + x
testWithOneVariable x = solveInPlace R x

The solver can be used during equational reasoning like in the following example:

   testWithTwoVariables :  (x y : fst R) → x + y ≡ y + x
   testWithTwoVariables x y =
     x + y                      ≡⟨solveIn R withVars (x ∷ y ∷ []) ⟩
     y + x ∎

However, it is only possible to use the ring solver, if all other variables are introduced
before the ring-variables. This means the following is NOT possible so far:

   testEquationalReasoning' :  (x : fst R) (p : 0r + x ≡ 1r)  → x + 0r ≡ 1r
   testEquationalReasoning' p x =
     x + 0r              ≡⟨solveIn R withVars (x ∷ []) ⟩
     0r + x              ≡⟨ p ⟩
     1r ∎

@felixwellen felixwellen marked this pull request as ready for review August 11, 2021 08:30
@felixwellen
Copy link
Collaborator Author

Ohno... Yes, that is what the function actually does.

@ecavallo
Copy link
Collaborator

Everything else looks good, I'll merge once Travis is done.

@felixwellen
Copy link
Collaborator Author

Ok, great - thanks!

@ecavallo ecavallo merged commit d2b4b60 into agda:master Oct 22, 2021
@felixwellen felixwellen deleted the more-flexibel-reflection-solving branch October 22, 2021 11:59
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