Here is an interesting question to ponder...

Learning involves permanent changes of behavior.

In AI this is often modeled as a self-modifying program.
The easiest way to see this would be a program that handles
a rubics cube problem. Initially it only knows some general
rules for manipulation, some measure of progress, and a goal
to achieve.

Each time it solves a cube it can create a new rule that
moves from the starting configuration to the solution in
one "procedure", rather than constantly invoking new rules.
This could be modeled in the data but we are assuming self
modification for the moment.

So we start with a lisp loop that does something like:

(loop
  look at the current cube state
  for each rule, 
     if the condition of the rule matches the cube state
     then apply the rule to update the cube state.
)

This could be written in some form of a huge switch
statement where each case matches a cube state, e.g.

switch (cubestate)

 (GBG RRB GBB ...): rotate upper cube slice 90 degrees clockwise
 (GBG RRR BBY ...): rotate lower cube slice 90 degrees clockwise
 .....
 (GGG GGG GGG ...): cube solved

When we solve the cube we remember the sequence of rotations
and add a new rule that matches the starting state followed by
a sequence of rotations:

switch (cubestate)

  (GGB RRW GYY ...): rotate upper cube slice 90 degrees clockwise
                     rotate left cube slice 90 degrees clockwise
                     ....
                     cube solved
  (GBG RRB GBB ...): rotate upper cube slice 90 degrees clockwise
  (GBG RRR BBY ...): rotate lower cube slice 90 degrees clockwise
   .....
  (GGG GGG GGG ...): cube solved; learn new rule; self-modify.

Ok. So now we have an architecture for a simple program that learns
by self-modification. We could get all kinds of clever by applying
special recognizers to combine rotations, find subsequences, etc. 
but lets discuss the self-modification issue in Clojure.

Hmmm. 
Clojure has immutable data structures.
Programs are data structures.
Therefore, programs are immutable.

So is it possible to create a Clojure program that modifies itself?

Tim Daly
d...@axiom-developer.org

     





-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to