-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtree-intf.rkt
51 lines (39 loc) · 1.82 KB
/
tree-intf.rkt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#lang racket
;; ---------------------------------------------------------------------------------------------------
;; interface specification for an Acquire game tree: creating, navigating, and inspecting
(require "basics.rkt" "board.rkt" "state.rkt" "Lib/contract.rkt")
(interface tree&
(tree? (-> any/c boolean?))
(decision-tree?
;; is this a tree where decisions can be made?
(-> tree? boolean?))
(generate-tree
;; generate a game tree starting from this state
(-> state? tree?))
(tree-state
;; all branches in a tree must start from the same state
(-> tree? state?))
(tree-next
;; given a tile placement, optional hotel, and shares to buy plus a way to select the hand out tile
;; navigate to the next subtree of this decision tree,
(-> decision-tree?
tile?
(maybe/c hotel?)
;; we should check that the hotels in the following list are acquired in this move
(listof (list/c player? (listof (list/c hotel? boolean?))))
shares-order/c
;; NOTE: an alternative to a choice function is to fix the list of tile order once and for all
(->i ([lot (listof tile?)]) (one-of-them (lot) (and/c tile? (lambda (x) (member x lot)))))
;; -- yields --
(values tile? tree?)))
(tree-founding
;; how many founding transitions are three in ct up to depth n
(-> tree? natural-number/c policies/c natural-number/c))
(tree-merging
;; how many merging transitions are three in ct up to depth n
(-> tree? natural-number/c policies/c natural-number/c)))
;; ---------------------------------------------------------------------------------------------------
;; auxiliary notions
;; I'd like to do this but I can't yet:
;; (define query/c (-> tree? natural-number/c policies natural-number/c))
(define policies/c (listof shares-order/c))