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

Application in type term not reduced in proof context, but reduced in goal #4847

Open
radoye opened this issue Apr 18, 2020 · 0 comments
Open

Comments

@radoye
Copy link

radoye commented Apr 18, 2020

I can't work out why the function application S k == S j = True does not reduce to k == j = True during interactive proof in function scope. Especially, given the where clause that accepts the same term as a proof for both types. However, if put in the goal position, the type reduces.

module Reduction
%default total                                 
                                 
refl' : {x : Nat} -> {y : Nat} -> (x == y = True) -> (x = y)                                 
refl' {x = Z} {y = Z} prf = Refl
refl' {x = Z} {y = (S _)} Refl impossible
refl' {x = (S _)} {y = Z} Refl impossible
refl' {x = (S k)} {y = (S j)} prf = ?todo
  where
    fact : (S k == S j = True) -> (k == j = True)
    fact prf = prf

reduce_beq : (S k == S j) = True
reduce_beq = ?todo_beq

Here's the *idris-holes* buffer for the session.

Holes

This buffer displays the unsolved holes from the currently-loaded code. Press
the [P] buttons to solve the holes interactively in the prover.

- + Reduction.todo [P]
 `--               k : Nat
                   j : Nat
                 prf : S k == S j = True
     ------------------------------------
      Reduction.todo : S k = S j

- + Reduction.todo_beq [P]
 `--                   j : Nat
                       k : Nat
     -----------------------------------------------------------------------------------------------
      Reduction.todo_beq : Prelude.Nat.Nat implementation of Prelude.Interfaces.Eq, method == k j =
     True

Steps to Reproduce

$ idris --version
1.3.2

Expected Behavior

Non-neutral terms should be reduced regardless of the context.

Observed Behavior

A non-neutral term not is reduced properly when in goal position. However, it is not reduced in the proof context.

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

No branches or pull requests

1 participant