# chapter08 - Chapter 8: Advanced Pattern Matching Expert...

This preview shows pages 1–9. Sign up to view the full content.

Chapter 8: Advanced Pattern Matching Expert Systems: Principles and Programming, Fourth Edition

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Expert Systems: Principles and Programming, Fourth Edition 2 Field Constraints In addition to pattern matching capabilities and variable bindings, CLIPS has more powerful pattern matching operators. Consider writing a rule for all people who do not have brown hair: We could write a rule for every type of hair color that is not brown. This involves testing the condition in a roundabout manner – tedious, but effective.
Expert Systems: Principles and Programming, Fourth Edition 3 Field Constraints The technique for writing a rule for all non- brown hair colors implies that we have the ability to supply all hair colors – virtually impossible. An alternative is to use a field constraint to restrict the values a field may have on the LHS – the THEN part of the rule.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Expert Systems: Principles and Programming, Fourth Edition 4 Connective Constraints Connective constraints are used to connect variables and other constraints. Not connective – the ~ acts on the one constraint or variable that immediately follows it. Or constraint – the symbol | is used to allow one or more possible values to match a field or a pattern. And constraint – the symbol is useful with binding instances of variables and on conjunction with the not constraint.
Expert Systems: Principles and Programming, Fourth Edition 5 Combining Field Constraints Field constraints can be used together with variables and other literals to provide powerful pattern matching capabilities. Example #1: This constraint binds the person’s eye color to the variable, ?eyes1 if the eye color of the fact being matched is either blue or green. Example #2: This constraint binds the variable ?hair1 if the hair color of the fact being matched is not black.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Expert Systems: Principles and Programming, Fourth Edition 6 Functions and Expressions CLIPS has the capability to perform calculations. The math functions in CLIPS are primarily used for modifying numbers that are used to make inferences by the application program.
Expert Systems: Principles and Programming, Fourth Edition 7 Numeric Expressions in CLIPS Numeric expressions are written in CLIPS in LISP-style – using prefix form – the operator symbol goes before the operands to which it pertains. Example #1: 5 + 8 ( infix form ) + 5 8 ( prefix form ) Example #2: (infix) (y2 – y1) / (x2 – x1) > 0 (prefix) (> ( / ( - y2 y1 ) (- x2 x1 ) ) 0)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Expert Systems: Principles and Programming, Fourth Edition 8 Return Values Most functions (addition) have a return value that can be an integer, float, symbol, string, or multivalued value. Some functions (
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 05/12/2010 for the course IT expert sys taught by Professor Dr. during the Spring '10 term at Dubai Aerospace Enterprise University.

### Page1 / 45

chapter08 - Chapter 8: Advanced Pattern Matching Expert...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online