include "lib.java.cd"; package scg; import java.lang.reflect.*; FullyQualifiedClassName = ident List(Qualifier). Qualifier = "." ident. // Domain interface DomainI = . interface InstanceI = . interface SolutionI = . interface InstanceSetI = . //Wrappers for instance, solution, instanceSet Instance = FullyQualifiedClassName InstanceI verbatim. InstanceSet = FullyQualifiedClassName InstanceSetI verbatim. Solution = FullyQualifiedClassName SolutionI verbatim. // Claims Claim = InstanceSet FullyQualifiedClassName ProtocolI double. interface ProtocolI = . ProtocolSpec = List(Step). Step = Action "from" Role . Role = Alice | Bob. Alice = "Alice". Bob = "Bob". 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" Instance Option(Claim). ProposeResponse = "propose" List(Claim). OpposeResponse = "oppose" List(OpposeAction). OpposeAction = NoOpposition | Strengthening | Refuting. NoOpposition = "no" "opposition". Strengthening = "strengthening" double. Refuting = "refuting". ProvideResponse = "provide" Instance. SolveResponse = "solve" Instance.