[alicebot-archcomm] Conditional wildcards
Dr. Rich Wallace
alicebot-archcomm@list.alicebot.org
Mon, 3 Mar 2003 09:00:21 +0100 (CET)
> It is this design I am tampering with.
>
Gary, are you trying to implement the wrong algorithm, or describe the
correct algorithm? If you are having trouble with the implementation,
there are several code examples of the Graphmaster matching algorithm in
M.setl, Program D, Program dB, E, V, J, and all the others; just copy one
of those and translate it to your environment.
If you are trying to describe the algorithm, may I suggest a metric based
approach I have been working on (but not found the solution to). Indeed
you are correct that a given input X might match(*) a set {P} of AIML
patterns becuause of wildcards. Even within that set there might be
ambiguous matches (assuming we were really confused about the order of
assigning words to the wildcards) depending on how we rearrange the words
between the wild cards. So let us say there is a set of matches {M}
associated with each P.
Now, Let M' = the union of all the sets {M{P)} be the set of all possible
matches of X from a given AIML set containing the P's.
I claim that given each match M in M' there exists a distance metric
d(X, M) that measures the difference in pattern space between the input
and the given match M.
Moreover, there is a unique M in M' such that d(X, M) is less than all the
other d(X, N) for N in M'-{M}. Specifically, this M corresponds to the
match selected by the Graphmaster matching algorithm.
Put another way, there is a "cost" metric associated with matching any
input with the set of AIML patterns. If the pattern doesn't match at all,
we could say the cost is infinite. Among the possible matches, there is a
set of associated finite costs. The match found by the Graphmaster is the
"cheapest" one among these.
The only little technical glitch in my presentation here is that, as yet,
I have been unable to define such a suitable metric d(X, M).
Note: (*) We can even give a technical definition of "might match" by
saying that if X is an input and P is a pattern, then consider the pattern
in isolation as the sole member an AIML set. Does X match P in this set by
itself? If so, we could say P "might match" X in any larger AIML set
containing {P} as a subset.