;A      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                             ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @  Safe-Inferred ABCDEF ABCDEFNone 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 List of indices to select List of elements IList composed of elements selected from original set by indices provided     None The state of the game: %informations on players +the status of a rule. /)An informationnal structure about a rule < Return type of a rule function. + it can be either nothing or another rule. ?Type of a rule function. X!data associated with each events q events names  events types stores the variable's data )a container for a variable name and type >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{|}~GHIJKLMNOPQRSTUVW !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~~x}|{zyqwvutsrkponmlejihgfXca_][Ydb`^\ZUWVNOPQRSTMLEFGHIJK@ABCD?<>=9;:/012345678+.-,)*%&'( !"#$]  !"#$%&'()*+.-,/ 0123456789;:<>=?@ABCDEFGHIJKLMNOPQRSTUWVX ca_][Ydb`^\Zejihgfkponmlqwvutsrx}|{zy~GHIJKLMNOPQRSTUVWNone,OArrayVar is an indexed array with a signal attached triggered at every change. 7 | each indexed elements starts empty (value=Nothing). variable creation variable reading variable writing .modify a variable using the provided function delete variable 4get the messsage triggered when the array is filled get the association array initialize an empty ArrayVar \initialize an empty ArrayVar, registering a callback that will be triggered at every change 6initialize an empty ArrayVar, registering a callback. ( the ArrayVar will be deleted when full qstore one value and the given index. If this is the last filled element, the registered callbacks are triggered.  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 0%the same, disregard the event number 1Atriggers a choice input to the user, using an enumerate as input 2%the same, disregard the event number 31the same, suppress the event after first trigger 6Mtriggers a string input to the user. The result will be sent to the callback 7Oasks the player pn to answer a question, and feed the callback with this data. 8Oasks the player pn to answer a question, and feed the callback with this data. Fget all the players GGet a specific player HSet the name of a player ISet the name of a player K=Get the total number of playersgetPlayersNumber :: Nomex Int LGet all the players number M'Remove the player from the game (kick) N outputs a message to one player Y!set victory to a list of players Zgive victory to one player \Iallows a rule to retrieve its own number (for auto-deleting for example) ca default rule       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcX      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abc      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abc      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcXNone d4This rule will activate automatically any new rule. eCThis 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 fA rule will be always illegal gAactive 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 hactivate or reject a rule iLperform an action for each current players, new players and leaving players j@perform the same action for each players, including new players k,create a value initialized for each players $manages players joining and leaving l@create a value initialized for each players initialized to zero $manages players joining and leaving p&Player p cannot propose anymore rules qLa rule can autodelete itself (generaly after having performed some actions) r$All rules from player p are erased: defghijklmnopqrsdefghijklmnopqrsdefghijklmnopqrsdefghijklmnopqrsNoneuevaluate an expression. M The rule number passed is the number of the rule containing the expression. tuvwxyz{|}~tuvwxyz{|}~tuvwxyz{|}~tuvwxyz{|}~NonePerform a vote. =Performs a vote, all the possible alternatives are selected. assess 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 xassess the vote with the assess function when time is reached, and sends a signal with the issue (positive of negative) xassess the vote with the assess function when time is elapsed, and sends a signal with the issue (positive of negative) massess the vote only when every body voted. An error is generated if the assessing function returns Nothing. 2clean events and variables necessary for the vote Ia quorum is the neccessary number of voters for the validity of the vote 'adds a quorum to an assessing function Gassess the vote results according to a unanimity (everybody votes for) fassess the vote results according to an absolute majority (half voters plus one, no quorum is needed) <assess the vote results according to a majority of x (in %) Jassess the vote results according to a necessary number of positive votes 6return the vote alternatives that are above threshold 7number of people that voted if the voting is finished, 3 total number of people that should vote otherwise Dany new rule will be activate if the rule in parameter returns True ?&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. YZ[\]^?_`abcd9.YZ[\]^NoneA rule that does nothing &A rule that says hello to all players account variable name and type 'Create a bank account for each players &Permanently display the bank accounts  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 3a player wins X Ecu if a rule proposed is accepted .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 delete a rule Bplayer pn is the king: we create a variable King to identify him,  and we prefix his name with King @Monarchy: only the king decides which rules to accept or reject Revolution! Hail to the king! g This rule suppresses the democracy (usually rules 1 and 2), installs the king and activates monarchy. >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 <display a button and greets you when pressed (for player 1) ef ghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVef NoneD      !"#$%&'D      !"#$%&'D      !"#$%&'@      !"#$%&' Noneghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUV  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~_`abcd NoneWinitialize the game. Xjoin the game. Yleave the game. Z insert a rule in pending rules. <:A helper function to use the state transformer GameState. ( It additionally sets the current time. *()*+,-./01234[\5]^67_`a89:WXYZbc;<=>?@defg efghij()*+,-./0123456789:;<=>?@ ,43210/.-89()*+675<=: ;>?@ejihgf()*+,43210/.-[\5]^67_`a89:WXYZbc;<=>?@defgh   !!"#$$%&'()*+,-.//012234567789:;<=>?@A@BCDEFFGHIJJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmn_opqrstuvwxyz{|}~uwxz      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                        ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_]^`]ab]ac]ad]^e]^f]^g]^h]^i]^j]kl]km]^n]^o]kp]kq]ar]st]su]sv]sw]sx]sy]sz]s{]s|]s}]s~]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]s]k]k]k]k]k]k]k]k]k]k]k]k]k]k]k]k]k]k]k]k]k]k]k]k]k]k]k]k]k]k]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a]a                                        ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 56 78 79 7: 7; 7< 7= 7> 7? 7@ 7A 7A BC BD BE BF BG BH BI BJ BK BL BM BN BO PQ PR PS PT PU PV PW PX YZ Y[ \ ] ^ _ ` ` a b c d e f g h i j klNomyx-Language-0.3.1Paths_Nomyx_LanguageLanguage.Nomyx.UtilsLanguage.Nomyx.ExpressionLanguage.Nomyx.DefinitionLanguage.Nomyx.RuleLanguage.Nomyx.EvaluationLanguage.Nomyx.VoteLanguage.Nomyx.ExamplesLanguage.Nomyx.TestLanguage.Nomyx.GameLanguage.Nomyxversion getBinDir getLibDir getDataDir getLibexecDir getSysconfDirgetDataFileNameoneWeekoneDayoneHour oneMinute=== replaceWithtracePN traceData mapMaybeM parse822TimesndMaybe mapStateIO getFreeNumberselGameDesc_desc_agoraGame _gameName _gameDesc_rules_players _variables_events_outputs_victory_logs _currentTime PlayerInfo _playerNumber _playerName SubmitRule RuleStatusRejectPendingActiveRule_rNumber_rName _rDescription _rProposedBy _rRuleCode _rRuleFunc_rStatus _rAssessedByBoolRespMsgRespRuleRespMetaVoidRuleFuncLog_lPlayerNumber_lTime_lMsgOutput _outputNumber _oRuleNumber_oPlayerNumber_output_oStatusMsgDataMsg EventHandlerEH _eventNumber _ruleNumbereventhandler _evStatusStatusSDeletedSActive EventData VictoryData victoryData InputData inputData MessageData messageDataTimeDatatimeDataRuleDataruleData PlayerData playerData UInputData UButtonData UTextAreaData UTextData UCheckboxData URadioData ButtonData TextAreaDataTextData CheckboxData RadioDataEventVictoryInputEvMessageTimeRuleEvPlayer InputFormCheckboxButtonTextAreaTextRadioInputEvRule RuleEventDeletedModifiedAddedRejected ActivatedProposedLeaveArriveVar _vRuleNumber_vNamevDataVvarNameNomex CatchError ThrowErrorBindReturnSelfRuleNumber CurrentTime SetVictory DelOutput UpdateOutput NewOutput DelPlayer SetPlayerName GetPlayersGetRules ModifyRuleAddRule RejectRule ActivateRule ProposeRule SendMessage DelAllEventsDelEventOnEventDelVarWriteVarReadVarNewVar OutputNumberCodeGameNameVarName EventName EventNumberRuleCodeRuleTextRuleDescRuleName RuleNumber PlayerName PlayerNumber displayGamegameNamegameDescrulesplayers variableseventsoutputsvictorylogs currentTimedescagorarNumberrName rDescription rProposedBy rRuleCode rRuleFuncrStatus rAssessedBy playerNumber playerName eventNumber ruleNumberevStatus vRuleNumbervName outputNumber oRuleNumber oPlayerNumberoutputoStatusArrayVarMsgVarVEventVDeletedVUpdatednewVarnewVar_readVarreadVar_writeVar writeVar_ modifyVardelVardelVar_msgVar newMsgVar newMsgVar_ newMsgVar' writeMsgVar writeMsgVar_ readMsgVar readMsgVar_ modifyMsgVar delMsgVaronMsgVarChange onMsgVarEventgetMsgVarMessage getMsgVarDatagetMsgVarData_ getMsgVarName newArrayVar newArrayVar_ newArrayVar'newArrayVarOnce cleanOnFullisFullArrayVar_ putArrayVar putArrayVar_onEventonEvent_ onEventOnce onEventOnce_delEvent delEvent_ delAllEvents sendMessage sendMessage_ onMessage onMessageOncescheduleexecuteAndScheduleNext schedule_ schedule'executeAndScheduleNext' schedule'_ activateRule activateRule_ rejectRule rejectRule_getRulesgetActiveRulesgetRulegetRulesByNumbers getRuleFuncsaddRuleaddRule_ addRuleParamsgetFreeRuleNumber suppressRule suppressRule_suppressAllRules modifyRule inputRadioinputRadioHeadinputRadioEnuminputRadioData onInputRadio onInputRadio_onInputRadioOnceonInputRadioOnce_onInputRadioEnumonInputRadioEnum_onInputRadioEnumOnce_ inputText inputTextData onInputText onInputText_onInputTextOnce_inputCheckboxData inputCheckboxonInputCheckboxonInputCheckbox_inputButtonData inputButton onInputButtononInputButton_inputTextareaData inputTextareaonInputTextareaonInputTextarea_onInputTextareaOnce_ getPlayers getPlayer getPlayerName setPlayerNamemodifyPlayerNamegetPlayersNumbergetAllPlayerNumbers delPlayer newOutput newOutput_ outputAll updateOutput updateOutput_ delOutput delOutput_ displayVardisplaySimpleVardisplayArrayVar showArrayVar setVictory giveVictorygetCurrentTimegetSelfRuleNumber getSelfRulegetSelfProposedByPlayervoidRule andMsgBool andMsgMsgpartial defaultRule autoActivatelegalillegal maybeMetaRuleactivateOrReject forEachPlayerforEachPlayer_createValueForEachPlayercreateValueForEachPlayer_getValueOfPlayermodifyValueOfPlayermodifyAllValues noPlayPlayer autoDelete eraseAllRules showPlayerEvaluateevalExp triggerEventtriggerHandler triggerEvent_ errorHandler triggerInputexecInputHandler findEventgetChoiceEvents evProposeRuleevActivateRule evRejectRule evAddRule evModifyRule addPlayer evDelPlayer evChangeName evDelEvent evTriggerTime delVarsRule delEventsRule evNewOutputevUpdateOutput evDelOutput logPlayerlogAlllog runEvalErrorElection ReferendumAssessorVoteDatamsgEndvoteVar inputNumbersassessFunction VoteStats voteCounts voteFinished VoteResultVote ForAgainstVotableAltsaltsquotanameexclusiveWinnerVoteTypeNonExclusiveVote ExclusiveVotevoteWith voteWith_assessOnEveryVoteassessOnTimeLimitassessOnTimeDelayassessWhenEverybodyVoted cleanVotequorum withQuorum unanimitymajority majorityWith numberVotes voteQuotaexclusiveVoteQuotanbVoters totalVotersnotVotedvoted getVoteStatscountsdisplayVoteVar showChoice showChoices showVotes showVotes'displayVoteResultonRuleProposed referendum electionsnothing helloWorldaccountscreateBankAccountdisplayBankAccount winXEcuPerDaywinXEcuOnRuleAccepted moneyTransferdelRulemakeKingkingmonarchy revolution victoryXRules victoryXEcu displayTimenoGroupVictoryiWinvoteWithMajorityreturnToDemocracy banPlayerreferendumOnKickPlayergameMasterElections gameMaster bravoButton enterHaikuChoice2YouMeChoiceSarkozyHollanddate1date2date3testGametestRule evalRuleFuncexecRuleFuncEventexecRuleFuncGameexecRuleFuncEventGame execRuleFunctestsallTeststestVar1 testVarEx1testVar2 testVarEx2testVar3 testVarEx3testVar4 testVarEx4testVar5 testVarEx5testSingleInputtestSingleInputExtestMultipleInputstestMultipleInputsExtestInputStringtestInputStringExtestSendMessagetestSendMessageExtestSendMessage2testSendMessageEx2testUserInputWritetestUserInputWriteExtestActivateRuletestActivateRuleExtestAutoActivateEx testTimeEventtestTimeEventExtestTimeEvent2testTimeEventEx2voteGameActions voteGame'voteGame voteGameTimedtestVoteAssessOnVoteComplete1testVoteAssessOnVoteComplete2testVoteAssessOnEveryVote1testVoteAssessOnEveryVote2testVoteAssessOnEveryVote3testVoteAssessOnEveryVote4testVoteMajorityWithtestVoteNumberPositiveVotestestVoteWithQuorum1testVoteWithQuorum2testVoteAssessOnTimeLimit1testVoteAssessOnTimeLimit2testVoteAssessOnTimeLimit3testVoteAssessOnTimeLimit4testVoteAssessOnTimeLimit5 testVoteRuleisOutput LoggedGame_game_gameLog GameEvent SystemAddRule TimeEventGLog InputResult ProposeRuleEv LeaveGameJoinGame GameSettings emptyGamegamegameLogupdateupdate' getLoggedGamegetTimes execWithGame execWithGame' activeRules pendingRules rejectedRulescatchIObindirlibdirdatadir libexecdir sysconfdir $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 candidateNoYesAgainstFormakeGMdisplayPlayerAccountbaseGHC.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 enactEventenactTimedEvent updateErrorlogGame inputResult createRule systemAddRule stateCatch$fOrdPlayerInfo