(* This program is free software; you can redistribute it and/or      *)
(* modify it under the terms of the GNU Lesser General Public License *)
(* as published by the Free Software Foundation; either version 2.1   *)
(* of the License, or (at your option) any later version.             *)
(*                                                                    *)
(* This program is distributed in the hope that it will be useful,    *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of     *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      *)
(* GNU General Public License for more details.                       *)
(*                                                                    *)
(* You should have received a copy of the GNU Lesser General Public   *)
(* License along with this program; if not, write to the Free         *)
(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *)
(* 02110-1301 USA                                                     *)
(* Contribution to the Coq Library   V6.3 (July 1999)                    *)
(****************************************************************************)
(* This contribution was updated for Coq V5.10 by the COQ workgroup.        *)
(* January 1995                                                             *)
(****************************************************************************)
(*                                                                          *)
(*Author: Pierre Casteran.                                                  *)
(*    LABRI, URA CNRS 1304,                                                 *)
(*    Departement d'Informatique, Universite Bordeaux I,                    *)
(*    33405 Talence CEDEX,                                                  *)
(*    e-mail:  casteran@labri.u-bordeaux.fr                                 *)
(*                                                                          *)
(*Date: May, 3, 1993                                                        *)
(*                                                                          *)
(*Pro[gramm,v]ing with continuations:A development in Coq.                  *)
(*                                                                          *)
(*(see the file "leavemult.dvi" for more explanations )                     *)
(*                                                                          *)
(*                                                                          *)
(*                                                                          *)
(****************************************************************************)
(*                               leavemult.v                                *)
(****************************************************************************)
Set Asymmetric Patterns.
(* Binary trees on some domain:*)
Section Domain.
Variable Dom : Set.
Inductive tree : Set :=
| leaf : Dom -> tree
| cons : tree -> tree -> tree.
End Domain.
(* Binary trees labeled by natural numbers *)
Definition nat_tree := tree nat.
Definition nat_cons := cons nat.
Definition nat_leaf := leaf nat.
(* Product of all the leaves of some nat_tree *)
Fixpoint leavemult (t : nat_tree) : nat :=
match t return nat with
| leaf n1 =>
(* (nat_leaf n1) *)  n1 (* (nat_cons t1 t2) *)
| cons t1 t2 => leavemult t1 * leavemult t2
end.
(* the specification  of our problem: *)
Definition SPECIF (t : nat_tree) := {n : nat | n = leavemult t}.
(* A (too much) trivial proof *)

Theorem trivialalgo : forall t : nat_tree, SPECIF t.
intro t.