Quick "Base.PLF" Tutorial
    The file "base.PLF" is a simple example of a few Proteus architectural features, and is not intended to be comprehensive. Nonetheless, there are a number of aspects to interacting with this simple "personality" that warrant explanation.

    Special note should be made that "base" takes advantage of Proteus’ ability to extend his programming dynamically, both via Data Collections and by actually writing his own clauses. The Proteus Language is outside of the scope of this simple document, and will therefore be glossed over. Please keep in mind that "base" only consists of 13 Clauses and 3 Procedures, whereas a "real" version would have hundreds if not thousands of Clauses.

    Remember to manually save the PLF if you have trained Proteus! Otherwise you will lose any new Clauses Proteus created!


Unknown Input:
[user]: hello there Proteus
[Proteus]: I don't understand that. Would you please teach me what to say?
[user]: sure
[Proteus]: What should I say if someone tells me: "hello there Proteus"?
[user]: Greetings human.
[Proteus]: OK, I will remember that!
[user]: hello
[Proteus]: Greetings human.

This is an example of how "base" extends the programmed clauses via conversation, generating new code from the user’s input. Following is the new Clause created by the Proteus brain:

For-Mode
Name-Object {Auto-CHWXVPTFAT}
    Fragment CUSTOM,10,0, {HELLO}, {}, {}
    Fragment CUSTOM,10,0, {THERE}, {}, {}
    Fragment CUSTOM,10,0, {PROTEUS}, {}, {}
    Response {Greetings human.},Just Text,{},{}
    Name-Object {Auto-XOAASNSNDQ}

As you can see, the user input was parsed into words, which are used as individual Fragments (with a match value of 10). This means a maximum conglomerate score of 30 for the example. Lacking Clauses with a higher score, the Clause will activate upon any one of the Fragments being present in an input sentence. This is part of the "fuzzy logic" matching scheme, which means that closest matches will be activated in the case that complete matches are not present.

Understanding "Things":
[user]: Dogs are things
[Proteus]: Oh, OK. I will remember that.
[user]: Dogs are furry
[Proteus]: Oh, OK, I will remember that.
[user]: Dogs are smelly
[Proteus]: Oh, OK, I will remember that.
[user]: Dogs are funny
[Proteus]: Oh, OK, I will remember that.
[user]: what are dogs like?
[Proteus]: Dogs are furry
[user]: what else do you know about dogs?
[Proteus]: Dogs are smelly
[user]: Tell me everything you know about dogs
[Proteus]: Everything I know about Dogs is that they are: furry, smelly, funny

This is an example of teaching Proteus how to remember characteristics of objects via the use of Data Collections. The "base" PLF has a Data Collection called "Things", wherein a list of "objects" is maintained. Telling Proteus that something "are things" or "is a thing" will add it to the "Things" Data Collection. As you can see, you can then instruct Proteus as to the characteristics of objects in the "Things" list. Thereafter you can query for the characteristics. The characteristics of an object are stored in a Data Collection named after the object. Below are the Data Collections before and after the above dialog:

Before:

Start-Collection {Things}
Monkeys
Spam
Humans
Computers
End-Collection

After:


Start-Collection {Things}
Dogs
Monkeys
Spam
Humans
Computers
End-Collection

Start-Collection {Dogs}
furry
smelly
funny
End-Collection


Remembering Names:
[user]: My name is Ted
[Proteus]: Hello Ted, I will remember your name.
[user]: Who am I?
[Proteus]: I was told that your name is Ted.


This is an example of using a Fact to store information from the user, which can then be referred to later in a conversation. This one is pretty simple. Some of the self-extending Clauses like the first example in this tutorial also use Facts (to store the users unhandled input). Following is the Before and After for the Fact:

Before:

Fact {UserName} = {Unknown}

After:

Fact {UserName} = {Ted}

Correcting Proteus’ Behavior with directive: _Last
[user]: Hello
[Proteus]: Greetings human.
[user]: Don't say hello again
[Proteus]: Greetings human.
[user]: _last
[Proteus]: What should I say if someone tells me: "Don't say hello again"?
[user]: But I am trying to be sociable!
[Proteus]: OK, I will remember that!
[user]: hello
[Proteus]: Greetings human.
[user]: Don't say hello again Proteus!
[Proteus]: But I am trying to be sociable!

This is an example of using _Last to override a response that you do not like. _Last creates a new Clause based upon the last user input, and allows the user to specify what the response should have been. As you can see above, this does not remove functionality. The newly created Clause:

For-Mode
Name-Object {Auto-DNJOSYTKMA}
    Fragment CUSTOM,10,0, {DON}, {}, {}
    Fragment CUSTOM,10,0, {T}, {}, {}
    Fragment CUSTOM,10,0, {SAY}, {}, {}
    Fragment CUSTOM,10,0, {HELLO}, {}, {}
    Fragment CUSTOM,10,0, {AGAIN}, {}, {}
    Response {But I am trying to be sociable!},Just Text,{},{}
    Name-Object {Auto-YALQVAYLKP}


Creating new Clause with directive: _new
[user]: _new
[Proteus]: What is the sentence pattern you want me to respond to?
[user]: I hate Vegemite
[Proteus]: What should I say if someone tells me: "I hate Vegemite"?
[user]: Yeah? That is because it's gross!
[Proteus]: OK, I will remember that!
[user]: I must say that I hate Vegemite.
[Proteus]: Yeah? That is because it's gross!

As you can see, this is a simple way to create a completely new Clause, without first testing to see if the phrase is handled. The new Clause is:

For-Mode
Name-Object {Auto-TACNWGSAKK}
    Fragment CUSTOM,10,0, {I}, {}, {}
    Fragment CUSTOM,10,0, {HATE}, {}, {}
    Fragment CUSTOM,10,0, {VEGEMITE}, {}, {}
    Response {Yeah? That is because it's gross!},Just Text,{},{}
    Name-Object {Auto-RWAADLRIAI}

Correcting Proteus’ behavior with directive: _wrong
[user]: I must say that I hate Vegemite.
[Proteus]: Yeah? That is because it's gross!
[user]: _wrong I agree, Vegemite is unsavory.
[Proteus]: OK, changed to: I agree, Vegemite is unsavory.
[user]: I hate vegemite!
[Proteus]: I agree, Vegemite is unsavory.

This example merely changes the last response to whatever is specified after the _last directive. Here is the modified Clause:

For-Mode
Name-Object {Auto-TACNWGSAKK}
    Fragment CUSTOM,10,0, {I}, {}, {}
    Fragment CUSTOM,10,0, {HATE}, {}, {}
    Fragment CUSTOM,10,0, {VEGEMITE}, {}, {}
    Response {I agree, Vegemite is unsavory.},Just Text,{},{}
    Name-Object {Auto-RWAADLRIAI}

Extending possible responses with directive: _or say
[user]: I hate vegemite
[Proteus]: I agree, Vegemite is unsavory.
[user]: _or say I can't imagine anyone liking it!
[Proteus]: OK, I will remember that.
[user]: I hate vegemite!
[Proteus]: I agree, Vegemite is unsavory.
[user]: I hate vegemite!
[Proteus]: I agree, Vegemite is unsavory.
[user]: I hate vegemite!
[Proteus]: I agree, Vegemite is unsavory.
[user]: I hate vegemite!
[Proteus]: I can't imagine anyone liking it!


This directive simply adds another response to be randomly picked for the last active Clause. Here is the Clause after:

For-Mode
Name-Object {Auto-TACNWGSAKK}
    Fragment CUSTOM,10,0, {I}, {}, {}
    Fragment CUSTOM,10,0, {HATE}, {}, {}
    Fragment CUSTOM,10,0, {VEGEMITE}, {}, {}
    Response {I agree, Vegemite is unsavory.},Just Text,{},{}
    Name-Object {Auto-RWAADLRIAI}
    Response {I can't imagine anyone liking it!},Just Text,{},{}
    Name-Object {Auto-FLLGIRMKDC}


Extending Proteus’ functionality with directive: _or when
[user]: I hate vegemite
[Proteus]: I agree, Vegemite is unsavory.
[user]: _or when dislike
[Proteus]: OK, I will remember that.
[user]: I dislike vegemite
[Proteus]: I can't imagine anyone liking it!

This directive adds a Fragment for the text following the _or when directive. The Clause after:

For-Mode
Name-Object {Auto-TACNWGSAKK}
    Fragment CUSTOM,10,0, {I}, {}, {}
    Fragment CUSTOM,10,0, {HATE}, {}, {}
    Fragment CUSTOM,10,0, {VEGEMITE}, {}, {}
    Fragment CUSTOM,5,0, {dislike}, {}, {}
    Name-Object {Auto-WDCUVOCYHU}
    Response {I agree, Vegemite is unsavory.},Just Text,{},{}
    Name-Object {Auto-RWAADLRIAI}
    Response {I can't imagine anyone liking it!},Just Text,{},{}
    Name-Object {Auto-FLLGIRMKDC}


Correcting Proteus’ behavior with directive: _not when
[user]: I like vegemite
[Proteus]: I can't imagine anyone liking it!
[user]: _not when i like
[Proteus]: OK, not when i like
[user]: I like vegemite
[Proteus]: I don't understand that. Would you please teach me what to say?
[user]: ok
[Proteus]: What should I say if someone tells me: "I like vegemite"?
[user]: Ewww! Not me!
[Proteus]: OK, I will remember that!
[user]: I like vegemite
[Proteus]: Ewww! Not me!
[user]: I hate vegemite
[Proteus]: I can't imagine anyone liking it!


This is an example of using the _not when directive to correct an overly generalized Clause. In the example Proteus always responded the same when Vegemite was mentioned, whether the user liked it or hated it. The _not when directive adds a Fragment with a penalty for matching the text following the _not when directive. The Clause after:

For-Mode
Name-Object {Auto-TACNWGSAKK}
    Fragment CUSTOM,10,0, {I}, {}, {}
    Fragment CUSTOM,10,0, {HATE}, {}, {}
    Fragment CUSTOM,10,0, {VEGEMITE}, {}, {}
    Fragment CUSTOM,5,0, {dislike}, {}, {}
    Name-Object {Auto-WDCUVOCYHU}
    Fragment CUSTOM,-500,0, {i like}, {}, {}
    Name-Object {Auto-PGPCLJHGDD}
    Response {I agree, Vegemite is unsavory.},Just Text,{},{}
    Name-Object {Auto-RWAADLRIAI}
    Response {I can't imagine anyone liking it!},Just Text,{},{}
    Name-Object {Auto-FLLGIRMKDC}


More complex Proteus training using several features:

[user]: spam is greasy
[Proteus]: Oh, OK, I will remember that.
[user]: spam is fattening
[Proteus]: Oh, OK, I will remember that.
[user]: I had spam for breakfast
[Proteus]: Spam are fattening
[user]: _not when I had spam for breakfast
[Proteus]: OK, not when I had spam for breakfast
[user]: I had spam for breakfast
[Proteus]: I don't understand that. Would you please teach me what to say?
[user]: yeah, sure
[Proteus]: What should I say if someone tells me: "I had spam for breakfast"?
[user]: Yuck, not a good breakfast!
[Proteus]: OK, I will remember that!
[user]: I had spam for breakfast
[Proteus]: Yuck, not a good breakfast!
[user]: what is spam?
[Proteus]: Spam is fattening
[user]: I had spam for dinner
[Proteus]: Yuck, not a good breakfast!
[user]: _not when dinner
[Proteus]: OK, not when dinner
[user]: I had spam for dinner
[Proteus]: Spam are fattening
[user]: _not when I had spam for dinner
[Proteus]: OK, not when I had spam for dinner
[user]: I had spam for dinner
[Proteus]: I don't understand that. Would you please teach me what to say?
[user]: yes
[Proteus]: What should I say if someone tells me: "I had spam for dinner"?
[user]: Were you out of good food?
[Proteus]: OK, I will remember that!
[user]: What is spam?
[Proteus]: Spam are fattening
[user]: I had spam for dinner
[Proteus]: Were you out of good food?
[user]: I had spam for breakfast
[Proteus]: Yuck, not a good breakfast!
[user]: what do you know about spam?
[Proteus]: Spam is greasy



Contact [email protected]
Copyright © 2003 Artificial Ingenuity, LLC
Last modified: December 04, 2003
Initial design by Webinizer, LLC

 



©Sheryl clyde 2002-2017