proposition: Lemma refine_disjoint_search_for_not' {str offset len nt its} (H_disjoint : disjoint ascii_beq (possible_terminals_of nt) (possible_first_terminals_of_production its)) : refine {splits : list nat | split_list_is_complete G str offset len (NonTerminal nt::its) splits} (n <- { n : nat | n <= length (substring offset len str) /\ ((exists n', search_for_not_condition (substring offset len str) nt its n') -> search_for_not_condition (substring offset len str) nt its n) }; ret [n]).
proof: Proof. intros ls H. computes_to_inv; subst. destruct H as [H0 H1]. apply PickComputes. hnf; cbv zeta. intros Hlen it' its' Heq n ? H_reachable pit pits. inversion Heq; subst it' its'; clear Heq. left. pose proof (terminals_disjoint_search_for_not _ _ H_disjoint pit pits H_reachable) as H'. specialize (H1 (ex_intro _ n H')). pose proof (is_first_char_such_that_eq_nat_iff H1 H') as H''. destruct_head or; destruct_head and; subst; rewrite ?Nat.min_r by assumption; omega. 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