// incomplete - compare with administrator/player package gen; import java.io.FileInputStream; import edu.neu.ccs.demeterf.lib.*; nogen List(X) = Cons(X) | Empty(X). nogen Cons(X) = X List(X). nogen Empty(X) = . nogen Option(X)= Some(X) | None(X). nogen Some(X) = X. nogen None(X) = . Outcome = String. Value = "VAL". Predicate = "pred" String. Belief = "belief" Predicate float. // Alice believes that she can give a problem satisfying predicate to Bob // so that Bob cannot satisfy fraction. // If Bob accepts he believes the opposite: he will be able to satisfy fraction or more. // The game will determine who is right. Challenge = "challenge" "[" String Price Belief "]". // Predicate Option(RawMaterial) Option(FinishedProduct)"]". QualifiedProblem = "problem" "[" Predicate Problem "]". // RawMaterial = "rm" "[" Predicate RawMaterialInstance "]". Problem = String. SolvedProblem = "solved" "[" QualifiedProblem Outcome Quality "]". // FinishedProduct = "finish" "[" RawMaterial Outcome Quality "]". Price = double. Quality = double. History = "history" "[" List(Round) "]". Round = "round""["List(PlayerTransaction)"]". PlayerTransaction = String List(Transaction). Transaction = TransactionType Challenge. TransactionType = Buy|Create|Reoffer|Deliver|Finish. Buy = "BUY". Create = "CREATE". Reoffer = "REOFFER". Deliver = "DELIVER". Finish = "FINISH". // Main Game structures SCG = "SCG" "players" List(Player) "accounts" List(Pair(PlayerID,Double)) "store" List(Pair(PlayerID,PlayerStore)) "config" Config. Player = "player" PlayerID String. PlayerStore = "pstore" List(Challenge) List(BoughtDeriv). BoughtDeriv = "bought" Challenge PlayerID Option(QualifiedProblem) Option(SolvedProblem). Config = double int int double. // Helper classes Pair(A,B) = A B. PlayerID = int.