copilot-libraries-0.2: A Haskell-embedded DSL for monitoring hard real-time distributed systems.

Copilot.Library.Voting

Description

An implementation of the Boyer-Moore Majority Vote Algorithm for Copilot.

For details of the Boyer-Moore Majority Vote Algorithm see the following papers:

  • Wim H. Hesselink, "The Boyer-Moore Majority Vote Algorithm", 2005
  • Robert S. Boyer and J Strother Moore, "MJRTY - A Fast Majority Vote Algorithm", 1982

Documentation

majority :: (Eq a, Typed a) => [Stream a] -> Stream aSource

aMajority :: (Eq a, Typed a) => [Stream a] -> Stream a -> Stream BoolSource