Skip to Content.
Sympa Menu

coq-club - [Coq-Club] Program Definition vs. Program Fixpoint

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] Program Definition vs. Program Fixpoint


Chronological Thread 
  • From: Ralf Jung <jung AT mpi-sws.org>
  • To: coq-club AT inria.fr
  • Subject: [Coq-Club] Program Definition vs. Program Fixpoint
  • Date: Wed, 2 Mar 2016 14:58:20 +0100
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jung AT mpi-sws.org; spf=Pass smtp.mailfrom=jung AT mpi-sws.org; spf=None smtp.helo=postmaster AT hera.mpi-klsb.mpg.de
  • Ironport-phdr: 9a23:+ZMEbxOeYnB6TQuiBR8l6mtUPXoX/o7sNwtQ0KIMzox0KP7yrarrMEGX3/hxlliBBdydsKIbzbWM+PyxEUU7or+/81k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ35vxiLr5p8ybSj4LrQT+SIs6FA+xowTVu5teqqpZAYF19CH0pGBVcf9d32JiKAHbtR/94sCt4MwrqHwI6Lpyv/JHBK79ZuEzSaFSJDUgKWE8osPx5jfZSg7a3HIYXC00jxxHS1zH8Rf1dpLps27hqfE73zOVa56lBYsoUCivuv84ACTjjz0KYmY0

Hi all,

I just noticed that there are some weird differences between Program
Definition and Program Fixpoint, which force me to use Fixpoint even for
some non-recursive definition unless I want to spell out some "_"
explicitly:

---------- BEGIN --------------
Require Import Program Omega.

Definition foo (n : nat) {H : n > 5} := n.

Program Fixpoint foo1 x := foo (x + 6).
Next Obligation. omega. Qed.

(* I would expect this to work. *)
Fail Program Definition foo1 x := foo (x + 6).


(* I can work around it, but it's ugly. *)
Program Definition foo2 x := foo (x + 6) (H:=_).
Next Obligation. omega. Qed.
--------- END ------------

Is this somehow a feature I do not understand, or is it an outright bug
in "Program"?

In any case, this can be problematic if what you are defining is not a
function, i.e. does not have any arguments - in that case, you cannot
use Fixpoint, so you have to be explicit about the "_".

Kind regards,
Ralf



Archive powered by MHonArc 2.6.18.

Top of Page