wilbowma/cur

format-id error: given: #<syntax (even n)>

Closed this issue · 4 comments

I'm translating Coq's even_plus_even_is_even to cur.

Inductive even : nat -> Set :=
  | even_O : even O
  | even_SSn : forall n:nat,
                even n -> even (S (S n)).
 
 
Theorem even_plus_even_is_even : forall n m : nat,
  even n -> even m -> even (n + m).
Proof.
  intros n m Hn Hm.

  induction Hn as [|n' IHn].
  - simpl.
    assumption.

  - simpl.
    apply even_SSn.
    assumption.
Qed.

In cur, I am at this step:

(data even : 0 (-> nat Type)
      [even-O : (even 0)]
      [even-SS : (forall [n : nat] (-> (even n) (even (S (S n)))))])

(define-theorem even-plus-even-is-even
  (∀ [n : nat] [m : nat] (-> (even n) (even m) (even (+ n m))))
  (by-intros n m Hn Hm)
  
  display-focus
  
  (by-induction Hn #:as [() (n* IHn)]))

display-focus seems to show that I'm heading in the right direction. However, by-induction on Hn: (even n) results in:

format-id: contract violation
  expected: (or/c string? symbol? identifier? keyword? char? number?)
  given: #<syntax (even n)>

I raco pkg install cur. I think that is master.

The added test seems to be equivalent to the example, and does not error.

Re-open if there is still a problem