l      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                             Safe-Inferred  None durations  durations  durations  durations 'an equality that tests also the types. >Replaces all instances of a value in a list by another value.  Value to search Value to replace it with  Input list  Output list        None The state of the game: "informations on players (the status of a rule. ,)An informationnal structure about a rule 9 Return type of a rule function. + it can be either nothing or another rule. <Type of a rule function. I!data associated with each events X events names m events types rstores the variable's data w)a container for a variable name and type z>A Nomex (Nomyx Expression) allows the players to write rules. F | within the rules, you can access and modify the state of the game. 6 | It is a compositional algebra defined with a GADT.  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~z~}|{wxyrstuvqpmonflkjihgedcba`X_^]\[ZYIVTRPNLJWUSQOMKFHG?@ABCDE>=<9;:687,-./012345(+*)&'"#$% !T  !"#$%&'(+*), -./0123456879;:<=>?@ABCDEFHGIVTRPNLJWUSQOMKX_^]\[ZY`abcdeflkjihgmonpqrstuvwxyz~}|{None-VArrayVar is an indexed array with a signal attached to warn when the array is filled. l | each indexed elements starts empty (value=Nothing), and when the array is full, the signal is triggered. o | This is useful to wait for a serie of events to happen, and trigger a computation on the collected results. variable creation variable reading variable writing .modify a variable using the provided function delete variable initialize an empty ArrayVar einitialize an empty ArrayVar, registering a callback that will be triggered when the array is filled 6initialize an empty ArrayVar, registering a callback. _the callback will be triggered when the array is filled, and then the ArrayVar will be deleted qstore one value and the given index. If this is the last filled element, the registered callbacks are triggered. 4get the messsage triggered when the array is filled get the association array 6get the association array with only the filled values  register a callback on an event <register a callback on an event, disregard the event number =set an handler for an event that will be triggered only once =set an handler for an event that will be triggered only once 8broadcast a message that can be catched by another rule subscribe on a message ?on the provided schedule, the supplied function will be called ;activate a rule: change its state to Active and execute it mreject a rule: change its state to Suppressed and suppresses all its environment (events, variables, inputs) ' the rule can be activated again later 6add a rule to the game, it will have to be activated Mtriggers a choice input to the user. The result will be sent to the callback %the same, disregard the event number 1the same, suppress the event after first trigger %the same, disregard the event number Atriggers a choice input to the user, using an enumerate as input %the same, disregard the event number 1the same, suppress the event after first trigger Mtriggers a string input to the user. The result will be sent to the callback Oasks the player pn to answer a question, and feed the callback with this data. Oasks the player pn to answer a question, and feed the callback with this data. get all the players Get a specific player Set the name of a player Set the name of a player =Get the total number of playersgetPlayersNumber :: Nomex Int Get all the players number 'Remove the player from the game (kick) !set victory to a list of players  give victory to one player   outputs a message to one player  Jallows a rule to retrieve its self number (for auto-deleting for example) a default rule Y     X     X     X     Noneevaluate an expression. M The rule number passed is the number of the rule containing the expression.  !"#$%&'()*+, !"#$%&'()*+, !"#$%&'()*+, !"#$%&'()*+,NoneHPerforms a vote. I=Performs a vote, all the possible alternatives are selected. Jassess the vote on every new vote with the assess function, and as soon as the vote has an issue (positive of negative), sends a signal Kxassess the vote with the assess function when time is reached, and sends a signal with the issue (positive of negative) Lxassess the vote with the assess function when time is elapsed, and sends a signal with the issue (positive of negative) Mmassess the vote only when every body voted. An error is generated if the assessing function returns Nothing. N2clean events and variables necessary for the vote OIa quorum is the neccessary number of voters for the validity of the vote P'adds a quorum to an assessing function QGassess the vote results according to a unanimity (everybody votes for) Rfassess the vote results according to an absolute majority (half voters plus one, no quorum is needed) S<assess the vote results according to a majority of x (in %) TJassess the vote results according to a necessary number of positive votes U6return the vote alternatives that are above threshold W7number of people that voted if the voting is finished, 3 total number of people that should vote otherwise 8-./0123456789:;<=>?@ABCDEFGH&the function used to count the votes. [assessors: when and how to perform the vote assessment (several assessors can be chained).  toVote: the matter to be voted. the vote alternatives. <return value: a message containing the result of the vote. IJKLMNOPQRSTUVWXYZ[\]^8-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^2EGF?@ABCD>=<89:;2345671HIJKLMNOPQRSTUVWXYZ[\/0]-.^'-./0123456789:;<=>?@ABCDEGFHIJKLMNOPQRSTUVWXYZ[\]^None _4This rule will activate automatically any new rule. `CThis rule will forbid any new rule to delete the rule in parameter (immutableRule :: RuleNumber -> RuleFunc )immutableRule rn = return $ Meta f where  f r = do  protectedRule < - getRule rn  case protectedRule of ) Just pr -> case _rRuleFunc r of / RuleRule paramRule -> paramRule pr ( _ -> return $ BoolResp True + Nothing -> return $ BoolResp True A rule will be always legal aA rule will be always illegal bAactive metarules are automatically used to evaluate a given rule @checkWithMetarules :: Rule -> Nomex (Event (Message ForAgainst) checkWithMetarules rule = do  rs <- getActiveRules % (metas :: [Rule -> Nomex BoolResp]) <- mapMaybeM maybeMetaRule rs ! let (evals :: [Nomex BoolResp] ) = map (meta -> meta rule) metas  foldr (&&*) true evals cDany new rule will be activate if the rule in parameter returns True dactivate or reject a rule eLperform an action for each current players, new players and leaving players f@perform the same action for each players, including new players g,create a value initialized for each players $manages players joining and leaving h@create a value initialized for each players initialized to zero $manages players joining and leaving k&Player p cannot propose anymore rules lLa rule can autodelete itself (generaly after having performed some actions) m$All rules from player p are erased: _`abcdefghijklm_`abcdefghijklm_`abcdefghijklm_`abcdefghijklmNonenA rule that does nothing o&A rule that says hello to all players paccount variable name and type q'Create a bank account for each players r each player wins X Ecu each day  you can also try with minutly or monthly instead of daily and everything in the time-recurrence package s3a player wins X Ecu if a rule proposed is accepted t.a player can transfer money to another player \ it does not accept new players or check if balance is positive, to keep the example simple udelete a rule vBplayer pn is the king: we create a variable King to identify him,  and we prefix his name with King x@Monarchy: only the king decides which rules to accept or reject yRevolution! Hail to the king! g This rule suppresses the democracy (usually rules 1 and 2), installs the king and activates monarchy. z>set the victory for players having more than X accepted rules |2will display the time to all players in 5 seconds }7Only one player can achieve victory: No group victory. U Forbidding group victory usually becomes necessary when lowering the voting quorum: - a coalition of players could simply force a victory rule and win the game. ~TRule that state that you win. Good luck on having this accepted by other players ;) /a majority vote, with the folowing parameters: @ a quorum of 2 voters is necessary for the validity of the vote K the vote is assessed after every vote in case the winner is already known + the vote will finish anyway after one day hChange current system (the rules passed in parameter) to absolute majority (half participants plus one) -kick a player and prevent him from returning Etriggers a referendum, if the outcome is yes player 2 will be kicked Ptriggers elections (all players are candidates), the winner becomes game master nopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~]nopqrstuvwxyz{|}~nopqrstuwvxyz{|}~]nopqrstuvwxyz{|}~ NoneAAA= Noneu      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Noneinitialize the game. join the game. leave the game.  insert a rule in pending rules. ;An helper function to use the state transformer GameState. ( It additionally sets the current time. ,      !""#$%&'()*+,,-.//01234456789:;<=>=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcde_`abfcghijklmenopqrrstuvvwxyz{|}~q      !"#$%&'())**+,,-./01123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{| } ~                                                                                                   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTU V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r stuvwxyz{|}~                   Nomyx-Language-0.2.2Paths_Nomyx_LanguageLanguage.Nomyx.UtilsLanguage.Nomyx.ExpressionLanguage.Nomyx.DefinitionLanguage.Nomyx.EvaluationLanguage.Nomyx.VoteLanguage.Nomyx.RuleLanguage.Nomyx.ExamplesLanguage.Nomyx.TestLanguage.Nomyx.GameLanguage.Nomyxversion getBinDir getLibDir getDataDir getLibexecDirgetDataFileNameoneWeekoneDayoneHour oneMinute=== replaceWithtracePN traceData mapMaybeM parse822TimesndMaybe mapStateIO getFreeNumberGameDesc_desc_agoraGame _gameName _gameDesc_rules_players _variables_events_outputs_victory _currentTime PlayerInfo _playerNumber _playerName SubmitRule RuleStatusRejectPendingActiveRule_rNumber_rName _rDescription _rProposedBy _rRuleCode _rRuleFunc_rStatus _rAssessedByBoolRespMsgRespRuleRespMetaVoidRuleFuncMsgDataMsg EventHandlerEH _eventNumber _ruleNumbereventhandler _evStatus EventStatus EvDeletedEvActive EventData VictoryData victoryDataInputStringDatainputStringDataInputChoiceDatainputChoiceData MessageData messageDataTimeDatatimeDataRuleDataruleData PlayerData playerDataEventVictory InputString InputChoiceMessageTimeRuleEvPlayerEvRule RuleEventDeletedModifiedAddedRejected ActivatedProposedLeaveArriveIdOutputVar _vRuleNumber_vNamevDataVvarNameNomex CatchError ThrowErrorBindReturnSelfRuleNumber CurrentTime SetVictory DelPlayer SetPlayerName GetPlayersGetRules ModifyRuleDelRuleAddRule RejectRule ActivateRule ProposeRule SendMessage DelAllEventsDelEventOnEventDelVarWriteVarReadVarNewVarCodeGameNameVarName EventName EventNumberRuleCodeRuleTextRuleDescRuleName RuleNumber PlayerName PlayerNumber displayGamegameNamegameDescrulesplayers variableseventsoutputsvictory currentTimedescagorarNumberrName rDescription rProposedBy rRuleCode rRuleFuncrStatus rAssessedBy playerNumber playerName eventNumber ruleNumberevStatus vRuleNumbervNameArrayVarnewVarnewVar_readVarreadVar_writeVar writeVar_ modifyVardelVardelVar_ newArrayVar newArrayVar'newArrayVarOnceisFullArrayVar putArrayVargetArrayVarMessagegetArrayVarDatagetArrayVarData' delArrayVaronEventonEvent_ onEventOnce onEventOnce_delEvent delEvent_ delAllEvents sendMessage sendMessage_ onMessage onMessageOncescheduleexecuteAndScheduleNext schedule_ schedule'executeAndScheduleNext' schedule'_ activateRule activateRule_ rejectRule rejectRule_getRulesgetActiveRulesgetRulegetRulesByNumbers getRuleFuncsaddRuleaddRule_ addRuleParamsgetFreeRuleNumber suppressRule suppressRule_suppressAllRules modifyRule inputChoiceinputChoiceHeadinputChoiceEnum inputString onInputChoiceonInputChoice_onInputChoiceOnceonInputChoiceOnce_onInputChoiceEnumonInputChoiceEnum_onInputChoiceEnumOnce_ onInputStringonInputString_onInputStringOnce_ getPlayers getPlayer getPlayerName setPlayerNamemodifyPlayerNamegetPlayersNumbergetAllPlayerNumbers delPlayer setVictory giveVictoryoutput outputAllgetCurrentTimegetSelfRuleNumber getSelfRulegetSelfProposedByPlayervoidRule andMsgBool andMsgMsg defaultRuleEvaluateevalExp triggerEvent triggerEvent_ errorHandler triggerChoiceexecChoiceHandler findEventgetChoiceEventsoutputS evProposeRuleevActivateRule evRejectRule evAddRule evDelRule evModifyRule addPlayer evDelPlayer evChangeName evDelEvent evInputChoice evTriggerTime delVarsRule delEventsRule runEvalErrorElection ReferendumAssessorVoteDatamsgEndvoteVar inputNumbersassessFunction VoteStats voteCounts voteFinished VoteResultVote ForAgainstVotableAltsaltsquotanameexclusiveWinnerVoteTypeNonExclusiveVote ExclusiveVotevoteWith voteWith_assessOnEveryVotesassessOnTimeLimitassessOnTimeDelayassessWhenEverybodyVoted cleanVotequorum withQuorum unanimitymajority majorityWith numberVotes voteQuotaexclusiveVoteQuotanbVoters totalVotersnotVotedvoted getVoteStatscounts referendum elections autoActivatelegalillegal maybeMetaRuleonRuleProposedactivateOrReject forEachPlayerforEachPlayer_createValueForEachPlayercreateValueForEachPlayer_modifyValueOfPlayermodifyAllValues noPlayPlayer autoDelete eraseAllRulesnothing helloWorldaccountscreateBankAccount winXEcuPerDaywinXEcuOnRuleAccepted moneyTransferdelRulemakeKingkingmonarchy revolution victoryXRules victoryXEcu displayTimenoGroupVictoryiWinvoteWithMajorityreturnToDemocracy banPlayerreferendumOnKickPlayergameMasterElections gameMasterChoice2YouMeChoiceSarkozyHollanddate1date2date3testGametestRule evalRuleFuncexecRuleFuncEventexecRuleFuncGameexecRuleFuncEventGame execRuleFunctestsallTeststestVar1 testVarEx1testVar2 testVarEx2testVar3 testVarEx3testVar4 testVarEx4testVar5 testVarEx5testSingleInputtestSingleInputExtestInputStringtestInputStringExtestSendMessagetestSendMessageExtestSendMessage2testSendMessageEx2testUserInputWritetestUserInputWriteExtestActivateRuletestActivateRuleExtestAutoActivateEx testTimeEventtestTimeEventExtestTimeEvent2testTimeEventEx2voteGameActions voteGame'voteGame voteGameTimedtestVoteAssessOnVoteComplete1testVoteAssessOnVoteComplete2testVoteAssessOnEveryVotes1testVoteAssessOnEveryVotes2testVoteAssessOnEveryVotes3testVoteAssessOnEveryVotes4testVoteMajorityWithtestVoteNumberPositiveVotestestVoteWithQuorum1testVoteWithQuorum2testVoteAssessOnTimeLimit1testVoteAssessOnTimeLimit2testVoteAssessOnTimeLimit3testVoteAssessOnTimeLimit4testVoteAssessOnTimeLimit5 testVoteRule LoggedGame_game_gameLog GameEvent SystemAddRule TimeEvent OutputPlayerInputStringResultInputChoiceResult ProposeRuleEv LeaveGameJoinGame GameSettings emptyGamegamegameLogupdateupdate' getLoggedGamegetTimes execWithGame execWithGame' activeRules pendingRules rejectedRulescatchIObindirlibdirdatadir libexecdir $fShowGame $fReadGame $fOrdGame$fEqGame $fOrdRule$fEqRule$fShowRuleResp$fOrdEventHandler$fEqEventHandler$fShowEventHandler$fEqVar $fShowVar $fShowNomex$fMonadError[]Nomex$fApplicativeNomex$fFunctorNomex $fMonadNomex$fBooleanNomex $fOrdAlts$fEqAlts $fShowAlts$fVotableElection$fVotableReferendum $fVotableRule Candidate candidateNoYesAgainstFormakeGMbaseGHC.Base++foldrGHC.Listconcatfilterzipmapfail>>=>>fmapreturn Control.MonadguardliftMMonadFunctor MonadPlusfoldMzipWith Data.Listunwordswordsunlineslinesproductsumfoldl1'foldl1foldl'unfoldrsortBysort permutations subsequencestailsinitsgroupBygroupdeleteFirstsByunzip7unzip6unzip5unzip4zipWith7zipWith6zipWith5zipWith4zip7zip6zip5zip4genericReplicate genericIndexgenericSplitAt genericDrop genericTake genericLength minimumBy maximumByminimummaximuminsertByinsert mapAccumR mapAccumL partition transpose intercalate intersperse intersectBy intersectunionByunion\\deleteBydeletenubBynub isInfixOf isSuffixOf isPrefixOf findIndices findIndexfind elemIndices elemIndex stripPrefix dropWhileEndmfilterapliftM5liftM4liftM3liftM2unlesswhen replicateM_ replicateMfoldM_ zipWithM_zipWithM mapAndUnzipMjoinvoidforever<=<>=>msumforM_forMfilterMmapM_mapM sequence_sequence=<<mplusmzerounzip3unzipzipWith3zip3!! concatMaplookupnotElemelemallanyorandreversebreakspansplitAtdroptake dropWhile takeWhilecycle replicaterepeatiteratescanr1scanrfoldr1scanl1scanlfoldllengthnullinitlasttailhead time-1.4.0.1Data.Time.Clock.UTCDiff diffUTCTime addUTCTimeData.Time.Clock.UTC utctDayTimeutctDayUTCTimeNominalDiffTimeData.Time.Clock.ScalepicosecondsToDiffTimesecondsToDiffTimegetModJulianDate ModJulianDate UniversalTimeDiffTimetime-recurrence-0.9.2Data.Time.Recurrence.SchedulestartingevalrecurwithStartOfWeekbyyearlymonthlyweeklydailyhourlyminutelysecondlyFreqRecurAndSchedule$Data.Time.Recurrence.ScheduleDetailsselectenumScheduleDetailsSecondsMinutesHoursDaysWeeksWeekDaysWeekDaysInWeekWeekDaysInMonthMonthsYearDays PeriodFilterfromEPFEPFEnumerablePeriodFilterfromFPFFPFFilterablePeriodFilterfromSPFSPFSelectablePeriodFilterData.Time.Moment.MomentMoment#Data.Time.CalendarTime.CalendarTimecalendarTimeZonecalendarYearDaycalendarWeekDay calendarYear calendarMonth calendarDay calendarHourcalendarMinutecalendarSecond CalendarTimeData.Time.Calendar.MonthJanuaryFebruaryMarchAprilMayJuneJulyAugust SeptemberOctoberNovemberDecemberMonthData.Time.Calendar.WeekDayMondayTuesday WednesdayThursdayFridaySaturdaySundayWeekDayData.Time.Recurrence.AndThen>==>AndThen gameSettingsjoinGame leaveGame proposeRule TimedEvent$fOrdLoggedGame$fEqLoggedGame enactEventenactTimedEventevalTimedEvent outputPlayerinputChoiceResultinputStringResult createRule systemAddRule$fOrdPlayerInfo