include "lib.java.cd"; package scg; nogen RWrap(T) = FullyQualifiedClassName verbatim. FullyQualifiedClassName = ident DSLOI. DSLOI = DSCOI | DSEOI. DSCOI = "." ident DSLOI. DSEOI = . // Domain interface DomainI = . interface InstanceI = . interface SolutionI = . interface InstanceSetI = . // Claims Claim = RWrap(InstanceSetI) RWrap(ProtocolI) double. // Protocols interface ProtocolI = . ProtocolSpec = List(Step). Step = Action "from" Role . interface Role = Alice | Bob. Alice = "Alice". Bob = "Bob". interface Action = ProvideAction | SolveAction. //can only provide for the claim ProvideAction = "instance". //solve the instance provided in step # stepNo //step # -1 for the singleton instance in claim // stepNo is 0-based SolveAction = "solution" "of" int. //Requests and Transactions PlayerRequest = "request[" Request "]". Request = ProposeRequest | OpposeRequest | ProvideRequest | SolveRequest. PlayerResponse = "transaction[" Response "]". Response = ProposeResponse | OpposeResponse | ProvideResponse | SolveResponse. //In a turn, only one proposeRequest and one OpposeRequest are passed to the avatar ProposeRequest = "propose" List(Claim). OpposeRequest = "oppose" List(Claim). ProvideRequest = "provide" Claim. SolveRequest = "solve" RWrap(InstanceI) Option(Claim). ProposeResponse = "propose" List(Claim). OpposeResponse = "oppose" List(OpposeAction). OpposeAction = NoOpposition | Strengthening | Refuting. NoOpposition = "no" "opposition". Strengthening = "strengthening" double. Refuting = "refuting". ProvideResponse = "provide" RWrap(InstanceI). SolveResponse = "solve" RWrap(SolutionI). //config common to all games SCGConfig = "scg_config[" *l*t "tournamentStyle:" *s TournamentStyle *l*t "turnDuration:" *s int // number of seconds *l*t "maxNumAvatars:" *s int // per tournament *l*t "minStrengthening:" *s double // minimum amount of strengthening by a strengthening oppose *l*t "initialReputation:" *s double // initial reputation of an avatar *l*t "maxReputation:" *s double // maximum reputation a scholar can reach // game ends when reached *l*t "reputationFactor:" *s double // a number in [0,1] used to determine reputation gain // upon successful defense of own claim or // upon successful refutation of claim of another scholar. *l*t "minProposals:" *s int *l*t "maxProposals:" *s int // scholars must stay active, but not too active *l*t "numRounds:" *s int // the number of rounds for a tournament *l*t "proposedClaimMustBeNew:" *s boolean // proposed claims must be different from previously proposed claims *l "]". TournamentStyle = FullRoundRobin | KnockOut | SwissStyleTournament. FullRoundRobin = "full" "round-robin". KnockOut = "knockout". SwissStyleTournament = "swiss". interface DomainConfigI = . //config definitions Config = SCGConfig RWrap(DomainConfigI). //baby avatar definitions interface AvatarI = .