Indigo Clay Demo #1 - CLOS Implementation

indigo> pcl
GCL (GNU Common Lisp)  Version(2.2) Wed Jan 22 09:55:53 EST 1997
Licensed under GNU Public Library License
Contains Enhancements by W. Schelter

>(in-package "pcl" )
#<"PCL" package>

PCL>( load "../clay/clay.l" )
T

PCL>( load "../green/greenclay.l" )
T

PCL>( load "../red/redclay.l" )
T

PCL>( load "../blue/blueclay.l" )
T

PCL>( load "indigoclay.l" )
T

PCL>( run ( new-indigo-clay ) )

indigo> quote.
It is a characteristic of wisdom not to do desparate things.

   - Henry David Thoreua
      

indigo> quote2.
Do not become attached to the things you like, 
do not maintain aversion to the things you dislike. 
Sorrow, fear and bondage come from one's likes
and dislikes. 

   - Buddha
      
To understand is to invent.  

   - Jean Piaget
      

indigo> q(4) = quote2, quote2.

indigo> q(4).

We shall not cease from exploration 
And the end of all our exploring
Will be to arrive where we started
And know the place for the first time.

   - T. S. Eliot
      
It is a characteristic of wisdom not to do desparate things.

   - Henry David Thoreua
      
To understand is to invent.  

   - Jean Piaget
      

We shall not cease from exploration 
And the end of all our exploring
Will be to arrive where we started
And know the place for the first time.

   - T. S. Eliot
      

indigo> sigma.
indigo: command? q(4)
8

indigo> sigma-x.
indigo: command? q(4)

   command set is { q(4) }
   command set length is 1

   command set commands are ...
   q(4) = quote2, quote2.

   lengths are (2)
   triangular values are (3)

   factor1 is 5 (5 times the command set length)
   factor2 is 3 (the sum of the triangular numbers)

   sigma is 8

indigo> z = q(4), quote.

indigo> sigma-x
.
indigo: command? z

   command set is { z q(4) }
   command set length is 2

   command set commands are ...
   z = q(4), quote.
   q(4) = quote2, quote2.

   lengths are (2 2)
   triangular values are (3 3)

   factor1 is 10 (5 times the command set length)
   factor2 is 6 (the sum of the triangular numbers)

   sigma is 16

indigo> load.
domain? melody
Loading /home/blue/public_html/ai/lisp/clos/clay/indigo/domains/melody.l
Loading /home/blue/ai/lisp/clos/blue.l
Finished loading /home/blue/ai/lisp/clos/blue.l
Finished loading /home/blue/public_html/ai/lisp/clos/clay/indigo/domains/melody.l
Lisp melody world loaded.

indigo>melody> help.

melody world
d -- Double the duration of the note.
dot -- Increase by 50% the duration of the note.
h -- Halve the duration of the note.
lp -- Lower the pitch of the note one scale degree.
play -- Render the note sonicly and/or textually and/or graphicly.
quadruple -- Quadruple the duration of the note.
quarter -- Quarter the duration of the note.
rest -- Play the note silently.
rp -- Raise the pitch of the note one scale degree.
third -- Third the duration of the note.
triple -- Triple the duration of the note.
undot -- Decrease by 1/3 the duration of the note.

indigo>melody> boat = m(1), m(2), m(3), m(4).

indigo>melody> unload.
melody world unloaded.

indigo> load.
domain? melody
Loading /home/blue/public_html/ai/lisp/clos/clay/indigo/domains/melody.l
Loading /home/blue/ai/lisp/clos/blue.l
Finished loading /home/blue/ai/lisp/clos/blue.l
Finished loading /home/blue/public_html/ai/lisp/clos/clay/indigo/domains/melody.l
Lisp melody world loaded.

indigo>melody> help.

melody world
d -- Double the duration of the note.
dot -- Increase by 50% the duration of the note.
h -- Halve the duration of the note.
lp -- Lower the pitch of the note one scale degree.
play -- Render the note sonicly and/or textually and/or graphicly.
quadruple -- Quadruple the duration of the note.
quarter -- Quarter the duration of the note.
rest -- Play the note silently.
rp -- Raise the pitch of the note one scale degree.
third -- Third the duration of the note.
triple -- Triple the duration of the note.
undot -- Decrease by 1/3 the duration of the note.

indigo>melody> upper(2) = rp, play2, lp.

indigo>melody> upper(2).
     2  ----
     2  ----

indigo>melody> lower(2) = lp, play2, rp.

indigo>melody> lower(2).
   L 7  ----
   L 7  ----

indigo>melody> figure = upper(2), lower(2), d, play, h.

indigo>melody> figure.
     2  ----
     2  ----
   L 7  ----
   L 7  ----
     1  --------

indigo>melody> display.
indigo: command? figure
figure = upper(2), lower(2), d, play, h.
upper(2) = rp, play2, lp.
lower(2) = lp, play2, rp.


indigo>melody> sigma.
indigo: command? figure
42

indigo>melody> sigma-x.
indigo: command? figure

   command set is { figure upper(2) lower(2) }
   command set length is 3

   command set commands are ...
   figure = upper(2), lower(2), d, play, h.
   upper(2) = rp, play2, lp.
   lower(2) = lp, play2, rp.

   lengths are (5 3 3)
   triangular values are (15 6 6)

   factor1 is 15 (5 times the command set length)
   factor2 is 27 (the sum of the triangular numbers)

   sigma is 42

indigo>melody> tune = figure2, rp2, play, lp, play, lp, play.

indigo>melody> tune.
     2  ----
     2  ----
   L 7  ----
   L 7  ----
     1  --------
     2  ----
     2  ----
   L 7  ----
   L 7  ----
     1  --------
     3  ----
     2  ----
     1  ----

indigo>melody> display.
indigo: command? tune
tune = figure2, rp2, play, lp, play, lp, play.
figure = upper(2), lower(2), d, play, h.
upper(2) = rp, play2, lp.
lower(2) = lp, play2, rp.


indigo>melody> sigma.
indigo: command? tune
75

indigo>melody> sigma-x.
indigo: command? tune

   command set is { tune figure upper(2) lower(2) }
   command set length is 4

   command set commands are ...
   tune = figure2, rp2, play, lp, play, lp, play.
   figure = upper(2), lower(2), d, play, h.
   upper(2) = rp, play2, lp.
   lower(2) = lp, play2, rp.

   lengths are (7 5 3 3)
   triangular values are (28 15 6 6)

   factor1 is 20 (5 times the command set length)
   factor2 is 55 (the sum of the triangular numbers)

   sigma is 75

indigo>melody> monitor.
blue: (reader|parser)? parser


indigo>melody> line = play2, rp2, play2, lp2, play4.
Parsing a Green Clay command.
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "[";  type = LEFT-BRACKET
Green Clay command parse failed.
Parsing a Red Clay command.
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "line";  type = ID
TOKEN...  name = "]";  type = RIGHT-BRACKET
TOKEN...  name = "=";  type = EQUAL-SIGN
Red Clay command parse failed.
Parsing a Indigo Clay command.
TOKEN...  name = "[";  type = LEFT-BRACKET
Parsing a Green Clay command.
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "line";  type = ID
TOKEN...  name = "]";  type = RIGHT-BRACKET
Green Clay command parse succeeded.
GREEN CLAY COMMAND
| line
TOKEN...  name = "=";  type = EQUAL-SIGN
Parsing a Red Clay command.
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "play2";  type = ID
TOKEN...  name = "]";  type = RIGHT-BRACKET
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "rp2";  type = ID
TOKEN...  name = "]";  type = RIGHT-BRACKET
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "play2";  type = ID
TOKEN...  name = "]";  type = RIGHT-BRACKET
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "lp2";  type = ID
TOKEN...  name = "]";  type = RIGHT-BRACKET
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "play4";  type = ID
TOKEN...  name = "]";  type = RIGHT-BRACKET
TOKEN...  name = "]";  type = RIGHT-BRACKET
Red Clay command parse succeeded.
RED CLAY COMMAND
| GREEN CLAY COMMAND
| | play2
| GREEN CLAY COMMAND
| | rp2
| GREEN CLAY COMMAND
| | play2
| GREEN CLAY COMMAND
| | lp2
| GREEN CLAY COMMAND
| | play4
TOKEN...  name = "]";  type = RIGHT-BRACKET
Indigo Clay command parse succeeded.
INDIGO CLAY COMMAND
| line
| RED CLAY COMMAND
| | GREEN CLAY COMMAND
| | | play2
| | GREEN CLAY COMMAND
| | | rp2
| | GREEN CLAY COMMAND
| | | play2
| | GREEN CLAY COMMAND
| | | lp2
| | GREEN CLAY COMMAND
| | | play4

indigo>melody> line.
Parsing a Green Clay command.
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "line";  type = ID
TOKEN...  name = "]";  type = RIGHT-BRACKET
Green Clay command parse succeeded.
GREEN CLAY COMMAND
| line
     1  ----
     1  ----
     3  ----
     3  ----
     1  ----
     1  ----
     1  ----
     1  ----

indigo>melody> unmonitor.
Parsing a Green Clay command.
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "unmonitor";  type = ID
TOKEN...  name = "]";  type = RIGHT-BRACKET
Green Clay command parse succeeded.
GREEN CLAY COMMAND
| unmonitor

indigo>melody> monitor.
blue: (reader|parser)? reader


indigo>melody> playrp = play, rp.
Natural input line ...
playrp = play, rp.
Formal input line ...
[ [ playrp ] = [ [ play ] [ rp ] ] ]
Expanded input line ...
[ [ playrp ] = [ [ play ] [ rp ] ] ]
Tokenized input line ...
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "playrp";  type = ID
TOKEN...  name = "]";  type = RIGHT-BRACKET
TOKEN...  name = "=";  type = EQUAL-SIGN
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "play";  type = ID
TOKEN...  name = "]";  type = RIGHT-BRACKET
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "rp";  type = ID
TOKEN...  name = "]";  type = RIGHT-BRACKET
TOKEN...  name = "]";  type = RIGHT-BRACKET
TOKEN...  name = "]";  type = RIGHT-BRACKET


indigo>melody> upscale = playrp7, play.
Natural input line ...
upscale = playrp7, play.
Formal input line ...
[ [ upscale ] = [ [ playrp7 ] [ play ] ] ]
Expanded input line ...
[ [ upscale ] = [ [ playrp7 ] [ play ] ] ]
Tokenized input line ...
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "upscale";  type = ID
TOKEN...  name = "]";  type = RIGHT-BRACKET
TOKEN...  name = "=";  type = EQUAL-SIGN
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "playrp7";  type = ID
TOKEN...  name = "]";  type = RIGHT-BRACKET
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "play";  type = ID
TOKEN...  name = "]";  type = RIGHT-BRACKET
TOKEN...  name = "]";  type = RIGHT-BRACKET
TOKEN...  name = "]";  type = RIGHT-BRACKET


indigo>melody> upscale.
Natural input line ...
upscale.
Formal input line ...
[ upscale ]
Expanded input line ...
[ upscale ]
Tokenized input line ...
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "upscale";  type = ID
TOKEN...  name = "]";  type = RIGHT-BRACKET

     1  ----
     2  ----
     3  ----
     4  ----
     5  ----
     6  ----
     7  ----
   H 1  ----

indigo>melody> sigma.
Natural input line ...
sigma.
Formal input line ...
[ sigma ]
Expanded input line ...
[ sigma ]
Tokenized input line ...
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "sigma";  type = ID
TOKEN...  name = "]";  type = RIGHT-BRACKET

indigo: command? upscale
16

indigo>melody> unmonitor.
Natural input line ...
unmonitor.
Formal input line ...
[ unmonitor ]
Expanded input line ...
[ unmonitor ]
Tokenized input line ...
TOKEN...  name = "[";  type = LEFT-BRACKET
TOKEN...  name = "unmonitor";  type = ID
TOKEN...  name = "]";  type = RIGHT-BRACKET


indigo>melody> sigma-x.
indigo: command? upscale

   command set is { upscale playrp }
   command set length is 2

   command set commands are ...
   upscale = playrp7, play.
   playrp = play, rp.

   lengths are (2 2)
   triangular values are (3 3)

   factor1 is 10 (5 times the command set length)
   factor2 is 6 (the sum of the triangular numbers)

   sigma is 16

indigo>melody> unload.
melody world unloaded.

indigo> stop.
NIL

PCL>

Craig Graci
Last modified: Sun Mar 2 20:58:17 EST 1997