12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152(*******************************************************************************
* 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
******************************************************************************)(** Type of transformations. *)openContainerstype('src,'dst)t={name:string;run:'src->'dst}letmakenamerun=assert(not@@String.is_emptyname);{name;run}letname{name;_}=nameletruntx=t.runxletfbyt1t2={name=t1.name^"$$"^t2.name;run=(funx->t1.runx|>t2.run)}letidentity={name="$$id";run=(funx->x)}(* association list *)type('src,'dst)tlist=(string*('src,'dst)t)listlettlistts=assert(not@@List.is_emptyts);letopenListinletaddtransfost=assert(not@@Assoc.mem~eq:String.equalt.nametransfos);Assoc.set~eq:String.equalt.namettransfosinfold_leftadd[]tsletget_exntst=List.Assoc.get_exn~eq:String.equaltts