# HG changeset patch # User Adam Chlipala # Date 1223220849 14400 # Node ID f295a64bf9fd715a9a7530dc722563fdaae6fb8e # Parent 506a0611801495c7c38de0f98c950776226279a7 Coinductive exercise description diff -r 506a06118014 -r f295a64bf9fd src/Coinductive.v --- a/src/Coinductive.v Sat Oct 04 14:58:00 2008 -0400 +++ b/src/Coinductive.v Sun Oct 05 11:34:09 2008 -0400 @@ -455,3 +455,19 @@ (** If we print the proof term that was generated, we can verify that the proof is structured as a [cofix], with each co-recursive call properly guarded. *) Print constFold_ok. + + +(** * Exercises *) + +(** %\begin{enumerate}%#
    # + +%\item%#
  1. # %\begin{enumerate}%#
      # + %\item%#
    1. # Define a co-inductive type of infinite trees carrying data of a fixed parameter type. Each node should contain a data value and two child trees.#
    2. # + %\item%#
    3. # Define a function [everywhere] for building a tree with the same data value at every node.#
    4. # + %\item%#
    5. # Define a function [map] for building an output tree out of two input trees by traversing them in parallel and applying a two-argument function to their corresponding data values.#
    6. # + %\item%#
    7. # Define a stream [falses] where every node has the value [false].#
    8. # + %\item%#
    9. # Define a stream [true_false] where the root node has value [true], its children have value [false], all nodes at the next have the value [true], and so on, alternating boolean values from level to level.#
    10. # + %\item%#
    11. # Prove that [true_falses] is equal to the result of mapping the boolean "or" function [orb] over [true_false] and [falses]. You can make [orb] available with [Require Import Bool.]. You may find the lemma [orb_false_r] from the same module helpful. Your proof here should not be about the standard equality [=], but rather about some new equality relation that you define.#
    12. # +#
    #%\end{enumerate}% #
  2. # + +#
#%\end{enumerate}% *)