Skip to content
This repository has been archived by the owner on Sep 25, 2022. It is now read-only.

Incompatibility between rewriter and uncompute #2

Open
jdevuyst opened this issue Aug 27, 2018 · 0 comments
Open

Incompatibility between rewriter and uncompute #2

jdevuyst opened this issue Aug 27, 2018 · 0 comments

Comments

@jdevuyst
Copy link
Owner

jdevuyst commented Aug 27, 2018

The following code

plusCommutativeRewrite' : (l, r : Nat) -> Fin (l + r) -> Fin (r + l)
plusCommutativeRewrite' = %runElab (do rewriter {ty=`(Nat)} natPlusRefl)

fails with the error

No such variable goal

because natPlusRefl includes a call to uncompute:

natPlusRefl : Elab ()
natPlusRefl = do
  intros
  compute
  uncompute $ unSucc {binop=`(plus)} {neutral=`(Z)} {succ=`(S)}
  CommutativeMonoid.refl {ty=`(Nat)} {tc=`(PlusNatCommMonoidV)} {binop=`(plus)} {neutral=`(Z)}

Specifically, the issue is that a Pruviloj.Core.equiv call by uncompute creates a hole named "goal", which then later vanishes.

I attempted to create an alternative implementation of equiv, that would call replace and then ran into this issue: idris-lang/Idris-dev#3934. I wonder if the same issue may cause "goal" to disappear. 🤔

jdevuyst added a commit that referenced this issue Aug 27, 2018
Note that it does not compose nicely with `uncompute` yet:
#2
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant