-
Notifications
You must be signed in to change notification settings - Fork 38
Closed
Description
Hi everyone,
I have trouble understanding why the type inference algorithm fails on some inputs. For example, let's say that we have
constant symbol Term : TYPE
constant symbol Prop : TYPE
symbol prf : Prop ⇒ TYPE
(encoding first order logic, following this example) and we now want to define term equality in this way :
symbol equals : Term ⇒ Term ⇒ Prop
rule prf (equals &x &y) → ∀ P, prf (P &x) ⇒ prf (P &y)
we get :
[...] Cannot solve ?6[?y] ≡ Prop
Cannot solve ?6[?x] ≡ Prop
Unable to prove SR for rule [prf (equals &x &y) → ∀(P:∀(y:Term), ?6[y]), prf (P &x) ⇒ prf (P &y)].
Why is it not possible to unify ?6 with Prop ?
Annotating P with the type Term ⇒ Prop works and is a method that I could use in this particular case. Note, however, that I am interested in the typing algorithm and that my question is about the reason why it fails.
Another example where adding types solves the issue but intuitively we should not have to do so is with the definition of the conjunction :
symbol prop_and : Prop ⇒ Prop ⇒ Prop
rule prf (prop_and &A &B) → ∀ C, (prf &A ⇒ prf &B ⇒ prf C) ⇒ prf C
When trying to prove the following property :
definition and_elim_1 : ∀ A B, prf (prop_and A B) ⇒ prf A
≔ λ A B ab, ab A (λ a _, a)
we get :
[...] The definition of [and_elim_1] or its type have unsolved metavariables.
We have and_elim_1 : ∀(A:Prop) (B:Prop), prf (prop_and A B) ⇒ prf A ≔ λA B ab, ab A (λa _, a).
Why do we have to specify the type of ab ?
Metadata
Metadata
Assignees
Labels
No labels