-- | Queries into how long until properties hold or fail. We use Int16 to-- return the value, so your queries must not require looking more than 32,767-- periods :) . Thus, in the following, the parameter @n@ must be @0 <= n <=-- 32,767@. -1 indicates the test failed.moduleLanguage.Copilot.Libs.Indexes(soonest,soonestFail,latest,latestFail)whereimportPrelude(id,Int,String,fromIntegral,($))importqualifiedPreludeasPimportData.Int(Int16)importLanguage.Copilot.Libs.ErrorChksimportLanguage.Copilot.CoreimportLanguage.Copilot.LanguagesoonestHlp::String->(SpecBool->SpecBool)->Int->SpecBool->SpecInt16soonestHlpnamefns=int16Chknamen$nPosChknamen(buildStr0)wherebuildStrm=ifmP.>nthen(-1)elsemux(f$dropms)(fIm)(buildStr(mP.+1))fI=fromIntegrallatestHlp::String->(SpecBool->SpecBool)->Int->SpecBool->SpecInt16latestHlpnamefns=int16Chknamen$nPosChknamen(buildStrn)wherebuildStrm=ifmP.<0then(-1)elsemux(f$dropms)(fIm)(buildStr(mP.-1))fI=fromIntegral-- | Returns the smallest @m <= n@ such that @drop m s@ is true, and @-1@ if no-- such @m@ exists. soonest::Int->SpecBool->SpecInt16soonest=soonestHlp"soonest"id-- | Returns the smallest @m <= n@ such that @drop m s@ is false, and @-1@ if no-- such @m@ exists. soonestFail::Int->SpecBool->SpecInt16soonestFail=soonestHlp"soonestFail"not-- | Returns the largest @m <= n@ such that @drop m s@ is true, and @-1@ if no-- such @m@ exists. latest::Int->SpecBool->SpecInt16latest=latestHlp"latest"id-- | Returns the largest @m <= n@ such that @drop m s@ is false, and @-1@ if no-- such @m@ exists. latestFail::Int->SpecBool->SpecInt16latestFail=latestHlp"latest"not