12345678910111213141516171819202122232425262728293031323334353637383940414243444546(****************************************************************************)(* This file is an extension for the Lincons1 module from the apron Library *)(****************************************************************************)(* It only adds function, nothing is removed *)includeApron.Lincons1includeArray_maker.LinconsExt(**********************)(* Negation utilities *)(**********************)letneg_typ=function|EQ->DISEQ|SUP->SUPEQ|SUPEQ->SUP|DISEQ->EQ|_->assertfalseletnegd=let d=copydinset_cst d(Apron.Coeff.neg(get_cstd));iter(funcv->set_coeffdv(Apron.Coeff.negc))d;set_typd(get_typd|>neg_typ);d(* split a = b into a >= b and a <= b*)letspliteqc=ifget_typc=EQthenletc1=copycinset_typc1SUPEQ;letc2=copyc1inset_cstc2(Apron.Coeff.neg(get_cstc2));iter(funcv->set_coeffc2v(Apron.Coeff.negc))c2;c1,c2elseraise(Invalid_argument"spliteq must take an equality constraint")(* split a <> b into a > b or a < b*)letsplitdiseqc=ifget_typc=DISEQthenletc1=copycinset_typc1SUP;letc2=copyc1inset_cstc2(Apron.Coeff.neg(get_cstc2));iter(funcv->set_coeffc2v(Apron.Coeff.negc))c2;c1,c2elseraise(Invalid_argument"splitdiseq must take a disequality constraint")