12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970(**************************************************************************)(* *)(* This file is part of Aorai plug-in of Frama-C. *)(* *)(* Copyright (C) 2007-2023 *)(* CEA (Commissariat à l'énergie atomique et aux énergies *)(* alternatives) *)(* INRIA (Institut National de Recherche en Informatique et en *)(* Automatique) *)(* INSA (Institut National des Sciences Appliquees) *)(* *)(* 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, version 2.1. *)(* *)(* It 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. *)(* *)(* See the GNU Lesser General Public License version 2.1 *)(* for more details (enclosed in the file licenses/LGPLv2.1). *)(* *)(**************************************************************************)openAutomaton_asttypestate=Automaton_ast.statetypetransition=Automaton_ast.typed_transmoduleVertex=structtypet=stateletcomparexy=Stdlib.comparex.numsy.numslethashx=Hashtbl.hashx.numsletequalxy=x.nums=y.numsletdefault={nums=-1;name="";multi_state=None;acceptation=Bool3.False;init=Bool3.False}endmoduleEdge=structtypet=transitionletcomparexy=Stdlib.comparex.numty.numtletdefault={numt=-1;start=Vertex.default;stop=Vertex.default;cross=TTrue;actions=[]}endincludeGraph.Imperative.Digraph.ConcreteBidirectionalLabeled(Vertex)(Edge)letof_automatonauto=letg=create()inList.iter(funt->add_edge_eg(t.start,t,t.stop))auto.trans;gletstatesg=fold_vertex(funvacc->v::acc)g[]letfilter_statesfg=fold_vertex(funvacc->iffvthenv::accelseacc)g[]letinit_statesg=filter_states(funv->v.Automaton_ast.init=Bool3.True)gletedgesg=fold_edges_e(funeacc->e::acc)g[]