123456789101112131415161718192021openLangopenSlmoduleICov=Coverage.Instr.SinglemoduleValue=Runtime.Valueletmake()=(* Instruction coverage and a reader for it *)letcoverage=refICov.emptyinletread()=!coveragein(* Instruction coverage measurement handler *)letmoduleH:Handler.HANDLER=structincludeHandler.Defaultletinit_spec(spec:Handler.spec):unit=matchspecwithSLspec_sl->coverage:=ICov.initspec_sl|_->()leton_instr(instr:instr):unit=coverage:=ICov.hit!coverageinstr.note.iidendin(* Return the handler and the reader *)((moduleH:Handler.HANDLER),read)