Henrique,

Ernest addressed multislot matching  on this list in 2002. I will forward you his e-mail.
But, few points below

At 06:15 AM 10/21/2005, you wrote:
Your comments got me into the following:

(assert (a "nice string"))


"nice string" is not a list, it is still single value slot of type string

(a nice string)

now it becomes multivalue slot (or list). You match this using $?var variable (dollar sign signifies multislot).

I did run few rules and asserts to illustrate the point:

(assert (a "nice string"))

(assert (a This is very long sentence of  symbols))

(assert (a Symbol long string "long" sentence of strings "and" symbols))
(defrule r1
   (a ?x)
  =>
   (printout t "r1 fired: " ?x crlf)
)

(defrule find-long
   (a $?head long $?tail)
  =>
   (printout t "find-long fired: head " $?head  ", tail: " $?tail crlf)
)

(defrule find-string-long
   (a $?head "long" $?tail)
  =>
   (printout t "find-string-long fired: head " $?head  ", tail: " $?tail crlf)
)

(defrule find-fourth
   (a ?first ?sec ?third ?fourth $?tail)
  =>
   (printout t "find-fourth fired: 4th " ?fourth  ", tail: " $?tail crlf)
)

(run)

and here is the run:

Jess Version 7.0a6 3/23/2005

find-long fired: head (Symbol), tail: (string "long" sentence of strings "and" symbols)
find-string-long fired: head (Symbol long string), tail: (sentence of strings "and" symbols)
find-fourth fired: 4th long, tail: (sentence of strings "and" symbols)
find-long fired: head (This is very), tail: (sentence of symbols)
find-fourth fired: 4th long, tail: (sentence of symbols)
r1 fired: nice string


Regards,

Dusan Sormaz

*********************************************************************
* Dušan Šormaz, PhD, Associate Professor                     
* Ohio University
* Industrial and Manufacturing Systems Engineering Department
* 277 Stocker Center, Athens, OH 45701-2979
* phone: (740) 593-1545
* fax:   (740) 593-0778 
* e-mail: [EMAIL PROTECTED]
* url: http://www.ent.ohiou.edu/~sormaz
*********************************************************************

Reply via email to