(@problem 1)
;; Constants:
(define MAX-SLOTS-PER-TA 3) ;this is the max number of labs a TA can work
;; Data definiKons:
(@htdd Slot)
(define-struct slot (lab n))
;; Slot is (make-slot String Natural)
;; interp. the name of a lab - "A", "B", etc.
;; the lab's slot number - 1, 2, 3 etc.
;; A given lab can have mulKple slots, each slot
;; should have a unique number in that lab.
;;
(define SLOTS1
(list (make-slot "A" 1) (make-slot "A" 2) ;A needs 2 TAs
(make-slot "B" 1) ;B needs 1
(make-slot "C" 1) (make-slot "C" 2))) ;C needs 2
(@htdd TA)
(define-struct ta (name avail))
;; TA is (make-ta String (listof String))
;; interp. A TA with their name and the labs names they are free to work.
(define TAS1
(list (make-ta "Ali" (list "A" "B"))
(make-ta "Ari" (list "B" "C"))
(make-ta "Azi" (list "A" "C"))))
(@htdd Node)
(define-struct node (assignments slots))
;; Node is (make-node (listof (listof String)) (listof Slot))
;; interp. the list of assignments
;; remaining list of slots
(define N1 (make-node empty (list (make-slot "A" 1)
(make-slot "B" 1)
(make-slot "C" 1))))
(@htdf solve)
(@signature (listof Slot) (listof TA) -> (listof (listof String)) or false)
;; Constants:
(define MAX-SLOTS-PER-TA 3) ;this is the max number of labs a TA can work
;; Data definiKons:
(@htdd Slot)
(define-struct slot (lab n))
;; Slot is (make-slot String Natural)
;; interp. the name of a lab - "A", "B", etc.
;; the lab's slot number - 1, 2, 3 etc.
;; A given lab can have mulKple slots, each slot
;; should have a unique number in that lab.
;;
(define SLOTS1
(list (make-slot "A" 1) (make-slot "A" 2) ;A needs 2 TAs
(make-slot "B" 1) ;B needs 1
(make-slot "C" 1) (make-slot "C" 2))) ;C needs 2
(@htdd TA)
(define-struct ta (name avail))
;; TA is (make-ta String (listof String))
;; interp. A TA with their name and the labs names they are free to work.
(define TAS1
(list (make-ta "Ali" (list "A" "B"))
(make-ta "Ari" (list "B" "C"))
(make-ta "Azi" (list "A" "C"))))
(@htdd Node)
(define-struct node (assignments slots))
;; Node is (make-node (listof (listof String)) (listof Slot))
;; interp. the list of assignments
;; remaining list of slots
(define N1 (make-node empty (list (make-slot "A" 1)
(make-slot "B" 1)
(make-slot "C" 1))))
(@htdf solve)
(@signature (listof Slot) (listof TA) -> (listof (listof String)) or false)