Section PaperExample.
(* Examples of the tactics that proof the correctness lemmata *)
Goal computable orb.
extractAs s.
computable_using_noProof s.
cstep.
cstep.
cstep.
all:    cstep.
Qed.
(* Print cnst. *)
(* Comming up with the conditions for the time bound *)
Goal forall fT, computableTime' orb fT.
intros.
extractAs s.
computable_using_noProof s.
cstep.
cstep. (* Note that the second goal got more specific *)
cstep. (* Note that the second goal got more specific *)
cstep.
1,2:cstep. (* Note that the hole in the second goal got filled with True*)
solverec.
Abort.
(* Finding the Time Bound *)
Goal computableTime' orb (fun _ _ => (cnst "c1",fun _ _ => (cnst "c2",tt))).
extract. solverec. (* Now the values are clear *)
Abort.
Goal computableTime' orb (fun _ _ => (1,fun _ _ => (3,tt))).
extract. solverec.
Abort.
Goal computable Nat.add.
unfold Nat.add.
extractAs s.
computable_using_noProof s.
cstep.
all:cstep.
all:cstep.
Qed.
Goal computable (fix f (x y z : nat) := y + match y with |  S (S y) => S (f x y z) | _ => 0 end).
extractAs s.
computable_using_noProof s.
cstep.
all:cstep.
all:cstep.
all:cstep.
Qed.
extractAs s.
computable_using_noProof s.
cstep.
cstep.
all:cstep.
all:cstep.
Qed.
extractAs s.
computable_using_noProof s.
repeat cstep.
Fail Guarded.
Abort.

(* this is due to https://github.com/coq/coq/issues/9761 *)
Lemma workarround : let f := (fix f (z y : nat) {struct y}:= match y with | S (S y) => f z y | _ => S z end) in computable (fun y z => f z y).