123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051(**************************************************************************)(* *)(* GOSPEL -- A Specification Language for OCaml *)(* *)(* Copyright (c) 2018- The VOCaL Project *)(* *)(* This software is free software, distributed under the MIT license *)(* (as described in file LICENSE enclosed). *)(**************************************************************************)letrecsplit_at_ff=function|[]->([],[])|x::xswhenfx->letxs',ys'=split_at_ffxsin(x::xs',ys')|l->([],l)letrecsplit_at_ii=function|[]->([],[])|lwheni<=0->([],l)|x::xs->letxs',ys'=split_at_i(predi)xsin(x::xs',ys')moduleFmt=structincludeFmtletlist?(first=nop)?(last=nop)?seppp_vppfl=ifList.lengthl=0then()elsepfppf"%a@[%a@]%a"first()(list?seppp_v)llast()letpp=pfletfullppf_=pfppf".@ "letarrowppf_=pfppf" ->@ "letstarppf_=pfppf" *@ "letnewlineppf_=pfppf"@\n"letlparensppf_=pfppf"@[<1>("letrparensppf_=pfppf")@]"letlbracketppf_=pfppf"@[<1>["letrbracketppf_=pfppf"]@]"letlbraceppf_=pfppf"@[<1>{"letrbraceppf_=pfppf"}@]"letpp_locppfloc=letopenPpxlib.Locationinlets=loc.loc_startinifs.pos_fname="_none_"thenpfppf"none"elsepfppf"%s:%d:%d"s.pos_fnames.pos_lnum(s.pos_cnum-s.pos_bol)endmoduleSstr=Set.Make(String)