123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960(*******************************************************************************
* 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
******************************************************************************)(** Compared to Simplify1, this version maps qualified relations to formulas
relying on cardinality arguments. *)(** EXPECTED TO BE BE DONE AFTER CHECKING ARITIES. *)openContainersopenGen_goalmoduleTS=Tuple_setletfresh_varbaseexp=Var.fresh~loc:exp.exp_locbase(* simplify Ast goals *)classsimplify=object(self:'self)inheritSimplify1.simplify(* change relation qualifiers into formulas *)method!visit_Qualenvqualexp=Msg.debug(funm->m"Simplify2.visit_Qual <-- %a"Ast.pp_prim_fml@@Gen_goal.qualqualexp);letprim_fml=matchqualwith|ROne->icomp(iexpexp.exp_loc@@cardexp)ieq(iexpexp.exp_loc@@num1)|RLone->icomp(iexpexp.exp_loc@@cardexp)lte(iexpexp.exp_loc@@num1)|RSome->icomp(iexpexp.exp_loc@@cardexp)gte(iexpexp.exp_loc@@num1)|RNo->icomp(iexpexp.exp_loc@@cardexp)ieq(iexpexp.exp_loc@@num0)inself#visit_prim_fmlenvprim_fml|>Fun.tap@@funres->Msg.debug(funm->m"Simplify2.visit_Qual --> %a"Ast.pp_prim_fmlres)endletrunelo=letopenAstinMsg.debug(funm->m"Entering Simplify2.simplify_fml");{elowithgoal=(newsimplify)#visit_t()elo.goal}lettransfo=Transfo.make"simplify2"run