123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657(****************************************************************************)(* *)(* This file is part of MOPSA, a Modular Open Platform for Static Analysis. *)(* *)(* Copyright (C) 2017-2019 The MOPSA Project. *)(* *)(* This program is free software: you can redistribute it and/or modify *)(* it under the terms of the GNU Lesser General Public License as published *)(* by the Free Software Foundation, either version 3 of the License, or *)(* (at your option) any later version. *)(* *)(* This program is distributed in the hope that it will be useful, *)(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)(* GNU Lesser General Public License for more details. *)(* *)(* You should have received a copy of the GNU Lesser General Public License *)(* along with this program. If not, see <http://www.gnu.org/licenses/>. *)(* *)(****************************************************************************)(** Constants *)openTypopenMopsa_utilstypeconstant=..typeconstant+=|C_topoftyp|C_boolofboolletconstant_compare_chain=TypeExt.mk_compare_chain(func1c2->matchc1,c2with|C_topt1,C_topt2->compare_typt1t2|C_boolb1,C_boolb2->Bool.compareb1b2|_->comparec1c2)letconstant_pp_chain=TypeExt.mk_print_chain(funfmtc->matchcwith|C_topT_any->Format.fprintffmt"⊤"|C_topt->Format.fprintffmt"⊤:%a"pp_typt|C_bool(b)->Format.fprintffmt"%a"Format.pp_print_boolb|_->Exceptions.panic"constant_pp_chain: unknown constant")letregister_constant(info:constantTypeExt.info):unit=TypeExt.registerinfoconstant_compare_chainconstant_pp_chainletregister_constant_comparecmp=TypeExt.register_comparecmpconstant_compare_chainletregister_constant_pppp=TypeExt.register_printppconstant_pp_chainletcompare_constanto1o2=TypeExt.compareconstant_compare_chaino1o2letpp_constantfmtconstant=TypeExt.printconstant_pp_chainfmtconstant