Îõ³h$3Q1ì      !"#$%&'()*+,-./0123456789:;<=>?@ A 'Clocks based on a base period and phase7(c) 2011 National Institute of Aerospace / Galois, Inc. Safe-Inferredýcopilot-librariesConstructor for a B*. Note that period must be greater than 0.copilot-librariesConstructor for a CØ. Note that phase must be greater than or equal to 0, and must be less than the period.copilot-libraries#Generate a clock that counts every n ticks, starting at tick m, by using an array of size n.copilot-libraries$This follows the same convention as 0, but uses a counter variable of integral type a rather than an array.copilot-librariesPeriod n of clockcopilot-librariesPhase m of clockcopilot-librariesClock signal - D on clock ticks, E otherwisecopilot-librariesPeriod n of clockcopilot-librariesPhase m of clockcopilot-librariesClock signal - D on clock ticks, E otherwisePast-Time Linear-Temporal Logic7(c) 2011 National Institute of Aerospace / Galois, Inc. Safe-Inferredïcopilot-librariesDid s hold in the previous period?copilot-librariesHas s5 always held (up to and including the current state)?copilot-librariesDid s= hold at some time in the past (including the current state)?copilot-librariesOnce s2. holds, in the following state (period), does s1 continuously hold?Regular expression library7(c) 2011 National Institute of Aerospace / Galois, Inc. Safe-Inferred? ÷copilot-libraries4Regular expression matching over an arbitrary stream copilot-librariesÁRegular expression matching over a collection of boolean streams.×Regular expressions can contain symbols, which are expanded to match specific streams.$For example, the regular expression: "()+" Ñwould match if you provide a map (association list) that assigns, to the symbol "s0"4, a stream that is true at the first sample, and to "s1"À, a stream that is true at every sample after the first sample.copilot-librariesThe stream to monitor.copilot-librariesThe regular expression.copilot-libraries1A stream indicating when to reset the monitor. copilot-librariesRegular expressioncopilot-libraries4A table with the stream associated to each symbol.copilot-libraries0A stream indicating when to reset the monitor.  Stream for a stack machine7(c) 2011 National Institute of Aerospace / Galois, Inc. Safe-Inferredcopilot-librariesðStack stream in which the pop signal has precedence over the push signal in case both are true in the same tickcopilot-librariesðStack stream in which the push signal has precedence over the pop signal in case both are true in the same tickcopilot-librariesDepthcopilot-libraries Start valuecopilot-libraries Pop signalcopilot-libraries Push signalcopilot-libraries Push streamcopilot-libraries Stack topcopilot-librariesDepthcopilot-libraries Start valuecopilot-libraries Pop signalcopilot-libraries Push signalcopilot-libraries Push streamcopilot-libraries Stack top9Utility bounded-list functions (e.g., folds, scans, etc.)7(c) 2011 National Institute of Aerospace / Galois, Inc. Safe-Inferred) copilot-libraries”Given a stream, produce an infinite list of streams dropping an increasing number of elements of the given stream. For example, for a given stream s, the expression tails s is equal to $[ drop 0 s, drop 1 s, drop 2 s, ...].copilot-libraries²Given a stream and a number, produce a finite list of streams dropping an increasing number of elements of the given stream, up to that number. For example, for a given stream s, the expression take 2 s is equal to [ drop 0 s, drop 1 s].copilot-libraries¦Given a number, a function on streams, and two streams, fold from the left the function over the finite list of tails of the second stream (up to the given number). copilot-libraries¦Given a number, a function on streams, and two streams, fold from the left the function over the finite list of tails of the second stream (up to the given number).This function differs from Ø in that it does not require an initial accumulator and it assumes the argument number n is positive.!copilot-libraries§Given a number, a function on streams, and two streams, fold from the right the function over the finite list of tails of the second stream (up to the given number)."copilot-libraries§Given a number, a function on streams, and two streams, fold from the right the function over the finite list of tails of the second stream (up to the given number).This function differs from !Ø in that it does not require an initial accumulator and it assumes the argument number n is positive.#copilot-libraries¦Given a number, a function on streams, and two streams, fold from the left the function over the finite list of tails of the second stream (up to the given number).This function differs from 6 in that it returns the intermediate results as well.$copilot-libraries§Given a number, a function on streams, and two streams, fold from the right the function over the finite list of tails of the second stream (up to the given number).This function differs from !6 in that it returns the intermediate results as well.%copilot-libraries¦Given a number, a function on streams, and two streams, fold from the left the function over the finite list of tails of the second stream (up to the given number).ðThis function assumes the number of elements to scan is positive, and it also returns the intermediate results.&copilot-libraries§Given a number, a function on streams, and two streams, fold from the right the function over the finite list of tails of the second stream (up to the given number).ðThis function assumes the number of elements to scan is positive, and it also returns the intermediate results.'copilot-librariesºCase-like function: The index of the first predicate that is true in the predicate list selects the stream result. If no predicate is true, the last element is chosen (default element)(copilot-librariesIndex.ÇWARNING: Very expensive! Consider using this only for very short lists.)copilot-libraries(Cycle a list to form an infinite stream.  !"#$%&'() ) !"#$%&'(Basic bounded statistics7(c) 2011 National Institute of Aerospace / Galois, Inc. Safe-Inferredý*copilot-libraries Summation.+copilot-librariesMaximum value.,copilot-librariesMinimum value.-copilot-libraries Mean value. n" must not overflow for word size a0 for streams over which computation is peformed..copilot-libraries5Mean value over the current set of streams passed in.*+,-.+,*-.8Metric Temporal Logic (MTL) over a discrete time domain. Safe-Inferred)H /copilot-librariesÀEventually true in the future, within the time bounds specified.eventually l u clk dist s is true at time t if and only if s is true at some time t', where (t + l) <= t' <= (t + u).0copilot-librariesÀTrue at some point in the past within the time bounds specified.eventuallyPrev l u clk dist s is true at time t if and only if s is true at some time t', where (t - u) <= t' <= (t - l).1copilot-libraries F F F T F F T F ... next s => F F T F F T F ... (Note: s must have sufficient history to F a value from it.<copilot-libraries Property s holds for the next n periods. We require n >= 0. If n == 0, then s' holds in the current period, e.g., if p = always 2 sÉ, then we have the following relationship between the streams generated: à 0 1 2 3 4 5 6 7 s => T T T F T T T T ... p => T F F F T T ... =copilot-libraries Property s" holds at some period in the next n periods. If n == 0, then s* holds in the current period. We require n >= 0 . E.g., if p = eventually 2 sÉ, then we have the following relationship between the streams generated: 2s => F F F T F F F T ... p => F T T T F T T T ... >copilot-libraries until n s0 s1 means that eventually n s1+, and up until at least the period before s1 holds, s0 continuously holds.?copilot-librariesrelease n s0 s1 means that either  always n s1, or s10 holds up to and including the period at which s0 becomes true.=copilot-librariesncopilot-librariess;<=>?;=<>? 9Implementation of the Boyer-Moore Majority Vote Algorithm7(c) 2011 National Institute of Aerospace / Galois, Inc. Safe-Inferred,1?@copilot-libraries/Majority vote first pass: choosing a candidate.Acopilot-librariesÚMajority vote second pass: checking that a candidate indeed has more than half the votes.@copilot-libraries Vote streamscopilot-librariesCandidate streamAcopilot-libraries Vote streamscopilot-librariesCandidate streamcopilot-libraries True if candidate holds majority@A@A  Main import module for libraries7(c) 2011 National Institute of Aerospace / Galois, Inc. Safe-Inferred1Ã%  !"#$%&'()*+,-.;<=>?@AÇ    !"#$%&'()*+,-./0123456789:;<=>?@ABC;:<= D EFGHIJHIKLMNÏ,copilot-libraries-3.4-6gv4wWmPTB949ERCDpg4NOCopilot.Library.ClocksCopilot.Library.PTLTLCopilot.Library.RegExpCopilot.Library.StacksCopilot.Library.UtilsCopilot.Library.StatisticsCopilot.Library.MTLCopilot.Library.LTLCopilot.Library.VotingCopilot.Library.Librariesperiodphaseclkclk1previous alwaysBeeneventuallyPrevsince copilotRegexpcopilotRegexpB$fSymbolParserInt64$fSymbolParserInt32$fSymbolParserInt16$fSymbolParserInt8$fSymbolParserWord64$fSymbolParserWord32$fSymbolParserWord16$fSymbolParserWord8$fSymbolParserBool$fSymbolParserP$fEqP $fShowRegExp $fEqNumSym $fShowNumSym$fEqSym$fOrdSym $fShowSymstackstack'tailstakenfoldlnfoldl1nfoldrnfoldr1nscanlnscanrnscanl1nscanr1case'!!cyclesummaxminmeanmeanNow eventuallyalwaysuntilreleasetrigger matchingUntil matchingSincematchingReleasematchingTriggernextmajority aMajorityPeriodPhaseghc-prim GHC.TypesTrueFalse+copilot-language-3.4-ClZoTCDg1DL6RK22YVb1vl#Copilot.Language.Operators.Temporaldrop