fact: Fixpoint flatten (case:GENERIC_SPEC_CASE.t) : list GENERIC_SPEC_CASE.t := let (fvd, ovd, sh, genBody) := case in let addDecls (flattenedCase:GENERIC_SPEC_CASE.t) := let (fvd1, ovd1, sh1, simpleBody1) := flattenedCase in GENERIC_SPEC_CASE.Build_t (List.app fvd fvd1) (List.app ovd ovd1) (List.app sh sh1) simpleBody1 in let fix flattenNested (l:list GENERIC_SPEC_CASE.t) : list GENERIC_SPEC_CASE.t := match l with | nil => nil | (nb::nbs) => List.app (flatten nb) (flattenNested nbs) end in match genBody with | inl simpleBody => case :: nil | inr nested => map addDecls (flattenNested nested) end.
imports: JML(Prelude) Coq(ZArith) Coq(Bool) Coq(List) JML(TaggedList) JML(ListHelpers) JML(ListFunctions) JML(OptionHelpers) JML(JMLProgramPlusImpl) JML(JMLFull2Basic) JML(JMLExpressionNotations)