--
You received this message because you are subscribed to the Google Groups "CLIPSESG" group.
To post to this group, send email to CLIP...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/CLIPSESG?hl=en
--> IF YOU NO LONGER WANT TO RECEIVE EMAIL <--
Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
Click on "Edit my membership" link.
Select the "No Email" radio button.
Click the "Save these settings" button.
--> IF YOU WANT TO UNSUBSCRIBE <--
Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
Sign in
Click on "Edit my membership" link.
Click the "Unsubscribe" button.
Note: This appears to be the most reliable way to unsubscribe
Alternately, send email to CLIPSESG-u...@googlegroups.com. You will receive an email which you must respond to as well to unsubscribe. Clicking the link mentioned in the unsubscribe reply does not appear to work reliably.
---
You received this message because you are subscribed to the Google Groups "CLIPSESG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clipsesg+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clipsesg/a68ed127-860e-fdb6-16ab-530ed2703354%40my.liu.edu.
To view this discussion on the web visit https://groups.google.com/d/msgid/clipsesg/dddc1c9e-fe2c-40ad-bf77-25c7a18417e1n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clipsesg/4d3b1748-d4ec-43c3-8ad4-559bde4b79f8n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clipsesg/39000559-299e-4230-b9e0-8f0709396e02n%40googlegroups.com.
Yes, this is great if your correct solution just pops out at you and you do not have to DEVELOP it.
In this sample, I would comment out a bunch of it and verify it works in small pieces.
You need TDD (test driven development).
Set up a SMALL fact list that will fire one SIMPLE rule and verify it works. TC001
(deftemplate point (slot id) (slot x) (slot y))
(deffacts points
(point (id A) (x 2) (y 5))
(point (id B) (x 5) (y 5)))
(deffunction distance (?x1 ?y1 ?x2 ?y2)
(sqrt (+ (** (- ?x1 ?x2) 2) (** (- ?y1 ?y2) 2))))
(defrule rule_TC001 “isAngle”
(point (id ?a) (x ?ax) (y ?ay))
(point (id ?b) (x ?bx) (y ?by))
= >
(println “Distance is “ (distance ?ax ?ay ?bx ?by))
)
I am printing out the first usage of the distance formula so that you see if it is accurate. VERIFY IT.
I would keep rule_TC001 UNCHANGED forever. Even as you copy rule_TC001 to another TC and add more complications to it, you need to be able to regression test this thing, keep all these simple test case rules, and when things go wrong, rerun them so you can see which of the simple test cases still run when you messed it up in TC034 or whatever.
for TC002, I would make the distance formula part of the CE.
(defrule rule_TC002 “isAngle2”
(point (id ?a) (x ?ax) (y ?ay))
(point (id ?b) (x ?bx) (y ?by))
(test (= 3 (distance (distance ?ax ?ay ?bx ?by))
= >
(println “Distance is 3” )
)
Yes, I know the distance between (2,5) and (5,5) is 3, so you are testing the “test distance” CE.
Make this TC002 and keep it forever. And keep TC001 forever too.
Even though this is a rules-based program, you must develop it sequentially.
Expert systems are not magic, they are developed.
Keep at it, add more test cases, one piece at a time, just like how you eat an elephant (American joke).
Now go back and add addition slots to the deftemple, new rule TC003.
Ron
To view this discussion on the web visit https://groups.google.com/d/msgid/clipsesg/DM5PR11MB000950448050F4A2E905E1D2DFDD9%40DM5PR11MB0009.namprd11.prod.outlook.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clipsesg/4d3b1748-d4ec-43c3-8ad4-559bde4b79f8n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clipsesg/7fc6849b-ce4b-44f3-8f95-6fed2c04a043n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clipsesg/40dccc5e-6452-4df0-a46b-8d61e9eaa593n%40googlegroups.com.