recursion - How to unfold a recursive function just once in Coq -
recursion - How to unfold a recursive function just once in Coq -
here recursive function all_zero
checks whether members of list of natural numbers zero:
require import lists.list. require import basics. fixpoint all_zero ( l : list nat ) : bool := match l | nil => true | n :: l' => andb ( beq_nat n 0 ) ( all_zero l' ) end.
now, suppose had next goal
true = all_zero (n :: l')
and wanted utilize unfold
tactic transform to
true = andb ( beq_nat n 0 ) ( all_zero l' )
unfortunately, can't simple unfold all_zero
because tactic eagerly find , replace instances of all_zero
, including 1 in once-unfolded form, , turns mess. there way avoid , unfold recursive function once?
i know can accomplish same results proving advertisement hoc equivalence assert (...) x
, inefficient. i'd know if there's easy way similar unfold
.
it seems me simpl
want. if have more complicated goal, functions want apply , functions want maintain are, might need utilize various options of cbv
tactic (see http://coq.inria.fr/distrib/current/refman/reference-manual010.html#hevea_tactic127).
recursion coq unfold
Comments
Post a Comment