Artificial Ingenuity, LLC

September 4, 2006


 

Introduction/Overview

    The Proteus technology is a completely proprietary artificial intelligence engine developed by Artificial Ingenuity, LLC. Development of this technology commenced on September 17th of 2002, and has seen seven major revisions as of the date of this document. A basic overview of the applied technologies follows.

    Proteus architecture centers around a "fuzzy logic" based pattern matching system for specific responsive behaviors. The processing model (or "Brain") is not a simple "couplet" or "one-liner" non-contextual system as are many "chat-bot" type designs, nor is it an immense case structure as is well known public domain designs.

    State and contextual knowledge can be modeled in several ways within the Proteus architecture. The "Brain" maintains "State" and "Mode" specific structures, as well as facility for use of discrete facts, and "Collections" which represent classes or collections of information. The fuzzy logic system incorporates facility to reference discrete or abstracted class information, as well as the current Brain State and Mode, from within the behavior determinism functions, allowing unprecedented richness of behavioral models from within a single architecture.

    The design implements "Modes" of operation, which provide completely separate behavioral structures to implement non integrated, or modal, behaviorisms. Meaning different personality of emotional states may be implemented by separate modes of behavior. This feature can further be used to isolate and simplify subject specific interactions, such as for "help-desk", or expert-system style functionality.

    The "State" functionality provides for state specific behaviors within the clauses or predicates of a given behavioral mode. This provides for a simplified topical or behavioral modifier to be made to existing clauses and predicates. This may be utilized to simulate "moods", or topical deviations based upon subject matter.

    All data functions of the Proteus architecture are dynamic, meaning that facts and collections may be updated or added to dynamically as a function of the user's interaction with the knowledge base. This facilitates Proteus learning user specific information, as well as contextual facilities for complex heuristic behavior. This can be used in such fashion to allow Proteus to be taught by interaction, as well as by data insertion. Further, as of version 5.0 self-modifying knowledge bases are supported.

    The current version also supports procedural behavior, as well as decision tree type of expert system functionality. Complicated diagnostic or procedural functionality can be designed as a decision tree within the Proteus knowledge base to facilitate use in business or technical assistant applications. This complements the conversational aspects of the Proteus technology to provide truly usable expert systems. Lastly, there is an interface provided to the OpenMind Commonsense Database of 500,000 facts.


 


 

Fragment types:

1. None
    No value calculated for this fragment.

2. AND
    If the contents of "Word Fragment" are found in the user's input a bonus of 100 points are awarded to the pattern score, if not found then 100 points are deducted from the pattern score. Uses complete word matching.

3. OR
    If the contents of "Word Fragment" are found in the user's input a bonus of 50 points are awarded to the pattern score, if not found then the pattern score is not affected. Uses complete word matching.

4. NOT
    If the contents of "Word Fragment" are found in the user's input 100 points are deducted from the pattern score, if not found then 100 points are added from the pattern score. Uses complete word matching.

5. CUSTOM
    If the contents of "Word Fragment" are found in the user's input a bonus of "Bonus" points are awarded to the pattern score, if not found then "Penalty" points are deducted from the pattern score. Both "Bonus" and "Penalty" may be a positive or negative integer. Uses complete word matching.

6. Data-Match
    If the "Fact" named in "Name" is equal to the value "Value", then a bonus of "Bonus" points are added to the pattern score, if not then "Penalty" points are deducted from the pattern score. Both "Bonus" and "Penalty" may be a positive or negative integer.

7. External
    Executes an external DLL for a match value, which is used in the normal fuzzy logic evaluation to determine the match value for the Pattern the External Fragment is attached to.  The "Bonus" and "Penalty" values for this Fragment are ignored, as the value is supplied by the external DLL function.  The path and file name of the DLL containing the routine to be called is provided in "Word Fragment".  The name of the function in the DLL is specified in "Name".  The input value passed to the DLL function is provided in "Value".  The DLL function should have the following form:

int MyExternalProc (char *StrFromProteus)

or

function MyExternalProc(StrFromProteus: PCHar): integer; stdcall;

8. State-Match
If the current "Brain State" is equal to "Name", then a bonus of "Bonus" points are added to the pattern score, if not then "Penalty" points are deducted from the pattern score. Both "Bonus" and "Penalty" may be a positive or negative integer.

9. In Collection
    If the user's input contains a "Member" of the "Data Collection" named by "Name", then a bonus of "Bonus" points are added to the pattern score, if not then "Penalty" points are deducted from the pattern score. Both "Bonus" and "Penalty" may be a positive or negative integer. Uses complete word matching.

10. Volition
    This fragment type behaves different than the others. There is no value impact to the pattern score when user's input is evaluated. However, if "Volition" is active, then the pattern will be activated according to the fractional value in "Word Fragment". The value can be calculated from one 24 hour day = 1.0, which means the 1 hour = 0.041666, and 1 minute = 0.0006944, and 10 seconds = 0.00011573. This will only occur if the pattern is located within the active "Know-Mode" as indicated by the "Current Mode".

11. Out-Match
    If the contents of "Word Fragment" are found in Proteus's last output a bonus of "Bonus" points are awarded to the pattern score, if not found then "Penalty" points are deducted from the pattern score. Both "Bonus" and "Penalty" may be a positive or negative integer. Uses complete word matching.

12. CUSTOM-Sub
    If the contents of "Word Fragment" are found in the user's input a bonus of "Bonus" points are awarded to the pattern score, if not found then "Penalty" points are deducted from the pattern score. Both "Bonus" and "Penalty" may be a positive or negative integer. Uses sub-pattern matching.

13. In Collection-Sub
    If the user's input contains a "Member" of the "Data Collection" named by "Name", then a bonus of "Bonus" points are added to the pattern score, if not then "Penalty" points are deducted from the pattern score. Both "Bonus" and "Penalty" may be a positive or negative integer. Uses sub-pattern matching.

14. Initialize
    This fragment type behaves different than the membership fragments. There is no value impact to the pattern score when user's input is evaluated. However, when the brain's initialization is invoked the pattern will be activated. This facilitates initial setup actions, such as loading collections from disk, etc.

15. Finalize
    This fragment type behaves different than the membership fragments. There is no value impact to the pattern score when user's input is evaluated. However, when the brain's finalization is invoked the pattern will be activated. This facilitates initial setup actions, such as saving collections to disk, etc.

16. Do-Before
    This fragment type behaves different than the membership fragments. There is no value impact to the pattern score when user's input is evaluated. Any Patterns with this fragment type attached are always processed prior to the user's input being evaluated.  This facilitates behavior common to all input cases, such as creating a log file of user input, etc.  

17. Do-After
    This fragment type behaves different than the membership fragments. There is no value impact to the pattern score when user's input is evaluated. Any Patterns with this fragment type attached are always processed after the user's input has been evaluated and responded to.  This facilitates behavior common to all input cases, such as creating a log file of Proteus responses, etc.  

18. EXTRACT
    The Extract fragment type provides a more elegant solution for extracting information from a specific pattern and assigning the extracted data to "Facts".  If the pattern described by "Word Fragment" matches  the user's input a bonus of "Bonus" points is awarded to the pattern score, if not found then "Penalty" points are deducted from the pattern score. Both "Bonus" and "Penalty" may be a positive or negative integer.  This fragment type uses a  special Token type (^Extr{}) to create the pattern and specify the Fact names in which the user data is to be stored.



 


 

Response/Task types:

1. None
    No response or action is taken.

2. Just Text
    This response type will output the contents if any of "Out Text" to the user.

3. Mode Change
    This response type will output the contents if any of "Out Text" to the user, and will then change the "Current Mode" to the mode indicated by "Name". This will cause all further user input to be evaluated by the "Know-Mode" structure indicated by the new "Current Mode".

4. Nested
    This response type will output the contents if any of "Out Text" to the user, and will then pass the user's input on for processing to the "Know-Mode" structure that exists as a subordinate to this "Response" or "Task".

5. Assignment
    This response type will output the contents if any of "Out Text" to the user, and will then assign the value "Value" to the "Fact" identified by "Name".

6. Action

    This response type will output the contents if any of "Out Text" to the user, and will then execute the external application as specified by the contents of "Name".

7. Reset Hits
    This response type will output the contents if any of "Out Text" to the user, and will then reset to zero the "Hit Count" of the "Pattern" to which it is attached.

8. State Change
    This response type will output the contents if any of "Out Text" to the user, and will then change the "Current State" to the "State" identified by "Name".

9. Reset State
    This response type will output the contents if any of "Out Text" to the user, and will then reset the "Current State" to the default "State".

10. Task List
    This response type will output the contents if any of "Out Text" to the user after having executed the attached list of "Tasks". A task is functionally identical to a response, with the exception that it can not have a list of sub-tasks.

11. Reset KM Hits
    This response type will output the contents if any of "Out Text" to the user, and will then reset to zero the "Hit Count" of all patterns in the current "Know-Mode".

12. Reset Brain Hits
    This response type will output the contents if any of "Out Text" to the user, and will then reset to zero every "Hit Count" residing within the "Brain".

13. Add To Collection
    This response type will output the contents if any of "Out Text" to the user, and will then add the data contained in "Value" to the "Data Collection" identified by "Name". If the "Data Collection" does not exist, then it will be created.

14. Remove From Collection
    This response type will output the contents if any of "Out Text" to the user, and will then remove the data contained in "Value" from the "Data Collection" identified by "Name".

15. Submit This
    This response type will output the contents if any of "Out Text" to the user, and will then submit the contents of "Name" to the "Brain" for a response. This may facilitate chaining several patterns together for complex behavior, and as an associative method of equivalency.

16. Log This
    This response type will output the contents if any of "Out Text" to the user, and will then add the contents of "Value" to a text file identified by the file specification contained in "Name". If the text file does not exist it will be created.

17. Start Proc
    This response type will initiate a "Procedure" identified by "Name", and will begin processing at the specified "Start Step", or the first "Step" in the procedure if a specific starting step override has not been specified.

18. Goto Step
    This response type will jump to the specified "Step" identified by "Name" that exists within the currently executing "Procedure". This response type is meaningless if a procedure is not executing when the response is invoked. When a "Start Proc" response type is invoked, the procedure is automatically started at the default step, therefore invoking "Goto Step" prior to a "Start Proc" is meaningless.

19. Halt Proc
    This response type will terminate any currently executing "procedure", and does not require any specification as that only one procedure may be in operation at any given time. This is the normal method for terminating procedures.

20. Ask OpenMind
    This response type will invoke the "OpenMind" interface, passing the contents of "Name" as a query to the OpenMind Commonsense Database. Any results generated by the OpenMind interface will then be provided to the user. If the "OpenMind" database is not in the default path you may specify the path for Proteus to find "OpenMind" in the "Value" field.

21. Call Proc
    This response type will initiate a "Sub-Procedure" identified by "Name", and will begin processing at the specified "Start Step", or the first "Step" in the procedure if a specific starting step override has not been specified.

22. Proc Return
    This response type will return to the "Procedure" from which the "Sub-Procedure" was called, and will continue at the "Step" from which it was invoked. This response type in conjunction with "Call Proc" above provide facility for nested sub-procedures (to any level), allowing for re-use of common procedural behaviors.

23. Self Modify
    This response type will modify the contents of any object that has been named "Out Text". The specific member of the object is specified by "Name", and the new value is specified by "Value". There is always at least one named object "MyBrain", which allows modification to the brain object itself. The fields for each of the brain object classes are defined following this section, in table A.

24. Load Collection
    This response type will load a Collection from disk, creating it if it did not previously exist. The name is specified in "Name", and the file name and path is specified by "Value".

25. Save Collection
    This response type will save a Collection to disk. The name is specified in "Name", and the file name and path is specified by "Value".

26. Clear Collection
    This response type will clear the contents of the Collection specified by "Name".

27. Parse Collection
    This response type will parse text specified in "OutText" looking for members of the source Collection specified by "Name", and add all such members that are found to the Collection specified by "Value". This is a much more useful function than may be immediately apparent. This facilitates (for example) creating a Collection called "likes pets" by parsing an input string like "I like dogs and cats" using a source Collection called "pets" that contains all known pet types. In the example, a new Collection would be created that contained two members: "Dogs", and "Cats". In addition to the example given, this feature facilitates lexical and semantic analysis.

28. Delete Object
    This response type will remove from the brain any previously named brain object, as specified by "OutText". This is useful for self-modification uses.

29. Make Code
    This response type will execute the "Proteus Language" code found in the Collection specified by "OutText". This facilitates generation of any brain object or feature using the contents of a Collection. This allows Proteus to extend it's own programming.

30. Merge Collection
    This response type adds the contents of the source Collection specified by "Name" to the Collection specified by "Value". It simply appends the source Collection items to the end of the destination Collection, or creates it if it doesn't exist.

31. Do Response For
    This response type executes the responses for the clause (Pattern) specified by "Name", facilitating "sub-routine" type functionality for common tasks. For example, if you want Proteus to always track the current topic, but don't want to add the several steps required for this in every clause of every mode, then just create 1 clause with these steps, name it, and add a "Do Response For" from the other clauses.

32. Words To Collection
    This response type parses the string contained in "OutText" into individual words and places them in the Data Collection specified by "Name".

33. Create AutoPattern
    This response type automatically generates a new Clause (or Pattern) based upon the passed parameters. The contents of "OutText" will be parsed into individual word fragments, given a matching value stored in "Name", and a 'Text Only" Response as stored in "Value". The components of the Clause will be Auto-Named.

34. Add Response
    This response type adds a "Text Only" response to the last Clause used or added, with the text to out put of "OutText". The Response will be Auto-Named.

35. Add Fragment
    This response type adds a Fragment to the last Clause used or added, with a fragment value of "OutText", and a match bonus indicated in "Name".

36. Set Unsorted
    This response type will set the contents of the Collection specified by "Name" to be unsorted.  By default data collection contents are alphanumerically sorted for lookup performance.

37. Set Label
    This task only  type will set a label at the location within the task list, which can then be used as a branch location.  The branching operations then refer to the label name, which is specified by "Name".

38. Goto
    This task only  type will branch the task execution sequence to the label name, which is specified by "Name".  This is an unconditional branch operation

39. BranchIf
    This task only  type will branch the task execution sequence to the label name, which is specified by "Name", if the simple expression specified in "Value" evaluates to true.  The valid expression types are string or numeric evaluation of: "=", "<", ">", "<>" , ">=", "<=".  Examples being: "^Fact{Counter} > 5", or "^Member{Animals}=Dog"

40. CallDLL
    This Response/Task type executes a function in an external DLL, and the string value returned is provided to the Brain as a Fact with the same name as the external function.  The text to be passed to the external DLL is provided in "OutText", the name of the DLL is provided in "Name", and the name of the function within the DLL to be invoked is provided in "Value".  The returned string value will be stored in a Fact with the name of the function specified in "Value".  The external function should return an integer value of the length of the string returned.  The form of the external functions should be:

int MyDLLFunction (char *StrFromProteus, char *StrToBeReturned)

or

function MyDLLFunction(StrFromProteus: PCHar; StrToBeReturned: PChar): integer; stdcall;

 

 

 


 

Tag/Tokens:

Note that brackets [] indicate an optional parameter and are not part of the Token syntax.

^Fact{FactName}
    This tag will be replaced by the contents of the "Fact" identified by FactName, or will disappear if not found.

^SysFact{Time}
    This tag will be replaced by the time as reported by the operating system, and will appear in the format specified in regional settings.

^SysFact{Date}
    This tag will be replaced by the date as reported by the operating system, and will appear in the format specified in regional settings.

^SysFact{Age}
    This tag will be replaced by the age in days of the Proteus technology, as calculated by the current date less October 02, 2002, which is the date that the first revision of version 3 was developed. The version 1 was originally created on September 17, 2002. The version 2 was created on September 29, 2002.

^State{}
    This tag will be replaced by the "Current State" name. This can facilitate displaying Proteus states to the user, as well as complex matching criterion.

^Member{DataCollectionName[|Index]}
    This tag will be replaced by the "Member" found in the input text (by word-match), which resides in "DataCollection" identified by DataCollectionName. If there is more than one "Member" in the input stream the tag will be replaced by the first occurrence, unless the optional specifier Index is used, in which case the Index'th Member will be returned (in the order it appears in the Data Collection, allowing specification of precedence in the collection).  Note that Index is zero based.

^Members{DataCollectionName}
    This tag will be replaced by a comma separated list of all "Members" of the "Data Collection" identified by DataCollectionName.

^MemberX{DataCollectionName[|Index]}
    This tag will be replaced by a randomly selected "Member" of the "Data Collection" identified by DataCollectionName.  If the optional specifier Index is used, then the member in the position indicated by Index will be returned.  Note that Index is zero based.

^Remain{}
    This tag will be replaced by the remaining user's input text after the "Word Fragment" contents of each fragment associated with the "Pattern" have been removed. This facilitates processing of unknown text within a known pattern. For example, if you have a fragment of "I Like" the ^Remain{} value for and input text of "I Like Dogs" would be: "Dogs", allowing management of an entire class of statement and answer without knowing what the user actually "likes".

^Input{Num}
    This tag returns the entire user's input text without processing. This facilitates logging of user-Proteus interaction, as well as passing input to external programs if it is not known by the "Brain". This can also be used in conjunction with "Submit This" responses to re-query the brain after changing states or modes. "Num" represents how far back in the history to refer, where 0 is the most recent input, 1 is the input prior. The maximum depth supported is currently 100.

^LastOut{Num}
    This tag returns Proteus's last output text without processing. This facilitates logging of user-Proteus interaction, as well as passing output for additional analysis. This can also be used in conjunction with "Submit This" responses to re-query the brain with it's own output. "Num" represents how far back in the history to refer, where 0 is the most recent Output, 1 is the output prior. The maximum depth supported is currently 100.

^MemberSub{DataCollectionName}
    This tag will be replaced by the "Member" found in the input text (by sub-pattern matching), which resides in "DataCollection" identified by DataCollectionName. If there is more than one "Member" in the input stream the tag will be replaced by the first occurrence.

^AutoName{}
    This tag returns a unique name that can be assigned to a Fact, Data Collection, or Object, without fear of conflict with any existing internal object names.

^LastPat{}
    This tag returns the name of the last used Pattern (Clause) Object (which has been named). Should an un-named object have been used last this function returns an empty string. This feature can be used to have Proteus modify his code based upon input from the user, or internal criteria.

^LastSPat{}
    This tag returns the name of the last used Step Pattern (Clause) Object (which has been named). Should an un-named object have been used last this function returns an empty string.

^LastFrag{}
    This tag returns the name of the last used Fragment Object (which has been named). Should an un-named object have been used last this function returns an empty string.

^LastResp{}
    This tag returns the name of the last used Response Object (which has been named). Should an un-named object have been used last this function returns an empty string.

^LastTask{}
    This tag returns the name of the last used Task Object (which has been named). Should an un-named object have been used last this function returns an empty string.

^LastKnow{}
    This tag returns the name of the last used Knowledge Mode Object (which has been named). Should an un-named object have been used last this function returns an empty string.

^Extr{FactName}
    This tag is only functional in the "Word Fragment" of an EXTRACT type Fragment.  The text appearing between the pattern constants will be extracted and stored as a Fact identified by FactName.  Such as: My name is ^Extr{UserName}, I like to eat ^Extr{UserFood}

^Add{LeftOperand|RightOperand}
    This tag returns the mathematical addition between the LeftOperand and RightOperand value, such as: LO + RO.  This facilitates basic math functionality, as well as supporting string concatenation if the operands are non numeric.  Both integer and real numbers are supported.  If both operands are integer the the calculation and result is integer.  If either operand is a non numeric value a string concatenation occurs.

^Sub{LeftOperand|RightOperand}
    This tag returns the mathematical subtraction between the LeftOperand and RightOperand value, such as: LO - RO.  This facilitates basic math functionality, as well as supporting string concatenation of the operands are non numeric.  Both integer and real numbers are supported.  If both operands are integer the the calculation and result is integer.  If either operand is a non numeric value a string concatenation occurs.

^Mul{LeftOperand|RightOperand}
    This tag returns the mathematical multiplication between the LeftOperand and RightOperand value, such as: LO * RO.  This facilitates basic math functionality, as well as supporting string concatenation of the operands are non numeric.  Both integer and real numbers are supported.  If both operands are integer the the calculation and result is integer.  If either operand is a non numeric value a string concatenation occurs.

^Div{LeftOperand|RightOperand}
    This tag returns the mathematical division between the LeftOperand and RightOperand value, such as: LO / RO.  This facilitates basic math functionality, as well as supporting string concatenation of the operands are non numeric.  Both integer and real numbers are supported.  If both operands are integer the the calculation and result is integer.  If either operand is a non numeric value a string concatenation occurs.

^MemberZ{ControlCollection|DetailCollection}
    This tag will be replaced by a randomly selected "Member" of the "Data Collection" identified by DetailCollection if there is a member that has elements that exist in the control data collection identified by DetailCollection.  The member selected will be the best match between the control collection and the input text, meaning that if a member contains a word that exists in the control collection as well as the input text it will be chosen above a member that only matches the control. 



 


 

Table -A-, Object members

WordFragmentClass (Word Fragment)

WORDFRAG
RELATION
BONUS
PENALTY
THENAME
THEVALUE
TaskClass (Task)

RESPONSETYPE
OUTTEXT
THENAME
THEVALUE
ResponseClass (Response)

RESPONSETYPE
OUTTEXT
THENAME
THEVALUE

ThresholdClass (Threshold)

THRESHFROM
THRESHTO

StateClass (State)

TE

PatternClass (Clause)

HITCOUNT
HASVOLITION
LASTVOLITION
VOLITIONWHEN

KnowledgeClass (KnowMode)

HASVOLITION

StepClass (Step)

THENAME
THEPROMPT

ProcClass (Procedure)

THENAME
CURRENTSTEP
STARTSTEP

BrainClass (Brain)

MYNAME
CURRENTMODE
CURRENTSTATE
CURRENTPROC
HASVOLITION
LASTINPUT
SHOWBLANKOUTPUT
LASTOUTPUT


 

 


 
Proteus Language
    The Proteus Language was designed as a declarative language to be compiled directly into a Proteus Technology brain construct. The current language definition is intended to be representative of the underlying brain structure, rather than following a traditional procedural structure.

    By definition, declarative languages are not intended to define a step-wise procedural process, but instead describe an underlying abstraction. This lends itself well to the application at hand. The Proteus architecture is richly abstracted, but nonetheless in essence a complex state machine. The Proteus language is a top-down description of the brain state, which is compiled directly into the collection of objects and constructs of a Proteus brain.

    A Proteus brain upon creation always contains a few initial constructs. There is initially a state called "Normal", and a mode and knowmode called "Default". The PL (Proteus Language) attributes new declarations of child types to the most recently declared parent type. This therefore means that new clause declarations are assigned to the "Default" knowmode unless a new knowmode has been declared prior to the clause.

    PL programs are free-form, meaning that they do not require adherence to sectional based rules, such as declaring all of the facts or collections in a given section of the source code. For the sake of clarity the author would suggest that PL writers should place clause and other definitions within proximity to the parent type declarations, unless clarity of behavioral relationships supercede this.

    The syntactical rules for PL are relatively simple. All lines that are not a declaration (and are not part of a collection's contents) will be considered a comment, or ignored white-space. All declarations must exist on one line, wrapping to a second line indicates a new declaration or comment to the compiler. The sole exception to this rule is the collections declaration format. A collection has a start and an end declaration (each on their own line), and all lines (if any) between represent members of the collection.

    Declarations can contain two kinds of specifiers: textual and value. Textual data is specified as being contained within an opening and closing curly brace (like {dog} is the text "dog"). The text may contain curly braces without conflict (as that the Tag/Tokens are defined to use them to indicate parameters). Value data is specified by simply typing the value to be represented. Some values may indicate type information (such as fragment type), and is therefore textual, but is NOT enclosed in curly braces. In the case of type information, capitalization does not matter, but spacing and punctuation must match the type definition.

    Multiple specifiers are separated by commas. Specifiers may be excluded from a declaration if a default value is acceptable. This is indicated by omitting the specifier completely if at the end of the list, or including the comma delimiter without the value if not (meaning that multiple commas represent empty specifier placeholders).

Return to top of page

 


 

Language Definition

Fact {Name} = {Value}

Start-Collection {Name}
End-Collection

Mode {Name}

State {Name}

Procedure {Name}
Step {Name},{Query}

For-Mode

For-Step

Threshold From,To

For-State {Name}

Fragment Type,Bonus,Penalty,{Fragment},{TheName},{TheValue}

Response {Response Text},Type,{TheName},{TheValue}

Task {Response Text},Type,{TheName},{TheValue}

Name-Object {ObjectName}
Auto-Name

The PL defined fragment types are as follows:

None, AND, OR, NOT, CUSTOM, Data-Match, External, State-Match, In Collection, Volition, Out-Match, CUSTOM-Sub, In Collection-Sub, Initialize, Finalize, Do-Before, Do-After, EXTRACT

The PL defined response and task types are as follows:

None, Just Text, Mode Change, Nested, Assignment, Action, Reset Hits, State Change, Reset State, Task List, Reset KM Hits, Reset Brain Hits, Add To Collection, Remove From Collection, Submit This, Log This, Start Proc, Goto Step, Halt Proc, Ask OpenMind, Call Proc, Proc Return, Self Modify, Load Collection, Save Collection, Clear Collection, Parse Collection, Delete Object, Make Code, Merge Collection, Do Response For, Words To Collection, Create AutoPattern, Add Response, Add Fragment, Set Unsorted, Set Label, Goto, BranchIf, CallDLL


 
Example Script

Behavior:

[user]: hello there
[Proteus]: I don't understand that. Would you like to teach me what to say?
[user]: ok
[Proteus]: What should I say if someone tells me: "hello there"?
[user]: Hi there yourself
[Proteus]: OK, I will remember that!
[user]: hello
[Proteus]: Hi there yourself
[user]: _or when hi
[Proteus]: OK, I will remember that.
[user]: hi
[Proteus]: Hi there yourself
[user]: _or say Greetings.
[Proteus]: OK, I will remember that.
[user]: hi
[Proteus]: Hi there yourself
[user]: hi
[Proteus]: Greetings.
[user]: _wrong Greetings human.
[Proteus]: OK, changed to: Greetings human.
[user]: hi
[Proteus]: Greetings human.
[user]: you already said hello
[Proteus]: Hi there yourself
[user]: _not when you already said
[Proteus]: OK, not when you already said
[user]: you already said hi
[Proteus]: I don't understand that. Would you like to teach me what to say?
[user]: ok
[Proteus]: What should I say if someone tells me: "you already said hi"?
[user]: Sorry, I repeat myself sometimes
[Proteus]: OK, I will remember that!
[user]: hello
[Proteus]: Hi there yourself
[user]: you already said hello
[Proteus]: Sorry, I repeat myself sometimes
[user]: quit saying hello
[Proteus]: Hi there yourself
[user]: _last
[Proteus]: What should I say if someone tells me: "quit saying hello"?
[user]: But I LIKE to say hello!
[Proteus]: OK, I will remember that!
[user]: hello
[Proteus]: Hi there yourself
[user]: quit saying hi!
[Proteus]: But I LIKE to say hello!
[user]: What is Spam?
[Proteus]: I don't understand that. Would you like to teach me what to say?
[user]: no
[Proteus]: OK, we can talk about something else then.
[user]: Spam is disgusting
[Proteus]: Oh, OK, I will remember that.
[user]: what is Spam?
[Proteus]: Spam is disgusting
[user]: Do you like Spam?
[Proteus]: Spam is disgusting
[user]: _last
[Proteus]: What should I say if someone tells me: "Do you like Spam?"?
[user]: Nobody likes Spam!
[Proteus]: OK, I will remember that!
[user]: what is Spam?
[Proteus]: Spam is disgusting
[user]: Do you like Spam?
[Proteus]: Nobody likes Spam!
[user]: I like pumpkins
[Proteus]: I don't understand that. Would you like to teach me what to say?
[user]: well, I guess that is ok
[Proteus]: What should I say if someone tells me: "I like pumpkins"?
[user]: _quit
[Proteus]: OK, never mind.



 

 
Proteus Language Example:
Proteus 5.3 Proteus-Language File
Copyright 2003, Artificial Ingenuity, LLC
All Rights Reserved

-------States--------
-------Modes---------
For-Mode
  Fragment CUSTOM,1,-1, {x}, {}, {}
  Response {},Task List,{},{}
    Task {},Assignment,{Last Unhandled Input},{^Input{}}
    Task {},Start Proc,{Teach Me},{}

For-Mode
  Fragment CUSTOM,1000,0, {_last}, {}, {}
  Response {},Task List,{},{}
    Task {},Assignment,{Last Unhandled Input},{^Input{1}}
    Task {},Start Proc,{New Pattern From Last},{}

For-Mode
  Fragment CUSTOM,1000,0, {_new}, {}, {}
  Response {},Task List,{},{}
    Task {},Start Proc,{new pattern},{}

For-Mode
  Fragment CUSTOM-Sub,1000,0, {_wrong }, {}, {}
  Response {OK, changed to: ^Remain{}},Task List,{},{}
    Task {^LastResp{}},Self Modify,{OUTTEXT},{^Remain{}}

For-Mode
  Fragment CUSTOM-Sub,1000,0, {_or say }, {}, {}
  Response {OK, I will remember that.},Task List,{},{}
    Task {^Remain{}},Add Response,{},{}

For-Mode
  Fragment CUSTOM-Sub,1000,0, {_or when }, {}, {}
  Response {OK, I will remember that.},Task List,{},{}
    Task {^Remain{}},Add Fragment,{5},{}

For-Mode
  Fragment CUSTOM-Sub,1000,0, {_not when }, {}, {}
  Response {OK, not when ^Remain{}},Task List,{},{}
    Task {^Remain{}},Add Fragment,{-500},{}

For-Mode
  Fragment CUSTOM,100,5000, {^Member{Things}}, {}, {}
  Fragment CUSTOM,1000,500, {is}, {}, {}
  Fragment CUSTOM,1000,500, {are}, {}, {}
  Fragment CUSTOM,-1000,0, {what is}, {}, {}
  Fragment CUSTOM,-1000,0, {what are}, {}, {}
  Response {Oh, OK, I will remember that.},Task List,{},{}
    Task {},Add To Collection,{^Member{Things}},{^Remain{}}

For-Mode
  Fragment CUSTOM,10,1000, {^Member{Things}}, {}, {}
  Fragment Data-Match,-1000,0, {}, {Empty String}, {^MemberX{^Member{Things}}}
  Response {^Member{Things} is ^MemberX{^Member{Things}}},Just Text,{},{}
  Response {^Member{Things} are ^MemberX{^Member{Things}}},Just Text,{},{}

For-Mode
  Fragment CUSTOM,10,1000, {^Member{Things}}, {}, {}
  Fragment CUSTOM,10,1000, {everything}, {}, {}
  Fragment Data-Match,-1000,0, {}, {Empty String}, {^MemberX{^Member{Things}}}
  Response {Everything I know about ^Member{Things} is that they are: ^Members{^Member{Things}}},Just Text,{},{}

For-Mode   Fragment CUSTOM-Sub,1000,0, { is a thing}, {}, {}   Fragment CUSTOM-Sub,1000,0, {a thing is }, {}, {}   Fragment CUSTOM-Sub,1000,0, { are things}, {}, {}   Response {Oh, OK. I will remember that.},Add To Collection,{Things},{^Remain{}}

For-Mode
  Fragment CUSTOM-Sub,1000,0, {my name is }, {}, {}
  Fragment CUSTOM-Sub,1000,0, { is my name}, {}, {}
  Response {Hello ^Remain{}, I will remember your name.},Assignment,{UserName},{^Remain{}}

For-Mode
  Fragment CUSTOM,1000,0, {who am i}, {}, {}
  Fragment CUSTOM,1000,0, {what is my name}, {}, {}
  Response {I was told that your name is ^Fact{UserName}.},Just Text,{},{}

-----Procedures------
Procedure {new pattern}

Step {Start New},{What is the sentence pattern you want me to respond to?}
  For-Step
    Fragment CUSTOM,1,-1, {x}, {}, {}
    Response {},Task List,{},{}
      Task {},Assignment,{New Pattern},{^Input{}}
      Task {},Goto Step,{Get Response},{}

  For-Step
    Fragment CUSTOM,1000,0, {_quit}, {}, {}
    Response {OK, never mind.},Halt Proc,{},{}

Step {Get Response},{What should I say if someone tells me: "^Fact{New Pattern}"?}
  For-Step
    Fragment CUSTOM,1,-1, {x}, {}, {}
    Response {OK, I will remember that!},Task List,{},{}
      Task {^Fact{New Pattern}},Create AutoPattern,{10},{^Input{}}
      Task {},Halt Proc,{},{}

  For-Step
    Fragment CUSTOM,1000,0, {_quit}, {}, {}
    Response {OK, never mind.},Halt Proc,{},{}

Procedure {Teach Me}

Step {Will You},{I don't understand that. Would you like to teach me what to say?}   For-Step
    Fragment CUSTOM,1000,0, {yes}, {}, {}
    Fragment CUSTOM,1000,0, {ok}, {}, {}
    Fragment CUSTOM,1000,0, {sure}, {}, {}
    Fragment CUSTOM,1000,0, {alright}, {}, {}
    Response {},Goto Step,{Get Response},{}

  For-Step     Fragment CUSTOM,1,-1, {x}, {}, {}
    Response {OK, we can talk about something else then.},Halt Proc,{},{}

Step {Get Response},{What should I say if someone tells me: "^Fact{Last Unhandled Input}"?}
  For-Step
    Fragment CUSTOM,1,-1, {x}, {}, {}
    Response {OK, I will remember that!},Task List,{},{}
      Task {^Fact{Last Unhandled Input}},Create AutoPattern,{10},{^Input{}}
      Task {},Halt Proc,{},{}

  For-Step
    Fragment CUSTOM,1000,0, {_quit}, {}, {}
    Response {OK, never mind.},Halt Proc,{},{}

Procedure {New Pattern From Last}

Step {Get Response},{What should I say if someone tells me: "^Fact{Last Unhandled Input}"?}
  For-Step
    Fragment CUSTOM,1,-1, {x}, {}, {}
    Response {OK, I will remember that!},Task List,{},{}
      Task {^Fact{Last Unhandled Input}},Create AutoPattern,{10},{^Input{}}
      Task {},Halt Proc,{},{}

  For-Step
    Fragment CUSTOM,1000,0, {_quit}, {}, {}
    Response {OK, never mind.},Halt Proc,{},{}

-------Facts---------
Fact {Last Unhandled Input} = {N/A}
Fact {New Pattern} = {N/A}
Fact {Empty String} = {}
Fact {UserName} = {Unknown}

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

 


 


Contact [email protected]
Copyright © 2006 Artificial Ingenuity, LLC
Last modified: September 4, 2006
Initial design by Webinizer, LLC

 



©Sheryl clyde 2002-2017