123456789101112131415161718192021222324252627282930313233343536373839404142(************************************************************************)(* The λΠ-modulo Interactive Proof Assistant *)(************************************************************************)(************************************************************************)(* λΠ-modulo serialization Toplevel *)(* Copyright Inria -- Dual License LGPL 2.1 / GPL3+ *)(* Written by: F. Blanqui, E. J. Gallego Arias, F. Lefoulon *)(************************************************************************)(* Status: Experimental *)(************************************************************************)(* The functor for cursor maps. *)moduleMake(Range:Range_intf.S)=struct(* A map of which keys are intervals. *)moduleRange=RangemoduleRangeMap=Map.Make(Range)(* Now we need to transform the map so that : - the keys for "add" are
intervals - the keys for "find" are points. *)type'at=(Range.t*'a)RangeMap.tletpoint_to_intervalpt=Range.make_intervalptptletfindcursormap=letinterv=point_to_intervalcursorinRangeMap.find_optintervmapletempty=RangeMap.emptyletaddinterveltmap=RangeMap.addinterv(interv,elt)mapletto_stringelt_to_string(map:'at)=letfkeyeltstr=let_,e=eltinRange.interval_to_stringkey^"Token : "^elt_to_stringe^"\n\n"^strinRangeMap.foldfmap""end(* The implementation of CursorMap using a functor. *)includeMake(Range)