RLAI Reinforcement Learning and Artificial Intelligence (RLAI)

tiny-crystal project part 3: connection and path primitives in lookup

Extend your read-only tiny crystal to include non-virtual versions of the basic connection-making names connect and connect-from.  Implement these as scheme procedures that are called from the lookup procedure you wrote in part 2.  Brief descriptions of the functions of these basic crystal names can be found on pages 2 and 3 of the crystal vocabulary notes, but remember that here in tiny crystal we are using their fixed-length forms, as in:

(connect '(a b c) 7)
and
(connect-from (x y) '(a b c) 7)

Then similarly implement the path-changing primitives push-path and pop-path.

Hints:

Convert connects to connect-froms to that you only need to implement one of them.

Don't worry about virtual connections (that's for the next part of the project).

#|
testing

(driver-loop)
(connect '(x) 5)
(connect '(y) 7)
(x)
(connect '(ship) (new))
(push-path (ship))
(connect '(x) 12)
(connect '(y) 13)
()
(ship)
(pop-path)
()
|#


Changes since Nov 15:

In class Jeremy suggested that these crystal primitives could be treated just like the other scheme primitives, like + or display.  That would be a very clean way to implement this, if it is possible.


Extend this Page   How to edit   Style   Subscribe   Notify   Suggest   Help   This open web page hosted at the University of Alberta.   Terms of use  612/0