Arend forces splitting on unnecessary variables
- Dominant language
- Java
- Stars
- 756
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
Description

```arend
\data T (n : Nat) \elim n
| zero => To
| n => Tn
\func ummm (n : Nat) (t : T n) : T n \elim t
```
Arend asks me to split on `n` as well. In Agda or Coq, they are translated into the so-called 'dotted pattern' which are not actually needed to be split.
```agda
data T : ℕ → Set where
To : T 0
Tn : ∀ n → T n
ummm : ∀ n → T n → T n
ummm a To = To
ummm a (Tn a) = Tn a
test : ∀ n → ummm n (Tn n) ≡ Tn n
test n = refl
```
The above Agda code checks (note that the binding second pattern is not even linear, `a` was bound twice! But internally it is translated to the code below). Before Jesper's work, you need to write `ummm` as follows, but the computational behavior is the same.
```agda
ummm : ∀ n → T n → T n
ummm .0 To = To
ummm a (Tn .a) = Tn a
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the behavior with the Arend snippets in the issue and compare the requested result with the Agda examples. The issue names no source files or tests, so first locate the implementation of pattern matching and elimination in the Arend compiler; done means unnecessary variables no longer require splitting while the shown definitions still check.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100