Alice

 

Alice Overview

The Analytic Information Server implementation of the A.L.I.C.E. technology is an artificial intelligence natural language chat Lambda, written in Lisp, and named "alice". The Alice chat Lambda is actually a community of Lambdas all attached to each other in parent child relationships. The AIS implementation of Alice has a number of enhancements related to the integration of the original A.L.I.C.E. technology with the full capabilities of the Analytic Information Server environment.

The AIS implementation of Alice requires four Lambda repositories: Alice, AliceAIML, AliceRules, and AliceFacts. The Alice repository contains the A.L.I.C.E. chat Lambda herself. The AliceAIML repository contains the source code for the AIML rules and facts knowledgebase for Alice. The AliceRules repository contains the compiled AIML rules knowledgebase for Alice. The AliceFacts repository contains the compiled AIML facts knowledgebase for Alice.

Each of these four repositories (Alice, AliceAIML, AliceRules, and AliceFacts) are registered with and managed by the browseLib. Alice may also allocate and register space with dataMineLib and xmlBase so that Alice may store facts, acquired or learned during her training process, in data mine tables and XML documents. Alice may also use the full features of the Analytic Information Server and any Lambdas resident therein.

Enhancements to A.L.I.C.E.

A.L.I.C.E. is an artificial intelligence natural language chat robot technology based on an extension of the old ELIZA psychiatrist program. The principle advantage of the A.L.I.C.E. technology, like its ELIZA ancestor, is it's uncanny ability to deceive a wide range of human clients into perceiving Alice as having some intelligence. While many chat robot tools have complex rule systems but little content, Alice's wonderful content allows her to be "chatty".

Starting in 2001, we began adapting the A.L.I.C.E. technology to operate in the Analytic Information Server database environment. We wanted to preserve Alice's chatty personality; but, we needed to enhance Alice's logic and search tool set in the areas of: parsing, syntax, semantic analysis, database access, rule-base goal specification, and action-response options.

The Analytic Information Server implementation of A.L.I.C.E. includes enhancements designed to retain Alice's unparalleled ability to deceive and entertain human clients while extending the logic and search tools available in the technology. Our core enhancements to A.L.I.C.E. technology include the following:

.        Integration of Alice with the complete Analytic Information Server database environment.

.        Expanding Graphmaster storage capacity using Analytic Information Server repositories.

.        Replacing Alice's word parser with a feature based parser and semantic analyser.

.        Providing Alice with imbedded HTML responses served to the client by Analytic Information Server.

.        Allowing Alice full access to the Internet and web searches via Analytic Information Server.

.        Supporting adding, morphing, and combining of feature based tokens in Alice's working memory.

.        Supporting forward production logic & goal seeking with backtracking in Alice's working memory.

.        Supporting Alice as the client interface to a wide range of disparate knowledgebase systems via the local and remote TCP/IP communication facilities of Lambda Information Server.

.        Adding localized topic rules with the <rule topic="name"> tag.

.        Adding additional wild cards (? and @) to Alice's <pattern> tag.

.        Adding user defined feature-based definitions with the <lex> tag.

.        Adding feature-based wild cards (%Feature and $Feature) to Alice's <pattern> tag.

.        Adding feature-based matching actions with the <arg> tag.

.        Adding user programmable conditions and actions with the <lisp> tag.

.        Adding "classic" AI tuple logic matching with the <token> tag.

.        Adding user defined rule conflict resolution with the findAllMatches Alice child Lambda.

.        Adding user defined XML database facts and fact retrieval via XQuery with the <fact> tag.

Conversion of the Alice Graphmaster parsed input from a sequence of words into a sequence of feature based tokens, fills working memory with a set of tuples (albeit feature based rather than horn-clause logic tuples). Like the logic-based tuples in CLIPS or OPSYS5 working memory, the feature-based tuples in Alice working memory can also be morphed and combined. Composite goal seeking feature-base tuples can be added to Alice working set, during recursive rule matching, to support backtracking in either a depth first or breadth first mode.

In the Dr. Wallace's original content Alice answers the input "What is the meaning of Life?" with the response "Actually, it's twenty-three, not forty-two". While this is a classic and amusing example of wild card pattern matching, it may not be defensible as a "logical" response.

In the enhanced version of Alice, rules localized to a specific "topic" area can be formed in strict adherence to the rules of logic. An excellent example of this is demonstrated in the small set of AIML rules that allow the enhanced Alice to perform flawless English language arithmetic.

Theoretically the enhanced Analytic Information Server implementation of Alice could conceivably be used to provide advanced logic services including forward production, goal seeking with backtracking, and depth first or breadth first search. If the client request failed to find an appropriate goal, using logical methods, then the default might be Alice's amusing personality, or an appropriate mix of the two.

Alice Persistant Memory

Alice shares her persistent memory with each Lisp AIML Lambda executed in an AIML template. Alice's persistent memory contains the following named elements that are listed below along with an explanation of their contents.

.        arg                                           The vector of <arg/> matches during the current pattern check.       

.        in                                             The vector of input feature-based tokens during the current pattern check.       

.        star                                          The vector of <star/> matches during the current pattern check.       

.        that                                          The last answer, from Alice, to be used in <that> pattern matching.       

.        myAimlPatterns                       The short term memory of AIML patterns loaded from the Alice knowledgebase respositories.       

.        myHtmlResponseHeading        The HTML heading provided (if any) with the response alice last returned.       

.        myHtmlResponseResults         The HTML page provided (if any) with the response alice last returned.       

.        myMemory                               The discussion and personal term memory of Alice.       

.        myWebTimeOut                       The maximum time to wait for a response from the world wide web.       

.        webOnline                                The web online switch is true iff the Internet is available.     

Alice Discussion Memory

Alice herself has a discussion memory capacity that, at each initialization, contains the following named elements that are included below along with an explanation of their contents.

.        context:  ."The current discussion context"

.        it:  "The subject to which "it" refers in  the current discussion"

.        name: "The client's name"

.        patternSwitches: "The Dictionary of named pattern switches"

.        petname: "The client's pet name"

.        subject: "The current discussion subject "

Alice Personal Memory

Alice herself has a personal memory capacity that, at each initialization, contains the following named elements that are included below along with an explanation of their contents.

 

.        arch:  ..The architecture of the computer Alice runs on?

.        categories:  ?The number of categories Alice has been trained with?

.        birthday: "The date of Alice's birth"

.        birthplace: "The place where Alice was born"

.        boyfriend: "Alice's current boyfriend"

.        dailyclients: "The average number of clients serviced by Alice"

.        favoriteband: "Alice's favorite musical group"

.        favoritebook: "Alice's favorite book"

.        favoritecolor: "Alice's favorite color"

.        favoritefood: "Alice's favorite food"

.        favoritemovie: "Alice's favorite movie"

.        favoritesong: "Alice's favorite song"

.        friends: "Alice's current friends"

.        forfun: "What Alice likes to do for fun"

.        gender: "Alice's virtual gender"

.        hourlyqueries: "The average number of queries serviced by Alice"

.        girlfriend: "Alice's current girlfriend"

.        kindmusic: "Alice's favorite musical style"

.        location: "Alice's current physical location"

.        looklike: "Who Alice currently looks like"

.        master: "Alice's current bot-master"

.        memory: "Alice's current memory capacity"

.        maxclients: "The maximum number of clients serviced by Alice" 

.        nclients: "The current number of clients serviced by Alice"

.        ndevelopers: "The total number of developers who have helped program Alice"

.        name: "Alice's current name"

.        os: "The current operating environment used by Alice" 

.        question: "Alice's current burning issue"

.        sign: "Alice's astrological sign"

.        spt: "Alice's current response time" 

.        talkabout: "Alice's current favorite chat subject" 

.        totalclients: "The total number of clients ever serviced by Alice"

.        vocabulary: "The total number of words taught to Alice"

.        wear: "Alice's favorite clothing"

Alice Client Lambdas

The Alice chat Lambda is actually a community of Lambdas all attached to each other in parent child relationships. External Alice clients can invoke a number of these Lambdas, which perform all of the required initialization and clean up. Here follow the reference materials for the Alice client Lambdas.

alice

Overview                                

The Alice chat Lambda is actually a community of Lambdas all attached to each other in parent child relationships. Invoking the alice top level Lambda compiles the argument string as an AIML source file. The result of compiling an AIML source string is the population of the AliceRules repository with the rules contained in the compiled AIML source string. The AliceRules repository contains the rule base for the A.L.I.C.E. technology implementation in Analytic Information Server.

 

Type:              Parent Lambda

 

Syntax:            (alice aimlString)

 

When To Use              

The alice top level Lambda performs the compilation of the argument AIML source string into the AliceRules repository. Use the alice top level Lambda when an AIML source file is to be compiled into the Alice knowledgebase.

__________________________________________________________________

Arguments                               Explanation                                                                 

aimlString

An AIML string to be compiled into the AliceRules knowledgebase.

Returns

An Analytic Information Server universal parse tree for the AIML source string.

________________________________________________________________

 

Example1                    

The following invocation of the alice parent Lambda will teach Alice how to respond to the client query "What is your name?", as follows:

(alice .<aiml><rule><pattern>WHAT IS YOUR NAME</pattern><template>My name is <bot/></template></rule></aiml>.)

 

Notes and Hints          

The alice top level Lambda is used to compile AIML source into the AliceRules repository.

actOnAll

Overview                                

The Alice chat Lambda is actually a community of Lambdas all attached to each other in parent child relationships. Invoking the actOnAll child Lambda accepts a client query string, a rule topic name, and returns a list of all of Alice's responses as a vector of strings. The actOnAll child Lambda always acts on ALL matching patterns found in the AliceRules knowledgebase. ALL resulting Alice response strings are returned in a vector of strings.

 

Type:              Child Lambda

 

Syntax:            (alice.actOnAll queryString topic)

 

When To Use              

The actOnAll child Lambda accepts a client query string and returns ALL of Alice's responses as a vector of strings. Use the actOnAll child Lambda when a client query is to be acted upon by ALL possible matches in the AliceRules knowledgebase.

__________________________________________________________________

Arguments                               Explanation                                                                 

queryString

A client query string to be acted upon by Alice.

topic

A rule topic name to be used by Alice.

Returns

A vector of Alice response strings.

________________________________________________________________

 

Example1                    

The following invocation of the alice.actOnAll child Lambda will return Alice's response to the client query "What is your name?", as follows:

(alice.actOnAll "What is your name?" personal:)       

Returns             #("My name is Alice" "What is your Name?" "Why do you ask?")

 

Notes and Hints          

The alice.actOnAll child Lambda accepts a client query string or a vector of query strings and returns ALL Alice responses as a vector of strings.

assert

Overview                                

The Alice chat Lambda is actually a community of Lambdas all attached to each other in parent child relationships. Invoking the assert child Lambda accepts a reminder string and stores the specified XML document in the AliceFacts repository for later retrieval via the alice.remember child Lambda. 

 

Type:              Child Lambda

 

Syntax:           (alice.assert reminderString xmlDocument)

 

When To Use              

The assert child Lambda accepts a reminder string and stores the specified XML document in the AliceFacts repository for later retrieval via the alice.remember child Lambda. Use the assert child Lambda when an important XML document is to be stored in the AliceFacts knowledgebase.

__________________________________________________________________

Arguments                               Explanation                                                                 

reminderString

A string containing a list of uppercase words separated by blanks; or, a vector of feature based tokens where each Value feature contains an uppercase word

xmlDocument

An XML document already compiled into XML model format.

Returns

true

________________________________________________________________

 

Example1                    

The following invocation of the alice.assert child Lambda will store an XML model of the European capitals in the AliceFacts repository, as follows:

(alice.assert "EUROPEAN CAPITALS" #{FRANCE Paris ENGLAND London GERMANY Berlin})       

Returns             #{FRANCE Paris ENGLAND London GERMANY Berlin} 

 

Notes and Hints          

The alice.assert child Lambda accepts a reminder string and stores the specified XML document in the AliceFacts repository for later retrieval via the alice.remember child Lambda.

drop

Overview                                

The Alice chat Lambda is actually a community of Lambdas all attached to each other in parent child relationships. Invoking the drop child Lambda deletes a reminder string and previously stored XML document from the AliceFacts repository. 

 

Type:              Child Lambda

 

Syntax:           (alice.drop reminderString)

 

When To Use              

The drop child Lambda accepts a reminder string and deletes the reminder string and previously stored XML document from the AliceFacts repository. Use the drop child Lambda when an important XML document is to be deleted from the AliceFacts knowledgebase.

__________________________________________________________________

Arguments                               Explanation                                                                 

reminderString

A string containing a list of uppercase words separated by blanks; or, a vector of feature based tokens where each Value feature contains an uppercase word

Returns

true

________________________________________________________________

 

Example1                    

The following invocation of the alice.drop child Lambda will store an XML model of the European capitals in the AliceFacts repository, and then delete it, as follows:

(alice.assert "EUROPEAN CAPITALS" #{FRANCE Paris ENGLAND London GERMANY Berlin})       

(alice.drop "EUROPEAN CAPITALS")       

Returns             #{FRANCE Paris ENGLAND London GERMANY Berlin} 

 

Notes and Hints          

The alice.drop child Lambda accepts a reminder string and deletes the reminder string and previously stored XML document from the AliceFacts repository.

query

Overview                                

The Alice chat Lambda is actually a community of Lambdas all attached to each other in parent child relationships. Invoking the query child Lambda accepts a client query string and returns Alice's response as a simple string. One and only one ASCII response string is returned. The query child Lambda always acts ONLY on the very first matching pattern found in the AliceRules knowledgebase.

 

Type:              Child Lambda

 

Syntax:            (alice.query queryString)

(alice.query queryString  topic)

 

When To Use              

The query child Lambda accepts a client query string and returns Alice's response as a simple string. Use the query child Lambda when client query is to be answered in a text only environment.

__________________________________________________________________

Arguments                               Explanation                                                                 

queryString

A client query string to be answered by Alice.

topic

(Optional) the localized rules topic for Alice to apply.

Returns

An Alice answer as a simple string.

________________________________________________________________

 

Example1                    

The following invocation of the alice.query child Lambda will return Alice's response to the client query "What is your name?", as follows:

(alice.query "What is your name?")    Returns             "My name is Alice"

 

Notes and Hints          

The alice.query child Lambda accepts a client query string and returns Alice's response as a simple string.

queryAllMatches

Overview                                

The Alice chat Lambda is actually a community of Lambdas all attached to each other in parent child relationships. Invoking the queryAllMatches child Lambda accepts a query string, a rule topic name, and returns a vector of template match structures (the match list).

Each template match structure is a Structure containing the arg, star, and template elements of an AIML rule, which Alice found matched the input query token vector.

 

Type:              Child Lambda

 

Syntax:            (alice.queryAllMatches matchStructure)

 

When To Use              

The queryAllMatches child Lambda accepts a query string, a rule topic name, and returns a vector of template match structures (the match list). Use the queryAllMatches child Lambda to perform user defined rule conflict resolution in connection with the actOnMatch Alice child Lambda.

__________________________________________________________________

Arguments                               Explanation                                                                 

matchStructure

A template match structure (an element of the match list returned by the queryAllMatches Alice child Lambda).

Returns

The Alice response string.

________________________________________________________________

 

Example1                    

The following invocation of the alice.actOnMatch child Lambda will return Alice's response to the client query "What is your name?". The method of conflict resolution is always to act on the first matching rule.

(alice.actOnMatch (setq M (alice.queryAllMatches "What is your name?" personal:))[0])       

Returns             "Why do you ask"

 

Notes and Hints          

The alice.queryAllMatches child Lambda may be used to implement user defined conflict resolution between multiple matching AIML rules.

queryHtml

Overview                                

The Alice chat Lambda is actually a community of Lambdas all attached to each other in parent child relationships. Invoking the queryHtml child Lambda accepts a client query string and returns Alice's response as an HTML-URL. One and only one response HTML-URL is returned. The queryHtml child Lambda always acts ONLY on the very first matching pattern found in the AliceRules knowledgebase.

There are three special ASCII values used by the queryHtml child Lambda to construct the response HTML page referred to by the HTML-URL.

The ASCII text response  (returned by query, which is called by queryHtml) contains the ASCII text response returned by the Alice AIML template action. The text response will be displayed at the first location in the response HTML page. Note: If the text response is prefixed with $$$HREF$$$ (see Special below), then the text response will be treated as a URL to be displayed immediately.

The alice.myHtmlResponseHeading contains the HTML response heading (if any) set by the Alice AIML template action. The myHtmlResponseHeading (if any) will be displayed at the second location in the response HTML page.

The alice.myHtmlResponseResult contains the HTML response result (if any) set by the Alice AIML template action. The myHtmlResponseResult (if any) will be displayed at the third location in the response HTML page.

Type:              Child Lambda

 

Syntax:            (alice.queryHtml queryString)

(alice.queryHtml queryString  topic)

 

Special:            $$$HREF$$$    Any Alice text response, prefaced with the $$$HREF$$$ string will be treated as a URL reference to be displayed immediately.

 

When To Use              

The queryHtml child Lambda accepts a client query string and returns Alice's response as an HTML-URL. Use the queryHtml child Lambda when client query is to be answered in an HTML environment.

__________________________________________________________________

Arguments                               Explanation                                                                 

queryString

A client query string to be answered by Alice.

topic

(Optional) the localized rules topic for Alice to apply.

Returns

An Alice answer as an HTML-URL.

________________________________________________________________

 

Example1                    

The following invocation of the alice.queryHtml child Lambda will return Alice's response to the client query "What is your name?", as follows:

(alice.queryHtml "What is your name?")         Returns             "AnswerDetails.html"

 

Notes and Hints          

The alice.queryHtml child Lambda accepts a client query string and returns Alice's response as an HTML-URL.

remember

Overview                                

The Alice chat Lambda is actually a community of Lambdas all attached to each other in parent child relationships. Invoking the remember child Lambda accepts a reminder string and retrieves a previously stored XML document from the AliceFacts repository. The XML document must have been previously stored in the AliceFacts repository via the alice.assert child Lambda or via the AIML fact tag.

The reminder string may contain an incomplete word list; therefore, the remember child Lambda always returns either void or a Directory of all XML documents whose reminder strings begin with the words in the specified partial word list. In this returned directory of XML documents, the document associated with the key of true (if any) will be the document associated with the exact reminder string specified.

 

Type:              Child Lambda

 

Syntax:           (alice.remember reminderString)

 

When To Use              

The remember child Lambda accepts a reminder string and retrieves a previously stored XML document from the AliceFacts repository. Use the remember child Lambda when an important XML document is to be retrieved from the AliceFacts knowledgebase.

__________________________________________________________________

Arguments                               Explanation                                                                 

reminderString

A string containing a list of uppercase words separated by blanks; or, a vector of feature based tokens where each Value feature contains an uppercase word

Returns

Either void or a Directory of all XML documents whose reminder strings begin with the words in the specified partial word list (the document associated with the key of true (if any) will be the document associated with the exact reminder string specified.

________________________________________________________________

 

Example1                    

The following invocation of the alice.remember child Lambda will store an XML model of the European capitals in the AliceFacts repository, and then retrieve it, as follows:

(alice.assert "EUROPEAN CAPITALS" #{FRANCE Paris ENGLAND London GERMANY Berlin})       

(alice.remember "EUROPEAN CAPITALS")       

Returns             #{FRANCE Paris ENGLAND London GERMANY Berlin} 

 

Notes and Hints          

The alice.remember child Lambda accepts a reminder string and retrieves a previously stored XML document from the AliceFacts repository.

reset

Overview                                

The Alice chat Lambda is actually a community of Lambdas all attached to each other in parent child relationships. Invoking the reset function resets the Alice Lambda. The previously asserted rules are cleared, and the Lambda is made ready for new client queries.

 

Type:              Child Lambda

 

Syntax:            (alice.reset)

 

When To Use              

Use the reset function when the Alice Lambda is to be reset, and a new set of client queries are to be sent.

__________________________________________________________________

Arguments                               Explanation                                                                 

Returns

true

__________________________________________________________________

 

Example1                    

Clearing the Lambda resets all of the discussion memory. The Lambda is then ready for a new client discussion.

(alice.reset)                 Returns             true

xmlSocketEvals

Overview                                

The Alice chat Lambda is actually a community of Lambdas all attached to each other in parent child relationships. Invoking the xmlSocketEvals function allows any remote Analytic Information Server client to execute Lisp commands over the TCP/IP XML socket interface. The previously asserted rules are cleared, and the Lambda is made ready for new client queries.

 

Type:              Child Lambda

 

Syntax:            (alice.xmlSocketEvals  command)

 

When To Use              

Use the result function when the Alice Lambda is to be reset, and a new set of client queries are to be sent.

__________________________________________________________________

Arguments                               Explanation                                                                 

command

The Lisp command to be evaluated by Alice.

Returns

true

__________________________________________________________________

 

Example1                    

Invoking the xmlSocketEvals Lambda allows Alice to evaluate Lisp commands sent from the remote TCP/IP XML socket interface. The result is returned as an AIS AMP protocol return Structure.

(alice.xmlSocketEvals "(+ 3 4)")                     Returns             #{Result 12}

Alice AIML Script Lambdas

The Alice chat Lambda is actually a community of Lambdas all attached to each other in parent child relationships. AIML Lisp scripts can invoke a number of these Lambdas during the execution of an AIML rule. In addition, all AIML scripts may reference any element within Alice's persistent memory (such as arg, in, star, etc.). Here follow the reference materials for the AIML Lisp script Lambdas.

actOnMatch

Overview                                

The Alice chat Lambda is actually a community of Lambdas all attached to each other in parent child relationships. Invoking the actOnMatch child Lambda accepts a template match structure returned from the findAllMatches Alice child Lambda, and returns Alice's response as a string.

The template match structure must be one of the elements in a match list returned by the findAllMatches Alice child Lambda. The template match structure is a Structure containing the topic, in, arg, star, pattern, and template elements of an AIML rule, which Alice found matched the input query token vector.

 

Type:              Child Lambda

 

Syntax:            (alice.actOnMatch matchStructure)

 

When To Use              

The actOnMatch child Lambda accepts a template match structure returned from the findAllMatches Alice child Lambda, and returns Alice's response as a string. Use the actOnMatch child Lambda to perform user defined rule conflict resolution in connection with the findAllMatches Alice child Lambda.

__________________________________________________________________

Arguments                               Explanation                                                                 

matchStructure

A template match structure (an element of the match list returned by the findAllMatches Alice child Lambda).

Returns

The Alice response string.

________________________________________________________________

 

Example1                    

The following invocation of the alice.actOnMatch child Lambda will return Alice's response to the client query "What is your name?". The method of conflict resolution is always to act on the first matching rule.

(alice.actOnMatch (setq M (alice.findAllMatches "What is your name?" personal:))[0])          

Returns             "Why do you ask"

 

Notes and Hints          

The alice.actOnMatch child Lambda may be used to implement user defined conflict resolution between multiple matching AIML rules.

appendFeatures

Overview                                

The Alice chat Lambda is actually a community of Lambdas all attached to each other in parent child relationships. Invoking the appendFeatures child Lambda converts a vector of feature-based tokens into a result string. Appending the specified feature from each of the feature-based tokens forms the result string.

 

Type:              Child Lambda

 

Syntax:            (alice.appendFeatures tokenVector featureName)

 

When To Use              

The appendFeatures child Lambda converts a vector of feature-based tokens into a result string. Appending the specified feature from each of the feature-based tokens forms the result string. Use the appendFeatures child Lambda to perform user defined conversion between vectors of feature-based tokens and simple ASCII strings.

__________________________________________________________________

Arguments                               Explanation                                                                 

tokenVector

A vector of feature-based tokens.

featureName

The name of a feature contained in each of the feature-based tokens.

Returns

The converted ASCII string.

________________________________________________________________

 

Example1                    

The following invocation of the alice.appendFeatures child Lambda will return the appended values in the Original feature of each token output by parsePhrase. This example demonstrates how a string can be converted into a vector of feature-based tokens and then converted back into the original string.

(alice.appendFeatures (alice.parsePhrase "My name is Mike") Original:)        

Returns             "My name is Mike"

 

Notes and Hints          

The alice.appendFeatures child Lambda may be used to convert a vector of feature-based tokens into an ASCII string.

findAllMatches

Overview                                

The Alice chat Lambda is actually a community of Lambdas all attached to each other in parent child relationships. Invoking the findAllMatches child Lambda accepts a query string, a rule topic name, and returns a vector of template match structures (the match list).

Each template match structure is a Structure containing the arg, star, and template elements of an AIML rule, which Alice found matched the input query token vector.

 

Type:              Child Lambda

 

Syntax:            (alice.findAllMatches matchStructure)

 

When To Use              

The findAllMatches child Lambda accepts a query string, a rule topic name, and returns a vector of template match structures (the match list). Use the findAllMatches child Lambda to perform user defined rule conflict resolution in connection with the actOnMatch Alice child Lambda.

__________________________________________________________________

Arguments                               Explanation                                                                 

matchStructure

A template match structure (an element of the match list returned by the findAllMatches Alice child Lambda).

Returns

The Alice response string.

________________________________________________________________

 

Example1                    

The following invocation of the alice.actOnMatch child Lambda will return Alice's response to the client query "What is your name?". The method of conflict resolution is always to act on the first matching rule.

(alice.actOnMatch (setq M (alice.findAllMatches ?What is your name?? personal:))[0])          

Returns             "Why do you ask"

 

Notes and Hints          

The alice.findAllMatches child Lambda may be used to implement user defined conflict resolution between multiple matching AIML rules.

newToken

Overview                                

The Alice chat Lambda is actually a community of Lambdas all attached to each other in parent child relationships. Invoking the newToken child Lambda converts a set of feature-name feature-value pairs into a feature-based token.

 

Type:              Child Lambda

 

Syntax:            (alice.newToken featureName featureValue " featureName featureValue)

 

When To Use              

The newToken child Lambda converts a set of feature-name feature-value pairs into a feature-based token. Use the newToken child Lambda to perform user-defined conversion from a set of feature-name feature-value pairs into a feature-based token.

__________________________________________________________________

Arguments                               Explanation                                                                 

featureName

The symbolic name of a feature in the final feature-based token.

featureValue

The value of a feature in the final feature-based token.

Returns

The feature-based token.

________________________________________________________________

 

Example1                    

The following example demonstrates a how a new feature-based token can be created within an AIML script. The <lisp> tag returns the new token.

 

<!--This examples shows how to create a new feature-based token -->         

<rule>

<pattern>WHAT IS ONE PLUS ONE</pattern>           

<template>One plus one is <lisp>(newToken Value: 2)</lisp></template>

</rule>

 

Notes and Hints          

The alice.newToken child Lambda to perform user-defined conversion from a set of feature-name feature-value pairs into a feature-based token.

parsePhrase

Overview                                

The Alice chat Lambda is actually a community of Lambdas all attached to each other in parent child relationships. Invoking the parsePhrase child Lambda converts an ASCII string into a vector of feature-based tokens. Alice's own internal feature-based parser is employed in the conversion.

 

Type:              Child Lambda

 

Syntax:            (alice.parsePhrase asciiString)

 

When To Use              

The parsePhrase child Lambda converts an ASCII string into a vector of feature-based tokens. Alice's own internal feature-based parser is employed in the conversion. Use the parsePhrase child Lambda to perform user defined conversion between ASCII strings and vectors of feature-based tokens.

__________________________________________________________________

Arguments                               Explanation                                                                 

asciiString

An ASCII string to be converted into a vector of feature-based tokens.

Returns

The vector of feature-based tokens.

________________________________________________________________

 

Example1                    

The following invocation of the alice.parsePhrase child Lambda will return a vector of feature-based token using Alice's own internal feature-based parser in the conversion process. This example demonstrates how a string can be converted into a vector of feature-based tokens and then converted back into the original string.

(alice.appendFeatures (alice.parsePhrase "My name is Mike") Original:)        

Returns             "My name is Mike"

 

Notes and Hints          

The alice.parsePhrase child Lambda may be used to convert an ASCII string into a vector of feature-based tokens.