123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180(*******************************************************************************
* electrod - a model finder for relational first-order linear temporal logic
*
* Copyright (C) 2016-2020 ONERA
* Authors: Julien Brunel (ONERA), David Chemouil (ONERA)
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* SPDX-License-Identifier: MPL-2.0
* License-Filename: LICENSE.md
******************************************************************************)(** Contains pretty-printing facilities. Note: same licence as Fmt. *)(** Licence: ISC *)(** Straight extension of Fmt to avoid having to open Fmt and Fmtc *)includeFmtletnbsp=conststring" "lethardline=Format.pp_force_newlineletlbrace=conststring"{"letrbrace=conststring"}"letlparen=conststring"("letrparen=conststring")"letlangle=conststring"<"letrangle=conststring">"letlbracket=conststring"["letrbracket=conststring"]"letsquote=conststring"'"letdquote=conststring"\""letbquote=conststring"`"letsemi=conststring";"letcolon=conststring":"letcomma=conststring","letdot=conststring"."letsharp=conststring"#"letslash=conststring"/"letbackslash=conststring"\\"letequal=conststring"="letqmark=conststring"?"lettilde=conststring"~"letat=conststring"@"letpercent=conststring"%"letdollar=conststring"$"letcaret=conststring"^"letampersand=conststring"&"letstar=conststring"*"letplus=conststring"+"letminus=conststring"-"letunderscore=conststring"_"letbang=conststring"!"letbar=conststring"|"letsquotesppfv=quote~mark:"'"ppfvletbquotesppfv=quote~mark:"`"ppfvletanglespp_vppfv=pfppf"@[<1><%a>@]"pp_vv(* all **... operators associate to the RIGHT and are of stronger precedence
than @@ but lower than function application *)let(**@)p1p2=appendp1p2let(**<)p1p2=prefixp1p2let(**>)p1p2=suffixp1p2(* append, with a break *hint* in the middle *)let(**!)p1p2=pairp1p2(* append, with a space or a break in the middle *)let(**-)p1p2=pair~sep:spp1p2(* creates a box and surrounds it by delimiters bef and aft *)letsurroundbefaftpp_voutv=befout();pp_voutv;aftout()(* like surround, with a non-breakable-space right after bef (resp. right before aft) *)letsurround_befaftpp_voutv=befout();pfout" ";pp_voutv;pfout" ";aftout()letbraces_ppv_voutv=surround_lbracerbraceppv_voutvletbrackets_ppv_voutv=surround_lbracketrbracketppv_voutvletparens_ppv_voutv=surround_lparenrparenppv_voutvletangles_ppv_voutv=surround_langlerangleppv_voutvletunlesstestppfoutv=iftestvthenpfout""elseppfoutvletrepeatnpp=assert(n>=0);letrecwalknpp=ifn=0thennopelsepp**<walk(n-1)ppinwalknppletinfix?(indent=0)?(par=true)middleleftrightout(m,l,r)=ifparthenpfout"(@[<hov%d>@[%a@]@ %a@ @[%a@]@])"indentleftlmiddlemrightrelsepfout"@[<hov%d>@[%a@]@ %a@ @[%a@]@]"indentleftlmiddlemrightrletprefix?(indent=0)?(par=true)pprefixpbodyout(prefix,body)=ifparthenpfout"(@[<hov%d>%a@[%a@]@])"indentpprefixprefixpbodybodyelsepfout"@[<hov%d>%a@[%a@]@]"indentpprefixprefixpbodybodylettuple2=pairlettuple3?sep1:(pp_sep1=sp)?sep2:(pp_sep2=sp)pp1pp2pp3ppf(x1,x2,x3)=pp1ppfx1;pp_sep1ppf();pp2ppfx2;pp_sep2ppf();pp3ppfx3lettriple=tuple3letbbox?(indent=0)ppppf=Format.pp_open_boxppfindent;pfppf"%a@]"ppletbbox2outv=bbox~indent:2outvletbox2outv=box~indent:2outvlethbox2outv=hboxoutvletvbox2outv=vbox~indent:2outvlethvbox2outv=hvbox~indent:2outv