Writing efficient rules and discussion of
 avoiding construction of inefficient rules
 (like this) is found in the literature (Giarratano &
 Riley for example) and discussions of the
 RETE algorithm.  Maybe it's a good
 idea to add discussion of efficient
 rule construction to the FAQ anyway.
 
 Kirt Undercoffer
 
 > 3-The thing that's not reported and was not noticed even for Mr.
> Friedman-Hill: the kind of rule showed
 > below must be avoided, if you want to have an optimized Rete network:
 >
 > >
 > > (defrule i_30_fill-fields "fill - + saliencia"
 > >  ?ini <- (proc ?y TRUE)
 > >  ?fact-url <- (web-page
 > >   (URL ?y)
 > >    (title ?a)
 > >   (description ?g)
 > >   (meta-keywords ?h)
 > >    (contents ?b)
 > >    (contents-without-tags ?c)
 > >    (text-centroid ?d)
 > >    (links  $?l)
 > >   (links-texts $?t)
 > >    (emails $?e)
 > >    (terms $?t)
 > >   (frequencies $?f)
 > >   (status valid))
 > >  =>
 > >   (modify ?fact-url
 > >    (title (call ?*page* titulo))
 > >    (description (call ?*page* descricao))
 > >    (meta-keywords (call ?*page* metaPalavrasChave))
 > >    (summary (call ?*page* sumario))
 > >    (text-centroid (call ?*page* centroideTexto))
 > >    (contents (call ?*page* conteudo))
 > >   (contents-without-tags (call ?*page* conteudoSemTagAcent))
 > >    (emails (call ?*page* a_emails))
 > >    (links  (call ?*page* a_links))
 > >   (links-texts (call ?*page* a_textoLinks))
 > >    (frequencies (call ?*page* a_freqs))
 > >    (terms (call ?*page* a_termos))
 > >   (shown-lines (call ?*page* a_linhas))
 > >   (status stored))
 > >  (retract ?ini))
 >
 >
 > Instead of it, you may build rules as you state queries in a DB, just
> putting in the LHS what is really
 > necessary to the firing:
 >
 > > (defrule i_30_fill-fields "fill - + saliencia"
 > >  ?ini <- (proc ?y TRUE)
 > >  ?fact-url <- (web-page
 > >   (URL ?y))
 > >  =>
 > >   (modify ?fact-url
 > >    (title (call ?*page* titulo))
 > >    (description (call ?*page* descricao))
 > >    (meta-keywords (call ?*page* metaPalavrasChave))
 > >    (summary (call ?*page* sumario))
 > >    (text-centroid (call ?*page* centroideTexto))
 > >    (contents (call ?*page* conteudo))
 > >   (contents-without-tags (call ?*page* conteudoSemTagAcent))
 > >    (emails (call ?*page* a_emails))
 > >    (links  (call ?*page* a_links))
 > >   (links-texts (call ?*page* a_textoLinks))
 > >    (frequencies (call ?*page* a_freqs))
 > >    (terms (call ?*page* a_termos))
 > >   (shown-lines (call ?*page* a_linhas))
 > >   (status stored))
 > >  (retract ?ini))
 >
 > The only necessary predicate was the identification of the instance! I
> also found the expensive practice
 > of the 1st rule in Mark Watson's "Intelligent Java Applications". I just
> discovered it because there
 > were very few rules that needed the status slot, so I had to update it.
> But the rules which were
 > changing the slot had a reference to the slot in their LHS. After I
> removed these references ... it
 > takes less than a second! I suggest  this could be included in Jess' FAQ
> as a good designing rule
 > practice.
> 
 

---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to