Skip to Content.
Sympa Menu

coq-club - Re: Inversion and computation

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: Inversion and computation


chronological Thread 
  • From: cornes AT fing.edu.uy (Cristina Cornes)
  • To: rap AT dcs.ed.ac.uk (Randy Pollack)
  • Cc: coq AT pauillac.inria.fr, coq-club AT pauillac.inria.fr
  • Subject: Re: Inversion and computation
  • Date: Mon, 5 Apr 1999 04:49:30 +0300 (GMT+3:00)

Hello Randy,

> ....but when I tried to use the
> definition of "hdn" I found it doesn't compute as I expected
> 
>   Coq < Eval Compute in (hdn (consn O (niln nat))).
>        = (<[n:nat]nat->(listn nat n)->nat>
>           Cases
>             (sym_eq nat O O
>               (f_equal nat nat
>                 [e:nat]Cases e of
>                          O => O
>                        | (S a) => a
>                        end (S O) (S O) (refl_equal nat (S O))))
>           of
>             refl_equal => [a:nat; _:(listn nat O)]a
>           end O (niln nat))
>        : nat

 The inversion tactic uses some lemmas like sym_eq and f_equal that
are not automatically expanded during Compute. If you make these
lemmas transparent,  then delta expansion is performed and you
obtain the expected computation.

Transparent sym_eq.
Transparent f_equal.

Coq <  Eval Compute in (hdn (consn O (niln nat))).
     = O
     : nat

I hope this helps.

Best regards,
cristina





Archive powered by MhonArc 2.6.16.

Top of Page