xK      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJ =Takes a type and a list of variable names and declares them. FTakes a type and a list of array names and their sizes declares them. KTakes a type and a variable and initializes it. It is YOUR responsibility  to ensure that val is of type t. LTakes a type and an array and initializes it. It is YOUR responsibility to  ensure that vals is of type t. IDeclare function prototypes, given a return type, a function name, and a  | list of argument types. Use K for a return type of void. Add an include of a library  Add an include of a header file LMN3printf, with and without a newline (nl) character.    d !"#$%&O'WFor each typed variable, this type holds all its successive values in an infinite list C Beware : each element of one of those lists corresponds to a full Atom period,  not to a single clock tick. (This is a generalization of @ N which is used for storing Maps over values parameterized by different types. HIt is extensively used in the internals of Copilot, in conjunction with  j and k )*+,-./012345:Holds the complete specification of a distributed monitor , type DistributedStreams = (Streams, Sends) ?A type is streamable iff a stream may emit values of that type $There are very strong links between 5 and ( :  the types aggregated in ( are exactly the 5 7 types and that invariant should be kept (see methods) 6BProvides access to the Map in a StreamableMaps which store values  of the good type 7CProvides a way to modify (mostly used for insertions) the Map in a 4 StreamableMaps which store values of the good type 8A default value for the type a. Its value is not important. 9A constructor to produce an Atom value :A constructor to get an Atom! value from an external variable ;BThe argument only coerces the type, it is discarded. Returns the = format for outputting a value of this type with printf in C  For example %f for a float <>The same, only adds the wanted precision for floating points. =5The argument only coerces the type, it is discarded.  Returns the corresponding Atom type. >HLike Show, except that the formatting is exactly the same as the one of J C for example the booleans are first converted to 0 or 1, and floats and " doubles have the good precision. ?A named stream @FContainer for mutually recursive streams, whose specifications may be " parameterized by different types ALHolds all the different kinds of language elements that are pushed into the : Writer monad. This currently includes the actual specs, send directives, M and trigger directives. (Use the functions in Language.hs to make sends and  triggers.) BCDEFGHIJKLNAn instruction to send data on a port at a given phase. Uses a phantom type. 5 data Send a = Sendable a => Send (Var, Phase, Port) MNOPQRRSpecification of a stream, parameterized by the type of the values of the stream.  The only requirement on a is that it should be 5. STUVWXYZ[\)Port over which to broadcast information ]^Phase of an Atom phase _ Atom period ` C file name a+Names of the streams or external variables bcdeIf the R isn't a [a,, then throw an error; otherwise, apply the  function. fSending data over ports. g)Lookup into the map of the right type in ( h)Lookup into the map of the right type in ( / Launch an exception if the index is not in it ijJThis function is used to iterate on all the values in all the maps stored  by a (!, accumulating a value over time klmOnly keeps in sm" the values whose key+type are in l. Also returns a K bool saying whether all the elements in sm were in l. Works even if some  elements in l are not in sm. Not optimised at all. PnGet the Copilot variables. oAn empty streamableMaps. p-Verifies if its argument is equal to emptySM qGReplace all accepted special characters by sequences of underscores. QRrBTo make customer C triggers. Only for Spec Bool (others throw an & error). XXX make them throw errors! stuv` !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuv`a`_^\]R[ZYXWVUTS@?LMNOPQGHIJKFeABCDE56789:;<=>f()*+,-./01234opghjklmqn'v%t&$"# !suibcdr` !!"##$%&'( )*+,-./01234)*+,-./012345 6789:;<=>6789:;<=>?@ABCDEBCDEFGHIJKHIJKLMNOPQMNOPQR [ZYXWVUTSSTUVWXYZ[\]]^_`abcdefghijklmnopqrstuvwxySz{|}~AUsed for representing an error in the specification, detected by  $If an output depends of a future of ( an input it will be hard to compile to  say the least Could be compiled, but  would need bigger  prophecyArrays The algorithm to compile  Copilot specification can  only work if there is no  negative weighted closed  path in the specification,  as described in the original  research paper 2either a variable is not defined, or not with the 9 good type ; there is no implicit conversion of types in  Copilot %External array indexes can only take $ variables or constants as indexes. &if an external variable is sampled at ' phase 0 then there is no time for the  stream to be updated &if an external variable is sampled at ' phase 0 then there is no time for the  stream to be updated )A drop expression of less than 0 is used the BNF is not respected TUVCheck a Copilot specification. F If it is not compilable, then returns an error describing the issue.  Else, returns Nothing WX>Checks that streams are well defined (i.e., can be compiled). wxyz{|}~z~}|{wyxwyxxyz~}|{{|}~ "The main function of this module.  It takes a Copilot4 specification, the values of the monitored values, ( and returns the values of the streams. Y  Compiles an Copilot specification to an Atom one. V The period is given as a Maybe : if it is Nothing, an optimal period will be chosen. Z[\]^_`LFind the maximum phase as which an array sampling depends on this stream by  computing it'1s index in terms of it. Returns zero by default. abcdefghijk lmnopqrstuvwxyz{|}~]Cast a into b. We only allow  safe casts to larger types. IBeware : crash without any possible recovery if a division by 0 happens. 2 Same risk with mod. Use div0 and mod0 if unsure. EAs mod and div, except that if the division would be by 0, the first  argument is used as a default. OBeware : both sides are executed, even if the result of one is later discarded @opsF, opsF2 and opsF3 are feeded to Tests.Random.randomStreams. H They allows the random generated streams to include lots of operators. S If you add a new operator to Copilot, it would be nice to add it to one of those, C that way it could be used in the random streams used for testing. O opsF holds all the operators of arity 1, opsF2 of arity 2 and opsF3 of arity3 S They are StreamableMaps, because operators are sorted based on their return type. Useful for writing libraries. Define a stream variable. Takes a function name , a port number, a Copilot variable v, and a  phase ph*, and constructs a call to the C function  name(x,y) where x is ! the value of the Copilot stream v and y" is the port number. The sending * of the value on the port occurs at phase ph. No C arguments Turn a Spec Var% into an arguement for a C function. Turn a Spec Var% into an arguement for a C function. Takes a Boolean stream, Coerces a type that is 5 into a Copilot constant. Drop i elements from a stream.  Just a trivial wrapper over the T constructor O O  B Name of the C file to generate  Options to pass to the compiler The optional period Interpret the program or not Where to put the executable Which compiler to use 4Code to replace the default initialization and main  , triggers :: [(Var, String)], -- ^ A list of Copilot variable C function K -- name pairs. The C funciton is called if H -- the Copilot stream becomes True. The G -- Stream must be of Booleans and the C @ -- function must be of type void  foo(void). This function is the core of Copilot : L it glues together analyser, interpreter and compiler, and does all the IO. X It can be called either from interface (which justs decodes the command-line argument) 2 or directly from the interactive prompt in ghci.  streams is a specification,   inputExts/ allows the user to give at runtime values for c the monitored variables. Useful for testing on randomly generated values and specifications, & or for the interpreted version.  be0 chooses between compilation or interpretation, S and if compilation is chosen (AtomToC) holds a few additionnal informations.  see description of    iterationsF just gives the number of periods the specification must be executed. h If you would rather execute it by hand, then just choose AtomToC for backEnd and 0 for iterations  verbose determines what is output.  +If there's no Streams,  then generate random  streams. For distributed monitors. %Assign values to external variables. Set gcc options. (Set the period. If none is given, then + the smallest feasible period is computed. Interpreting? +How many iterations are we simulating for? 8Verbosity level: OnlyErrors | DefaultVerbose | Verbose. *Random seed for generating Copilot specs. Name of the C file generated. 4The C compiler to use, as a path to the executable. 8Where to place the output C files (.c, .h, and binary). +Code to append above and below the C file. +A list of Copilot variable C function name ) pairs. The C funciton is called if the * Copilot stream becomes True. The Stream - must be of Booleans and the C function must  be of type void  foo(void). There should * be no more than one function per trigger , variable. Triggers fire in the same phase $ (1) that output vars are assigned. ;Use the hardware clock to drive the timing of the program? 7Set the directives for sending stream values on ports. 7Set the directives for sending stream values on ports. DSets the environment for simulation by giving a mapping of external % variables to lists of values. E.g.,  $ setE (emptySM {w32Map = fromList [("ext", [0,1..])]}) ...!sets the external variable names ext9 to take the natural numbers, up to the limit of Word32. Set the external arrays. Sets the hardware clock. See  http: github.com tomahawkinsatomblobmasterLanguageAtom/ Code.hs. )Sets the options for the compiler, e.g.,   setC "-O2" ...Sets gcc options. sManually set the period for the program. Otherwise, the minimum required period is computed automatically. E.g.,  setP 100 ...  < sets the period to be 100. The period must be at least 1. <Sets the number of iterations of the program to simulation:  setN 50  ' simulations the program for 50 steps. Set the verbosity level. JSets the compiler to use, given as a path to the executable. The default  is "gcc". HSets the directory into which the output of compiled programs should be ? placed. If the directory does not exist, it will be created. >Sets the code to precede and follow the copilot specification W If nothing, then code appropriate for communication with the interpreter is generated The main function that dispatches. 7Were streams given? If not, just make random streams. ,  Did s hold in the previous period? Has s6 always held (up to and including the current state)? Did s> hold at some time in the past (including the current state)?  Once s2. holds, in the following state (period), does s1 continuously hold?     Returns the smallest m <= n such that drop m s is true, and -1 if no  such m exists.  Returns the smallest m <= n such that drop m s is false, and -1 if no  such m exists.  Returns the largest m <= n such that drop m s is true, and -1 if no  such m exists.  Returns the largest m <= n such that drop m s is false, and -1 if no  such m exists.              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 ...    Property s) holds at the next period. For example:    0 1 2 3 4 5 6 7  s => F F F T F F T F ...  next s => F F T F F T F ...   ? Note: s must have sufficient history to drop a value from it.  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:    s => F F F T F F F T ...  p => F T T T F T T T ...    until n s0 s1 means that eventually n s1, and up until at least the  period before s1 holds, s0 continuously holds. release n s0 s1 means that either  always n s1, or s1 holds up to and  including the period at which s0 becomes true.  Summation. Maximum value. Minimum value.  Mean value. n must not overflow  for word size a1 for streams over which computation is peformed.   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#Sending over ports. $%&'()*+, !"#$%&'()*+, !"#$%&'()*+, !"#$%&'()*+,-./0123456789:-./0123456789:.-/0123456789:-./0123456789:;<=>?@ABCDEFGHIJ;<=>?@ABCDEFGHIJ;<=>?@BCADEFGHIJ;<=>?@ABCDEFGHIJ ! " #$%&'()*+,-./01234556789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`aabcdeefghijklmnopqrsttuvwsxyz{|}~                                               !"#$%&'()*+,-./0123456789:;<=>?@ABCDE*-FGHIJKLMNOPQRSTUVWX4YZ[\]^_`abcdefghijklmnopqrstuvwxyz { | | } ~                                            copilot-0.28Language.Copilot.LanguageLanguage.Copilot.AdHocCLanguage.Copilot.HelpLanguage.Copilot.CoreLanguage.Copilot.AnalyserLanguage.Copilot.InterpreterLanguage.Copilot.CompilerLanguage.Copilot.AtomToCLanguage.Copilot.Tests.RandomLanguage.Copilot.DispatchLanguage.Copilot.InterfaceLanguage.Copilot.Libs.ErrorChksLanguage.Copilot.Libs.PTLTLLanguage.Copilot.Libs.IndexesLanguage.Copilot.Libs.LTL Language.Copilot.Libs.Statistics&Language.Copilot.Examples.StatExamples"Language.Copilot.Examples.Examples%Language.Copilot.Examples.LTLExamples'Language.Copilot.Examples.PTLTLExamplesLanguage.Copilot.PrettyPrinterLanguage.CopilotbaseGHC.Num fromInteger-negateGHC.Real FractionalNumghc-primGHC.BoolBoolFalseTrue/signumabs*+varDeclarrDeclvarInit arrayInitfuncDeclincludeBracket includeQuote printfNewlineprintfhelpStr BoundedArrayB TmpSamplestmpVarstmpArrstmpIdxsPhasedValueIdxPhIdxPhasedValueArrPhAPhasedValueVarPhVIndexesOutputs ProphArrsVarsStreamableMapsSMbMapi8Mapi16Mapi32Mapi64Mapw8Mapw16Mapw32Mapw64MapfMapdMap Streamable getSubMap updateSubMapunitatomConstructorexternalAtomConstructortypeId typeIdPrecatomTypeshowAsCStreamStreams LangElemsstrmssndstrigsTriggersTriggertrigVartrigNametrigArgsSendsendVarsendPhsendPortsendNameSpecDropAppendF3F2FPArrPVarConstVarPortPhasePeriodNamegetSpecsgetSends getTriggers notVarErrmkSend getMaybeElemgetElem getAtomTypefoldStreamableMapsmapStreamableMapsmapStreamableMapsMfilterStreamableMapsgetVarsemptySM isEmptySM normalizeVar makeTrigger tmpVarNameemptyTmpSamples tmpArrNamenextStExtVarsExtAExtVSpecSetPArrSet DropSpecSet FunSpecSet AllSpecSetErrorDependsOnFutureDependsOnClosePastNonNegativeWeightedClosedPathBadType BadPArrSpecBadSamplingArrPhaseBadSamplingPhaseBadDrop BadSyntaxcheckgetExternalVarsinterpretStreams copilotToAtom tmpSampleStrgetPrePostCode OperatorsOperatorfromOp randomStreamscastnotmoddivmod0div0<<=>=>==/=||&&^==>muxextBextI8extI16extI32extI64extW8extW16extW32extW64extFextDextArrBextArrI8 extArrI16 extArrI32 extArrI64extArrW8 extArrW16 extArrW32 extArrW64extArrFextArrDopsFopsF2opsF3varvarBvarI8varI16varI32varI64varW8varW16varW32varW64varFvarD.=portsendvoid<><>>triggerconsttruefalsedrop++VerboseDefaultVerbose OnlyErrors Iterations InterpretedNotInterpretedBackEnd InterpreterOptsAtomToCcNamegccOpts getPeriod interpreted outputDircompiler prePostCodearrDecsclockdispatchOptionsbaseOptstest interpretcompileverifysetEsetArrssetClocksetCsetPsetIsetNsetVsetRsetOsetGCCsetDirsetPP interfacehelpnPosChknOneChkint16Chkptltlprevious alwaysBeeneventuallyPrevsincesoonest soonestFaillatest latestFailltlalwaysnext eventuallyuntilreleasesummaxminmeant0tMeanfibt1t3t4t5yyzzxxenginedistribgcdgcd' testCoercionstestCoercions2testCoercions3i8traptestArrt99testingoutputtSoonesttLatesttAlwaystNexttFuturectUntil tRelease0 tRelease1 testRules tstdatprvtprvtstdatABtABtstdatEPtEPq1q2z tstdat1Sin tstdat2SintSincetSinExttSinExt2 engineRun Data.MaybeNothing printfPre printfPostnewlineArrIndexoverlap showIndentedshowRawExsWeight&&>||> syntaxCheckdefCheck initProphArr initOutputinitExtSamplesmakeUpdateIndexmakeOutputIndexmakeRule maxSampleDepmakeSend sampleExtsgetIdxgetOptimalPeriodextDeclspreCodevPrepostCode inputExtVars sampleExtVars outputVars VariablesVNamemaxDropmaxSamplePhaseweightsContinueVarweightsContinuePVarweightsVarTypesweightsPVarTypesweightsAllSpecSetweightsFunSpecSetweightsDropSpecSetfoldRandomableMapsrandomWeightedaddRandomVNames addRandomSpec randomSpecaddRandomExternalrandomExternalValues TriggerLstCastablecastFromcastErrmkOpmkOp2mkOp3 mkOp2CoercemkOp2OrdmkOp2Eqnot_+$-$*$/$<$<=$>=$>$==$/=$||$&&$^$==>$mux_createMapFromElems copilotToCgccCallexecuteshowVars preludeText optStreamsoptSendsoptExts optCompile optPeriod optInterpret optIterations optVerbose optRandomSeedoptCName optCompiler optOutputDiroptPrePostCode optTriggersoptArrsoptClocksetS setTriggers createSeedgetStreamsVars getBackendchktmpName soonestHlp latestHlp foldDrops