topheader Welcome 18.188.241.82 @ xps.scios.ch on Fri Apr 26 23:31:52 UTC 2024
topheader
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

clips:clip2pk5 [2010/01/04 19:46] (current)
Line 1: Line 1:
 +
 +<​HTML>​
 +<​HEAD>​
 +<META HTTP-EQUIV="​Content-Type"​ Content="​text/​html;​ charset=Windows-1252">​
 +<​TITLE>​DEFRULE</​TITLE>​
 +</​HEAD>​
 +
 +<BODY BGCOLOR="#​FFFFFF"​ TEXT="#​000000">​
 +
 +<OBJECT TYPE="​application/​x-oleobject"​ CLASSID="​clsid:​1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">​
 + <PARAM NAME="​Keyword"​ VALUE="​DEFRULE">​
 +</​OBJECT>​
 +
 +<​H1><​A NAME="​defrule"></​A>​DEFRULE</​H1>​
 +
 +<​P>​One of the primary methods of representing knowledge in CLIPS is a rule.  </P>
 +
 +<P>A rule is a collection of conditions and the actions to be taken if the </P>
 +
 +<​P>​conditions are met.  The developer of an expert system defines the rules </P>
 +
 +<​P>​which describe how to solve a problem. ​ Rules execute (or fire) based on </P>
 +
 +<​P>​the existence or non-existence of facts. ​ CLIPS provides the mechanism </P>
 +
 +<​P>​(the inference engine) which attempts to match the rules to the current </P>
 +
 +<​P>​state of the system (as represented by the fact-list) and applies the </P>
 +
 +<​P>​actions. ​ </P>
 +
 +<​PRE><​CODE>​(defrule &​lt;​rule-name&​gt;​ [&​lt;​comment&​gt;​]
 +    [&​lt;​declaration&​gt;​] ​             ​
 +    &​lt;​conditional-element&​gt;​* ​      
 +=&gt;
 +    &​lt;​action&​gt;​*)  ​
 +</​CODE></​PRE>​
 +
 +<​P><​B><​U>​DECLARATIONS</​U></​B></​P>​
 +
 +<​PRE><​CODE>&​lt;​declaration&​gt; ​          ::= (declare &​lt;​rule-property&​gt;​+)
 +
 +&​lt;​rule-property&​gt; ​        ::= (salience &​lt;​integer-expression&​gt;​) |
 +                            (auto-focus &​lt;​boolean-symbol&​gt;​)
 +</​CODE></​PRE>​
 +
 +<​P><​B><​U>​CONDITIONAL ELEMENTS</​U></​B></​P>​
 +
 +<​PRE><​CODE>&​lt;​conditional-element&​gt; ​  ::= &​lt;​pattern-CE&​gt;​ | &​lt;​assigned-pattern-CE&​gt;​ | 
 +                            &​lt;​not-CE&​gt;​ | &​lt;​and-CE&​gt;​ | &​lt;​or-CE&​gt;​ |
 +                            &​lt;​logical-CE&​gt;​ | &​lt;​test-CE&​gt;​ |
 +                            &​lt;​exists-CE&​gt;​ | &​lt;​forall-CE&​gt;​
 +
 +&​lt;​test-CE&​gt; ​              ::= (test &​lt;​function-call&​gt;​)
 +
 +&​lt;​not-CE&​gt; ​               ::= (not &​lt;​conditional-element&​gt;​) ​
 +
 +&​lt;​and-CE&​gt; ​               ::= (and &​lt;​conditional-element&​gt;​+)
 + 
 +&​lt;​or-CE&​gt; ​                ::= (or &​lt;​conditional-element&​gt;​+)  ​
 + 
 +&​lt;​exists-CE&​gt; ​            ::= (exists &​lt;​conditional-element&​gt;​+)
 +
 +&​lt;​forall-CE&​gt; ​            ::= (forall &​lt;​conditional-element&​gt;​
 +                                    &​lt;​conditional-element&​gt;​+)
 +
 +&​lt;​logical-CE&​gt; ​           ::= (logical &​lt;​conditional-element&​gt;​+)
 +</​CODE></​PRE>​
 +
 +<​P><​B><​U>​PATTERN CONDITIONAL ELEMENT</​U></​B></​P>​
 +
 +<​PRE><​CODE>&​lt;​assigned-pattern-CE&​gt;::​= ​   ?&​lt;​variable-symbol&​gt;​ &lt;- &​lt;​pattern-CE&​gt;​
 +
 +&​lt;​pattern-CE&​gt; ​        ::​= ​   &​lt;​ordered-pattern-CE&​gt;​ | 
 +                            &​lt;​template-pattern-CE&​gt;​ |
 +                            &​lt;​object-pattern-CE&​gt;​
 +
 +&​lt;​ordered-pattern-CE&​gt;​ ::=    (&​lt;​symbol&​gt;​ &​lt;​constraint&​gt;​*)
 +
 +&​lt;​template-pattern-CE&​gt;::​= ​   (&​lt;​deftemplate-name &​lt;​LHS-slot&​gt;​*)
 +
 +&​lt;​object-pattern-CE&​gt; ​ ::=    (object &​lt;​attribute-constraint&​gt;​*)
 +
 +&​lt;​attribute-constraint&​gt; ​ ::= (is-a &​lt;​constraint&​gt;​) |
 +                            (name &​lt;​constraint&​gt;​) |
 +                            (&​lt;​slot-name&​gt;​ &​lt;​constraint&​gt;​*)
 +
 +&​lt;​LHS-slot&​gt; ​             ::= &​lt;​single-field-LHS-slot&​gt;​ | 
 +                            &​lt;​multifield-LHS-slot&​gt;​
 +
 +&​lt;​LHS-slot&​gt; ​             ::= &​lt;​single-field-LHS-slot&​gt;​ | 
 +                            &​lt;​multifield-LHS-slot&​gt;​
 +
 +&​lt;​single-field-LHS-slot&​gt;​ ::= (&​lt;​slot-name&​gt;​ &​lt;​constraint&​gt;​)
 +
 +&​lt;​multifield-LHS-slot&​gt; ​  ::= (&​lt;​slot-name&​gt;​ &​lt;​constraint&​gt;​*)
 +</​CODE></​PRE>​
 +
 +<​P><​B><​U>​PATTERN CONSTRAINTS</​U></​B></​P>​
 +
 +<​PRE><​CODE>&​lt;​constraint&​gt; ​           ::= ? | $? | &​lt;​connected-constraint&​gt;​
 +
 +&​lt;​connected-constraint&​gt;  ​
 +             ::= &​lt;​single-constraint&​gt;​ |
 +                 &​lt;​single-constraint&​gt;​ &amp; &​lt;​connected-constraint&​gt;​ |
 +                 &​lt;​single-constraint&​gt;​ | &​lt;​connected-constraint&​gt;​
 +
 +&​lt;​single-constraint&​gt; ​    ::= &​lt;​term&​gt;​ | ~&​lt;​term&​gt;​
 +                     
 +&​lt;​term&​gt; ​              ::= &​lt;​constant&​gt;​ | 
 +                         &​lt;​single-field-variable&​gt;​ |
 +                         &​lt;​multifield-variable&​gt;​ |
 +                         :&​lt;​function-call&​gt;​ |
 +                         ​=&​lt;​function-call&​gt;</​CODE></​PRE>​
 +
 +</​BODY>​
 +</​HTML>​
  
 
 
clips/clip2pk5.txt ยท Last modified: 2010/01/04 19:46 (external edit)
topheader
© 1998-2021, SciOS Scientific Operating Systems GmbH

Legal | Credits | Profile | Contact | Customer Login