12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364(** Domain alternatives chosen by a runtime flag. *)moduletypeFlagError=sigvalmsg:stringvalname:stringendmoduleFlagHelper(L:Printable.S)(R:Printable.S)(Msg:FlagError)=structtypet=L.toption*R.toption[@@derivingeq,ord,hash]letunopoplopr(h,r)=match(h,r)with|(Somel,None)->opll|(None,Somer)->oprr|_->failwithMsg.msgletbinopoplopr(l1,r1)(l2,r2)=match(l1,r1),(l2,r2)with|(Somel1,None),(Somel2,None)->opll1l2|(None,Somer1),(None,Somer2)->oprr1r2|_->failwithMsg.msgletunop_to_toplopr(l,t)=match(l,t)with|(Somep,None)->(Some(oplp),None)|(None,Somet)->(None,Some(oprt))|_->failwithMsg.msgletbinop_to_toplopr(l1,r1)(l2,r2)=match(l1,r1),(l2,r2)with|(Somep1,None),(Somep2,None)->(Some(oplp1p2),None)|(None,Somet1),(None,Somet2)->(None,Some(oprt1t2))|_->failwithMsg.msgletshow=unopL.showR.showletpretty()=unop(L.pretty())(R.pretty())letprintXmlf=unop(L.printXmlf)(R.printXmlf)letto_yojson=unopL.to_yojsonR.to_yojsonletrelift=unop_to_tL.reliftR.reliftlettag_=failwith(Msg.name^": no tag")letarbitrary()=failwith(Msg.name^": no arbitrary")endmoduletypeLatticeFlagHelperArg=sigincludeLattice.POvalis_top:t->boolvalis_bot:t->boolendmoduleLatticeFlagHelper(L:LatticeFlagHelperArg)(R:LatticeFlagHelperArg)(Msg:FlagError)=structincludeFlagHelper(L)(R)(Msg)letleq=binopL.leqR.leqletjoin=binop_to_tL.joinR.joinletmeet=binop_to_tL.meetR.meetletwiden=binop_to_tL.widenR.widenletnarrow=binop_to_tL.narrowR.narrowletis_top=unopL.is_topR.is_topletis_bot=unopL.is_botR.is_botletpretty_diff()((l1,r1),(l2,r2))=match(l1,r1),(l2,r2)with|(Somep1,None),(Somep2,None)->L.pretty_diff()(p1,p2)|(None,Somet1),(None,Somet2)->R.pretty_diff()(t1,t2)|_->failwithMsg.msgend