package scg.gen; import scg.Util; import scg.game.*; import edu.neu.ccs.demeterf.lib.*; PlayerID = int implements Comparable(PlayerID). Var = ident implements Comparable(Var). // Using the new ListMap, instead // this is CSP specific !!! Solution = ListMap(Var,Boolean). // change: depends on protocol ChallengeKind = All | Secret. All = "all". Secret = "secret". // Challenge -> Claim // Offered -> Proposed Claim = ProposedClaim | AcceptedClaim // Provided means: Claim with provided instance | ProvidedClaim | SolvedClaim *s int *s PlayerID *s // change: refer to Claim definition ProblemType *s // change to quality double *s // change: link to claim set definition ChallengeKind "]". ProposedClaim = "proposed[". AcceptedClaim = "accepted[" PlayerID. ProvidedClaim = "provided[" PlayerID *s Instance. SolvedClaim = "solved[" PlayerID *s Instance *s Solution *s double. Transaction = ProposeTrans | AcceptTrans | StrengthenTrans | ProvideTrans | SolveTrans "]". ProposeTrans = *l*t "offer[" int *s ChallengeKind *s ProblemType *s double. AcceptTrans = *l*t "accept[" int. // change: protocol may use a secret instance ProvideTrans = *l*t "provide[" Instance *s Option(Solution) *s int. SolveTrans = *l*t "solve[" Solution *s int. // change: show strengthened claim // is it enough to change price to quality? StrengthenTrans = *l*t "strengthen[" int *s double. PlayerTrans = *l "playertrans[" *l*t PlayerID List(Transaction) *l "]". Config = "config[" *l*t "gamekind:" *s String *l*t "turnduration:" *s int *l*t "mindecrement:" *s double *l*t "initacc:" *s double *l*t "maxProposals:" *s int *l*t "minProposals:" *s int *l*t "minPropositions:" *s int *l*t "objective:" *s Objective *l*t "predicate:" *s Predicate *l*t "numrounds:" *s int *l*t "profitfactor:" *s double *l*t "otrounds:" *s int *l*t "hasSecrets:" *s boolean // A secretRatio must be 0 if hasSecrets is false // SecretRatio must be in the range [0,1] *l*t "secretRatio:" *s double *l "]". PlayerContext = "context[" *l*t Config *l*t PlayerID *l*t double *l*t int *l*t "(" List(ProposedClaim) ")" *l*t "(" List(ProposedClaim) ")" *l*t "(" List(AcceptedClaim) ")" *l*t "(" List(ProvidedClaim) ")" *l*t "(" List(SolvedClaim) ")" *l*t Option(AccountTransactionList) *l "]" EOF. AccountTransactionList = "(" List(AccountTransaction) ")". AccountTransaction = AccountAcceptTrans | AccountSolveTrans | AccountRefundTrans "." *s "acceptor:" *s int *s "offerer:" *s int *s "]". AccountAcceptTrans = "[acceptor paid" *s double *s "for challenge" *s int. AccountSolveTrans = "[acceptor received" *s double *s "for solving" *s double *s "of challenge" *s int. AccountRefundTrans = "[acceptor refunded" *s double *s "for challenge" *s int.