Loading ...
Sorry, an error occurred while loading the content.

Autonomic email client?

Expand Messages
  • Mike Beedle
    I just realized after I sent my previous message, that I had made a mistake in the English of my first sentence. Rats! Perhaps it was inspired by the many
    Message 1 of 9 , Nov 29, 2001
    • 0 Attachment
      I just realized after I sent my previous message, that I had
      made a mistake in the English of my first sentence. Rats!
      Perhaps it was inspired by the many spelling and grammar mistakes
      that the web page I gave out has:
      http://www-1.ibm.com/servers/eserver/introducing/eliza/

      In retrospect, I think this might be an opportunity ... (grin)

      Suppose my email client was autonomic. And that while I was
      writing my ugly email message, it would try to correct my
      mistakes. What would it take for my email client
      to be autonomic?

      1) it would have to analyze what I type as I go, say
      after I place a dot
      2) then it would have to parse the sentence,
      3) test it,
      4) find mistakes,
      5) make suggestions (or simply make corrections) and
      6) take the chosen solution and assign it

      Let's assume that my message was simply:

      "Just thought this might be interested to some:

      IBM is spending _billions_ of dollars in developing
      hardware/software systems that resemble living organisms
      http://www-1.ibm.com/servers/eserver/introducing/eliza/

      - Mike"

      As I type this message we can use the English parser
      that Richard talked about at the Feyerabend workshop
      at OOPSLA, and make it construct a hierarchy of
      s-expressions on the fly when the dot in a sentence
      is typed:

      (sentence (noun "I") (verb "thought") etc. )

      Then the method "analyze-me" on the sentence class
      is called from where GrEliza, short for
      "Gramatical Eliza" is used. (Richard: what language
      is the English parser you talked about at OOPSLA coded in?)

      GrEliza is an program that for every mistake found,
      evaluates possibilities to find the words that can be
      assumed correct in the original mistaken sentence and
      suggests corrections, which of course are tested by the
      parser. For example, when the parser finds
      out that "interested" was the wrong word in:

      "Just thought this might be interested to some"

      it then suggests (or corrects?):

      "I just thought this might be interesting to some"

      but when it assumes that "this" and "some" were misplaced, it
      might suggest something like:

      "Just thought that some might be interested in this"

      If there are many solutions the user is then offered
      the possibilities, chooses one, the choice gets assigned
      and the user then moves on to writing more. If there
      is only one solution or a very strong solution, the
      solution is simply chosen.

      We could write GrEliza getting some inspiration from Eliza,
      after all, Eliza picks up words from the input and then
      constructs questions after it sends them through a filter
      or analyzer.

      If this was cumbersome -- stopping and correcting as we move
      on, we could wait until we press the "send" button.

      However, this would require to build an hierarchy of
      s-expressions as we type, something like (for simplicity
      I am going to stop at the sentence level):

      (message "m1"
      (paragraph "p1"
      (sentence (id "s1")
      (value "Just thought this might be interested to
      some:")
      (status "wrong"))

      (sentence (id "s2")
      (value "IBM is spending _billions_ of dollars in
      developing
      hardware/software systems that resemble living
      organisms")
      (status "right"))

      (url (id "u1")
      (value
      "http://www-1.ibm.com/servers/eserver/introducing/eliza/")
      (status "right"))

      (signature (id "g1")
      (value "- Mike")
      (status "right")))

      This corresponds to an instance of the class "message" filled
      with a hash-table of paragraphs, which in turn has a hash-table
      of sentences, ... and hashtables all the way down as it parses
      the English (as above). This of course is equivalent to
      an object model with the hash-table holding slots on
      the object instances. With parser and a MOP we can
      convert s-expressions into object instances. As the
      parser parses sentences, each sentence is validated and
      marked appropriately waiting for the "send" button to
      get pressed to make corrections.

      An analyzer can then traverse a "built as we type" object
      tree using reflection to find out all the "wrong"
      sentences. And again, the "sentence" class can call
      the method "analyze-me", repeating the process suggested
      above, but only now at the time when the "send" button is
      pressed.

      At OOPSLA 2 years ago, we had a workshop on pattern languages,
      again with Richard, Ron and Joshua; where we set out to write
      an pattern language for writing emails. Perhaps we can
      continue our exercise with the goal to make our
      email client more organic/autonomic i.e. follow a biological
      metaphor for "self-repair"?


      - Mike

      Just for inspiration, this is the best Eliza I know
      (runs well even under Hugs98 ~ Haskell with some cripplings):

      -- Eliza: an implementation of the classic
      pseudo-psychoanalyst ---------------
      --
      -- Gofer version by Mark P. Jones, January 12 1992.
      -- Modified for Hugs 1.3, August 1996.
      --
      -- Adapted from a pascal implementation provided as part of an experimental
      -- package from James Risner (risner@...), Univ. of KY. with original
      -- pascal code apparently provided by Robert Migliaccio (mig@...).
      ----------------------------------------------------------------------------
      ---

      module Eliza where

      import Interact

      eliza = interact (writeStr hi $ session initial [])
      where hi = "\n\
      \Hi! I'm Eliza. I am your personal therapy computer.\n\
      \Please tell me your problem.\n\
      \\n"

      -- Read a line at a time, and produce some kind of
      response -------------------

      session rs prev
      = readLine "> " (\l ->
      let ws = words (trim l)
      (response,rs') = if prev==ws then repeated rs else answer rs ws
      in writeStr (response ++ "\n\n") $ session rs' ws)

      trim :: String -> String -- strip punctuation
      characters
      trim = foldr cons "" . dropWhile (`elem` punct)
      where x `cons` xs | x `elem` punct && null xs = []
      | otherwise = x : xs
      punct = [' ', '.', '!', '?', ',']

      answer :: State -> Words -> (String, State)
      answer st l = (response, newKeyTab kt st)
      where (response, kt) = ans (keyTabOf st)
      e `cons` (r, es) = (r, e:es)
      ans (e:es) | null rs = e `cons` ans es
      | otherwise = (makeResponse a (head rs), (key,as):es)
      where rs = replies key l
      (key,(a:as)) = e

      -- Find all possible replies (without leading string for given
      key ------------

      replies :: Words -> Words -> [String]
      replies key l = ( map (conjug l . drop (length key))
      . filter (prefix key . map ucase)
      . netails) l

      prefix :: Eq a => [a] -> [a] -> Bool
      [] `prefix` xs = True
      (x:xs) `prefix` [] = False
      (x:xs) `prefix` (y:ys) = x==y && (xs `prefix` ys)

      netails :: [a] -> [[a]] -- non-empty tails of list
      netails [] = []
      netails xs = xs : netails (tail xs)

      ucase :: String -> String -- map string to upper case
      ucase = map toUpper

      -- Replace keywords in a list of words with appropriate
      conjugations ----------

      conjug :: Words -> Words -> String
      conjug d = unwords . trailingI . map conj . maybe d -- d is default
      input
      where maybe d xs = if null xs then d else xs
      conj w = head ([m | (w',m)<-conjugates, uw==w'] ++
      [w])
      where uw = ucase w
      trailingI = foldr cons []
      where x `cons` xs | x=="I" && null xs =
      ["me"]
      | otherwise =
      x:xs

      conjugates :: [(Word, Word)]
      conjugates = prepare (oneways ++ concat [[(x,y), (y,x)] | (x,y) <-
      bothways])
      where oneways = [ ("me", "you") ]
      bothways = [ ("are", "am"), ("we're", "was"),
      ("you", "I"), ("your", "my"),
      ("I've", "you've"), ("I'm", "you're") ]
      prepare = map (\(w,r) -> (ucase w, r))

      -- Response
      data --------------------------------------------------------------

      type Word = String
      type Words = [Word]
      type KeyTable = [(Key, Replies)]
      type Replies = [String]
      type State = (KeyTable, Replies)
      type Key = Words

      repeated :: State -> (String, State)
      repeated (kt, (r:rp)) = (r, (kt, rp))

      newKeyTab :: KeyTable -> State -> State
      newKeyTab kt' (kt, rp) = (kt', rp)

      keyTabOf :: State -> KeyTable
      keyTabOf (kt, rp) = kt

      makeResponse :: String -> String -> String
      makeResponse ('?':cs) us = cs ++ " " ++ us ++ "?"
      makeResponse ('.':cs) us = cs ++ " " ++ us ++ "."
      makeResponse cs us = cs

      initial :: State
      initial = ([(words k, cycle rs) | (k,rs) <-respMsgs], cycle repeatMsgs)

      repeatMsgs = [ "Why did you repeat yourself?",
      "Do you expect a different answer by repeating yourself?",
      "Come, come, elucidate your thoughts.",
      "Please don't repeat yourself!" ]

      respMsgs = [ ("CAN YOU", canYou),
      ("CAN I", canI),
      ("YOU ARE", youAre),
      ("YOU'RE", youAre),
      ("I DON'T", iDont),
      ("I FEEL", iFeel),
      ("WHY DON'T YOU", whyDont),
      ("WHY CAN'T I", whyCant),
      ("ARE YOU", areYou),
      ("I CAN'T", iCant),
      ("I AM", iAm),
      ("I'M", iAm),
      ("YOU", you),
      ("YES", yes),
      ("NO", no),
      ("COMPUTER", computer),
      ("COMPUTERS", computer),
      ("I WANT", iWant),
      ("WHAT", question),
      ("HOW", question),
      ("WHO", question),
      ("WHERE", question),
      ("WHEN", question),
      ("WHY", question),
      ("NAME", name),
      ("BECAUSE", because),
      ("CAUSE", because),
      ("SORRY", sorry),
      ("DREAM", dream),
      ("DREAMS", dream),
      ("HI", hello),
      ("HELLO", hello),
      ("MAYBE", maybe),
      ("YOUR", your),
      ("ALWAYS", always),
      ("THINK", think),
      ("ALIKE", alike),
      ("FRIEND", friend),
      ("FRIENDS", friend),
      ("", nokeyMsgs) ]
      where
      canYou = [ "?Don't you believe that I can",
      "?Perhaps you would like to be able to",
      "?You want me to be able to" ]
      canI = [ "?Perhaps you don't want to",
      "?Do you want to be able to" ]
      youAre = [ "?What makes you think I am",
      "?Does it please you to believe I am",
      "?Perhaps you would like to be",
      "?Do you sometimes wish you were" ]
      iDont = [ "?Don't you really",
      "?Why don't you",
      "?Do you wish to be able to",
      "Does that trouble you?" ]
      iFeel = [ "Tell me more about such feelings.",
      "?Do you often feel",
      "?Do you enjoy feeling" ]
      whyDont = [ "?Do you really believe I don't",
      ".Perhaps in good time I will",
      "?Do you want me to" ]
      whyCant = [ "?Do you think you should be able to",
      "?Why can't you" ]
      areYou = [ "?Why are you interested in whether or not I am",
      "?Would you prefer if I were not",
      "?Perhaps in your fantasies I am" ]
      iCant = [ "?How do you know you can't",
      "Have you tried?",
      "?Perhaps you can now" ]
      iAm = [ "?Did you come to me because you are",
      "?How long have you been",
      "?Do you believe it is normal to be",
      "?Do you enjoy being" ]
      you = [ "We were discussing you --not me.",
      "?Oh,",
      "You're not really talking about me, are you?" ]
      yes = [ "You seem quite positive.",
      "Are you Sure?",
      "I see.",
      "I understand." ]
      no = [ "Are you saying no just to be negative?",
      "You are being a bit negative.",
      "Why not?",
      "Are you sure?",
      "Why no?" ]
      computer = [ "Do computers worry you?",
      "Are you talking about me in particular?",
      "Are you frightened by machines?",
      "Why do you mention computers?",
      "What do you think machines have to do with your problems?",
      "Don't you think computers can help people?",
      "What is it about machines that worries you?" ]
      iWant = [ "?Why do you want",
      "?What would it mean to you if you got",
      "?Suppose you got",
      "?What if you never got",
      ".I sometimes also want" ]
      question = [ "Why do you ask?",
      "Does that question interest you?",
      "What answer would please you the most?",
      "What do you think?",
      "Are such questions on your mind often?",
      "What is it that you really want to know?",
      "Have you asked anyone else?",
      "Have you asked such questions before?",
      "What else comes to mind when you ask that?" ]
      name = [ "Names don't interest me.",
      "I don't care about names --please go on." ]
      because = [ "Is that the real reason?",
      "Don't any other reasons come to mind?",
      "Does that reason explain anything else?",
      "What other reasons might there be?" ]
      sorry = [ "Please don't apologise!",
      "Apologies are not necessary.",
      "What feelings do you have when you apologise?",
      "Don't be so defensive!" ]
      dream = [ "What does that dream suggest to you?",
      "Do you dream often?",
      "What persons appear in your dreams?",
      "Are you disturbed by your dreams?" ]
      hello = [ "How do you...please state your problem." ]
      maybe = [ "You don't seem quite certain.",
      "Why the uncertain tone?",
      "Can't you be more positive?",
      "You aren't sure?",
      "Don't you know?" ]
      your = [ "?Why are you concerned about my",
      "?What about your own" ]
      always = [ "Can you think of a specific example?",
      "When?",
      "What are you thinking of?",
      "Really, always?" ]
      think = [ "Do you really think so?",
      "?But you are not sure you",
      "?Do you doubt you" ]
      alike = [ "In what way?",
      "What resemblence do you see?",
      "What does the similarity suggest to you?",
      "What other connections do you see?",
      "Cound there really be some connection?",
      "How?" ]
      friend = [ "Why do you bring up the topic of friends?",
      "Do your friends worry you?",
      "Do your friends pick on you?",
      "Are you sure you have any friends?",
      "Do you impose on your friends?",
      "Perhaps your love for friends worries you." ]

      nokeyMsgs = [ "I'm not sure I understand you fully.",
      "What does that suggest to you?",
      "I see.",
      "Can you elaborate on that?",
      "Say, do you have any psychological problems?" ]

      ----------------------------------------------------------------------------
      --
    • Joseph Bergin
      ... There are two other ways 4) Make it highly tailorable by the user. 5) Make it smart enough to learn from its mistakes. If you tell it it fouled up it won t
      Message 2 of 9 , Nov 29, 2001
      • 0 Attachment
        At 8:58 AM -0600 11/29/01, David V. Olivier wrote:
        >Just to play the devil's advocate for the moment, don't you ever get
        >frustrated with "smart" applications that aren't quite smart enough.
        >I certainly have this experience with Microsoft Word and other
        >products that think they know what I want to do. There are two
        >directions one could go with this:
        >
        >1) Make the product "really smart", but I think anything
        >sophisticated enough to really, fully understand the structure of
        >human conversation is a ways off.
        >
        >2) Keep it simple. There's something to be said for lightweight
        >applications that don't meddle too much. Assume the user is as
        >smart as they need to be and give them simple tools to get the job
        >done with a minimum of complexity. In response to your example (I
        >realize its just an example, but let's follow it a bit), much of the
        >strength of e-mail communication is that it is so simple. Quick,
        >rapid-fire (but grammatically "incorrect) messages can be sent in a
        >moment more closely representing verbal conversation than standard
        >written documents. They are an effective form of communication but
        >can be difficult if not impossible to parse.
        >
        >3) Of course there's always the option of just letting the user turn
        >off the parser if they don't like it.
        >
        >Whatever you do, just don't make it an animated paperclip.

        There are two other ways

        4) Make it highly tailorable by the user.

        5) Make it smart enough to learn from its mistakes. If you tell it it
        fouled up it won't do that anymore.

        Both of these are probably doable now.

        Joe
        --
        Joseph Bergin, Professor
        Pace University, Computer Science, One Pace Plaza, NY NY 10038
        EMAIL berginf@...
        HOMEPAGE http://csis.pace.edu/~bergin/
      • Mike Beedle
        ... David, Joe: Good points. In retrospect, and even though I think the autonomic email client is a very intuitive example to play with the ideas, it
        Message 3 of 9 , Nov 29, 2001
        • 0 Attachment
          David V. Olivier wrote:
          > Just to play the devil's advocate for the moment, don't you
          > ever get frustrated with "smart" applications that aren't
          > quite smart enough. I certainly have this experience
          > with Microsoft Word and other products that think they
          > know what I want to do. There are two directions one
          > could go with this:
          >
          > 1) Make the product "really smart", but I think
          > anything sophisticated enough to really, fully
          > understand the structure of human conversation is a
          > ways off.
          >
          > 2) Keep it simple. There's something to be said for
          > lightweight applications that don't meddle too much.
          > Assume the user is as smart as they need to be and give
          > them simple tools to get the job done with a
          > minimum of complexity. In response to your example
          > (I realize its just an example, but let's follow it a bit),
          > much of the strength of e-mail communication is that it
          > is so simple. Quick, rapid-fire (but grammatically
          > "incorrect) messages can be sent in a moment more closely
          > representing verbal conversation than standard written documents.
          > They are an effective form of communication but can
          > be difficult if not impossible to parse.
          >
          > 3) Of course there's always the option of just letting
          > the user turn off the parser if they don't like it.
          >
          > Whatever you do, just don't make it an animated paperclip.

          Joe Bergin added:
          > 4) Make it highly tailorable by the user.
          >
          > 5) Make it smart enough to learn from its
          > mistakes. If you tell it it fouled up it won't
          > do that anymore.

          David, Joe:

          Good points. In retrospect, and even though I think
          the "autonomic email client" is a very intuitive
          example to play with the ideas, it actually may not
          be the best place where one may want to implement
          an autonomic system. (I always turn off the paperclip!)

          But then, what are the systems where the autonomic system
          concept is a better fit? Is there a better, but still
          intuitive application that might be better to look at
          or work on?

          - Mike
        • Pascal Costanza
          ... A single person might have a good idea, but this idea needs to spread in order to have a significant effect. That s true. But there s another point
          Message 4 of 9 , Dec 3, 2001
          • 0 Attachment
            dcymbala@... wrote:
            >
            > Hi everyone, new in the group,
            > but very interested in what is going on.
            >
            > --- In feyerabend-project@y...,
            > --- Pascal Costanza <costanza@c...> wrote:
            >

            > > This all reminds me of some comments
            > > by Friedrich Dürrenmatt (my most
            > > favorite author) he has written
            > > about his play "The Physicists" (from
            > > 1962). In "21 Punkte zu den Physikern"
            > > (21 points to the physicists) he
            > > writes (among other things)
            > > "what concerns all, can only be solved by
            > > all" and "each individual attempt to solve
            > > isolated, what concerns all,
            > > must fail". (Another quote in the same
            > > vein is "what once has been
            > > thought, cannot be unthought".)
            > > IMHO, there really is a truth in what he
            > > says.
            >
            > Now this is a very interesting angle on
            > the whole issue. I think that some study
            > of distributed systems in general would
            > show that when each member of the group
            > works using the same very simple principles,
            > powerful emergent behavior arises that can
            > be helpful to all involved. Many biological
            > systems illustrate this point. Perhaps a
            > single person simply cannot just have a good
            > thought and do something that helps everyone
            > because a single person is not able to be
            > the thought in everyone's mind that makes the
            > whole system behave like an integrated
            > distributed system. Linux started small,
            > but has grown because the right ideas were
            > spread widely and kept feeding the system as
            > a whole.
            >
            > -David

            A single person might have a good idea, but this idea needs to spread in
            order to have a significant effect. That's true. But there's another
            point involved here.

            There is a certain class of ideas that, to me, always sound like "if
            only the whole world would act like this, everyone would be much better
            off" - and this class of ideas can never work, at least in my opinion.

            For example, some extreme variants of type systems in programming
            languages look to me like this. However, in practice you always have the
            problem of connecting your own little piece of software to other
            libraries/components/whatever, with different assumptions about type
            systems, or even without any type system at all. So at some stage, every
            programming language has to deal with it, and for this reason, must
            break some of its assumptions. Now, wouldn't it be better, if the whole
            world would use a single programming language? Couldn't we then just do
            away with this problem?

            No, we couldn't. And my main point here is, that this is not due to some
            inherent problems of type systems, or programming languages or the like,
            but _only_ because it is an "improve the whole world" argument, and
            these arguments don't work by definition (IMHO, I don't have a proof for
            this conjecture). Such arguments are based on the assumption that a
            single person (or a group of persons) understands much more and a much
            greater scope than what happens (and what is important) in their own
            special circumstances. Human beings are not capable of that.

            Therefore, "each individual attempt to solve isolated what concerns all,
            must fail". (Still not correct english here, but I am working on it...
            ;)

            Pascal


            P.S.: At the last OOPSLA Feyerabend workshop I stated that I don't care
            for "humanity", and this is just because of this reasoning. Note that I
            didn't mean that I don't care for humanity (without quotes).

            --
            ----------------------> Extended Deadline <----------------------
            ... for the Second German Workshop on AOSD: December 10, 2001 ...
            http://i44w3.info.uni-karlsruhe.de/~pulvermu/workshops/aosd2002/

            Pascal Costanza Email: costanza@...
            University of Bonn Roemerstr. 164
            Institute of Computer Science III D-53117 Bonn (Germany)

            Fon: +49 (0)228 73-4505 Homepage:
            Fax: +49 (0)228 73-4382 http://www.pascalcostanza.de
          • David Cymbala
            Hi Pascal, ... On this point we are in complete agreement. The misguided notion that a specific idea or practice should be universally adopted tends to fall on
            Message 5 of 9 , Dec 3, 2001
            • 0 Attachment
              Hi Pascal,

              > There is a certain class of ideas that, to me, always sound like "if
              > only the whole world would act like this, everyone would be much better
              > off" - and this class of ideas can never work, at least in my opinion.

              On this point we are in complete agreement.
              The misguided notion that a specific idea or
              practice should be universally adopted tends
              to fall on its face. Even beyond all the vested
              interests we encounter, such ideas usually are
              based on short-sighted thinking of some kind.
              Based on observations of both genetics and
              neural networks, the system needs to have
              two critcal elements: Noise and Feedback.
              The necessary variation (noise) is present
              such that the common reinforcements (feedback)
              walk through a vast state space, eventually
              arriving at a configuation that serves the greater
              whole. It would seem that this borders on
              ideas about learning, but learning as a group
              (e.g. a genome, or a community).

              > For example, some extreme variants of type systems in programming
              > languages look to me like this. However, in practice you always have the
              > problem of connecting your own little piece of software to other
              > libraries/components/whatever, with different assumptions about type
              > systems, or even without any type system at all. So at some stage, every
              > programming language has to deal with it, and for this reason, must
              > break some of its assumptions. Now, wouldn't it be better, if the whole
              > world would use a single programming language? Couldn't we then just do
              > away with this problem?
              >
              > No, we couldn't. And my main point here is, that this is not due to some
              > inherent problems of type systems, or programming languages or the like,
              > but _only_ because it is an "improve the whole world" argument, and
              > these arguments don't work by definition (IMHO, I don't have a proof for
              > this conjecture). Such arguments are based on the assumption that a
              > single person (or a group of persons) understands much more and a much
              > greater scope than what happens (and what is important) in their own
              > special circumstances. Human beings are not capable of that.

              Again, total agreement. Perhaps that is why we organize
              into societies and so forth, so that we can solve certain
              dilemmas of life through collective effort, even though
              individual success might be limited.

              > Therefore, "each individual attempt to solve isolated what concerns all,
              > must fail". (Still not correct english here, but I am working on it...
              > ;)

              Perhaps another way to say it is:

              "Isolated individual attempts to solve issues concerning everyone must fail."

              Like a single node in a neural network being so heavily
              weighted that it singlehandedly determines the result.
              Not very effective. :-)

              -David
            Your message has been successfully submitted and would be delivered to recipients shortly.