fact: Definition mergeWorkingSpace (l:list (optional Expression * option Expression)) : option (optional Expression * option Expression) := let cond (ws:optional Expression * option Expression) : Expression := match snd ws with | None => true'%jml | Some c => c end in let rewrite1 (ws:optional Expression * option Expression) : optional Expression := match fst ws with | NotSpecified => NotSpecified | Specified expr => Specified ((cond ws) then' expr else' field java.lang.Integer.F_MAX_VALUE None)%jml end in let merge2 (e1:Expression) (e2:Expression) : Expression := (method java.lang.Integer.M_min_5 None [e1; e2])%jml in let or := BinaryCondBoolExpr ConditionalOr in let exprs := fold_right1 (liftOptional2 merge2) (map rewrite1 l) NotSpecified in let conds := fold_left1 or (map cond l) true'%jml in match l with | nil => None | ws::nil => Some ws | _ => Some (exprs, Some conds) end.
imports: JML(Prelude) Coq(ZArith) Coq(Bool) Coq(List) JML(TaggedList) JML(ListHelpers) JML(ListFunctions) JML(OptionHelpers) JML(JMLProgramPlusImpl) JML(JMLFull2Basic) JML(JMLExpressionNotations)