?8      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~        !"#$%&'()*+,-./01234567 =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 8 for a return type of void. Add an include of a library  Add an include of a header file 9:;3printf, with and without a newline (nl) character.    S !"#$%&<'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 G 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  Z and \ )*+,-./01234567?A type is streamable iff a stream may emit values of that type $There are very strong links between 7 and ( :  the types aggregated in ( are exactly the 7 types 1 and that invariant should be kept (see methods) 8BProvides access to the Map in a StreamableMaps which store values  of the good type 9RProvides a way to modify (mostly used for insertions) the Map in a StreamableMaps % which store values of the good type :A default value for the type a. Its value is not important. ;A constructor to produce an Atom value <A constructor to get an Atom! value from an external variable =5The argument only coerces the type, it is discarded. I 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. @JLike Show, except that the formatting is exactly the same as the one of C P for example the booleans are first converted to 0 or 1, and floats and doubles  have the good precision. AJTo make customer C triggers. Only for Spec Bool (others throw an error).  XXX make them throw errors! B:Holds the complete specification of a distributed monitor CRContainer for all the instructions sending data, parameterised by different types D7An instruction to send data on a port at a given phase EFA named stream GFContainer for mutually recursive streams, whose specifications may be " parameterized by different types HRSpecification of a stream, parameterized by the type of the values of the stream.  The only requirement on a is that it should be 7. IJKLMNOPQR)Port over which to broadcast information SPhase of an Atom phase T Atom period U C file name V+Names of the streams or external variables W)Lookup into the map of the right type in ( X)Lookup into the map of the right type in ( / Launch an exception if the index is not in it YZJThis function is used to iterate on all the values in all the maps stored  by a (!, accumulating a value over time [JThis function is used to iterate on all the values in all the maps stored  by a (!, accumulating a value over time \]^Only 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. _Get the Copilot variables. `An empty streamableMaps. a-Verifies if its argument is equal to emptySM bGReplace all accepted special characters by sequences of underscores. =>cdefP !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefPVUTSRHQPONMLKJIGFCDEB789:;<=>?@A56()*+,-./01234`aWXZ[\]^b_'f%d&$"# !ceYP !!"##$%&'( )*+,-./01234)*+,-./012345667 89:;<=>?@A89:;<=>?@ABCDEEFGH QPONMLKJIIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghi?jklmnoAUsed for representing an error in the specification, detected by y p$If an output depends of a future of ( an input it will be hard to compile to  say the least qCould be compiled, but  would need bigger  prophecyArrays rThe 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 s2either a variable is not defined, or not with the 9 good type ; there is no implicit conversion of types in  Copilot t%External array indexes can only take $ variables or constants as indexes. u&if an external variable is sampled at ' phase 0 then there is no time for the  stream to be updated v&if an external variable is sampled at ' phase 0 then there is no time for the  stream to be updated w)A drop expression of less than 0 is used xthe BNF is not respected @AByCheck a Copilot specification. F If it is not compilable, then returns an error describing the issue.  Else, returns Nothing CD>Checks that streams are well defined (i.e., can be compiled). zghijklmnopqrstuvwxyzyoxwvutsrqpjnmlkzgihgihhijnmlkklmno xwvutsrqppqrstuvwxyz{"The main function of this module.  It takes a Copilot4 specification, the values of the monitored values, ( and returns the values of the streams. E{{{ | 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. FG}HIJKLLFind 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. MNOP|}|}|}~QRSTUVW~~~ XYZ[\]^_`abcdefghijVkCast a into b. We only allow  safe casts to larger types. lIBeware : 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. mOBeware : both sides are executed, even if the result of one is later discarded nopqrstuvwxyz{|}~@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. Drop i elements from a stream.  Just a trivial wrapper over the J constructor Define a stream variable. Allows to build a C from specification I I  < 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 &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). 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? 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 KGive C function triggers for Copilot Boolean streams. The tiggers fire if  the stream becoms true. The main function /  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{|}~                     !"#$%&' !"#$%&' !"#$%&' !"#$%&'()*+,-./01234567()*+,-./01234567()*+,-/0.1234567()*+,-./01234567 ! " #$%&'()*+,-./01234556789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^__`abcdefghijklmnokpqrstuvwxyz{|}~                                  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH$IJKLMNOPQRSTUVWXYZ[\]^_`abcdefghi j k k l m n o p q r s t u v w x y z {|}~                             copilot-0.26Language.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 ProphArrsVarsStreamableMapsSMbMapi8Mapi16Mapi32Mapi64Mapw8Mapw16Mapw32Mapw64MapfMapdMapSendablesend Streamable getSubMap updateSubMapunitatomConstructorexternalAtomConstructortypeId typeIdPrecatomTypeshowAsC makeTriggerDistributedStreamsSendsSendStreamStreamsSpecDropAppendF3F2FPArrPVarConstVarPortPhasePeriodName getMaybeElemgetElem getAtomTypefoldStreamableMapsfoldSendableMapsmapStreamableMapsmapStreamableMapsMfilterStreamableMapsgetVarsemptySM isEmptySM normalizeVar tmpVarNameemptyTmpSamples tmpArrNamenextStExtVarsExtAExtVSpecSetPArrSet DropSpecSet FunSpecSet AllSpecSetErrorDependsOnFutureDependsOnClosePastNonNegativeWeightedClosedPathBadType BadPArrSpecBadSamplingArrPhaseBadSamplingPhaseBadDrop BadSyntaxcheckgetExternalVarsinterpretStreams copilotToAtom tmpSampleStrgetPrePostCode OperatorsOperatorfromOp randomStreamscastnotmoddivmod0div0<<=>=>==/=||&&^==>muxextBextI8extI16extI32extI64extW8extW16extW32extW64extFextDextArrBextArrI8 extArrI16 extArrI32 extArrI64extArrW8 extArrW16 extArrW32 extArrW64extArrFextArrDopsFopsF2opsF3varBvarI8varI16varI32varI64varW8varW16varW32varW64varFvarDsendW8truefalsedrop++.=..|VerboseDefaultVerbose OnlyErrors Iterations InterpretedNotInterpretedBackEnd InterpreterOptsAtomToCcNamegccOpts getPeriod interpreted outputDircompiler prePostCodetriggersarrDecsclockdispatchOptionsbaseOptstest interpretcompileverifysetSsetEsetArrssetClocksetCsetPsetIsetNsetVsetRsetOsetGCCsetDirsetPP setTriggers interfacehelpnPosChknOneChkint16Chkptltlprevious alwaysBeeneventuallyPrevsincesoonest soonestFaillatest latestFailltlalwaysnext eventuallyuntilreleasesummaxminmeant0tMeanfibt1t3t4t5yyzzxxenginedistgcdgcd' testCoercionstestCoercions2testCoercions3i8traptestArrt99testingoutputtSoonesttLatesttAlwaystNexttFuturectUntil tRelease0 tRelease1 testRules tstdatprvtprvtstdatABtABtstdatEPtEPq1q2z tstdat1Sin tstdat2SintSincetSinExttSinExt2 engineRun Data.MaybeNothing printfPre printfPostnewlineArrIndex showIndentedshowRawExsWeight&&>||> syntaxCheckdefCheck initProphArr initOutputinitExtSamplesmakeUpdateIndexmakeOutputIndexmakeRule maxSampleDepmakeSend sampleExtsgetIdxgetOptimalPeriodextDeclspreCodevPrepostCode inputExtVars sampleExtVars outputVars VariablesVNamemaxDropmaxSamplePhaseweightsContinueVarweightsContinuePVarweightsVarTypesweightsPVarTypesweightsAllSpecSetweightsFunSpecSetweightsDropSpecSetfoldRandomableMapsrandomWeightedaddRandomVNames addRandomSpec randomSpecaddRandomExternalrandomExternalValuesCastablecastFromcastErrmkOpmkOp2mkOp3 mkOp2CoercemkOp2OrdmkOp2Eqnot_+$-$*$/$<$<=$>=$>$==$/=$||$&&$^$==>$mux_createMapFromElemscheckTriggerVars copilotToCgccCallexecuteshowVars preludeText optStreamsoptSendsoptExts optCompile optPeriod optInterpret optIterations optVerbose optRandomSeedoptCName optCompiler optOutputDiroptPrePostCode optTriggersoptArrsoptClock createSeedgetStreamsVars getBackendchktmpName soonestHlp latestHlp foldDrops