proposition: Lemma refine_find_first_char_such_that {Char} {HSLM : StringLikeMin Char} {HSL : StringLike Char} {HSLP : StringLikeProperties Char} (str : String) (P : Char -> bool) might_be_empty : refine { n : nat | n <= length str /\ ((exists n', is_first_char_such_that might_be_empty str n' P) -> is_first_char_such_that might_be_empty str n P) } (ret (find_first_char_such_that str P)).
proof: Proof. intros v H. computes_to_inv; subst. apply PickComputes. split; [ apply find_first_char_such_that_short | ]. apply is_first_char_such_that__find_first_char_such_that. Qed.
imports: Fiat.Common.Coq__8_4__8_5__Compat Coq.ZArith.ZArith Coq.Lists.List Fiat.Parsers.Refinement.PreTactics Fiat.Computation.Refinements.General Fiat.Parsers.StringLike.Properties Fiat.Parsers.StringLike.FirstChar Fiat.Common.Equality Fiat.Common.List.Operations Fiat.Parsers.ContextFreeGrammar.ValidReflective Fiat.Parsers.Refinement.DisjointLemmas Fiat.Parsers.Refinement.DisjointRulesCommon Fiat.Parsers.Refinement.PossibleTerminalsSets Fiat.Parsers.ParserInterface Fiat.Parsers.StringLike.Core Fiat.Common.List.DisjointFacts