I am using fuzzyCLIPS 6.31 and I want to have a fact that is a collection (of other facts). Currently, I have something like this:
(deftemplateperson"attributes of a person"(multislotname(typeSTRING))(slotage(typeFLOAT)(range0.0129.9)(default0))(slotgender(typeSYMBOL)(allowed-symbolsmalefemale));..otherattributes)(deftemplatepeople"collection of people";terminatingcharseparatedstringofstringrepresentationofperson;e.g."John Frederick Handel, 42.5, male, ....;Homer Jay Simpson, 45.2, male, ..."(slotmembers(typeSTRING)))(defrulemake-person-and-add-to-group;makeapersonfact;amendpreviouslyassertedpeoplefactbyadding"stringified"persontopeoplefact)(defrulepredict-a-riot;IFwehave(fuzzy)"too"manymalesinagroupAND;themalesareabovetheageof'X'AND;someothersalientfacts;=>THEN;assertriotpredictionwithCF)
This could be an example of a simplistic expert system that attempt to predict the likelihood of a riot breaking out, based on some simplistic input variables and heuristics.
I have the following questions:
Is "stringifying" facts (concatenating and then parsing/groking the resulting string) a good/acceptable way of dealing with lists (or collections) of facts ?
How does one access and manipulate the string held in a slot of a fact?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am using fuzzyCLIPS 6.31 and I want to have a fact that is a collection (of other facts). Currently, I have something like this:
This could be an example of a simplistic expert system that attempt to predict the likelihood of a riot breaking out, based on some simplistic input variables and heuristics.
I have the following questions:
Create a unique id for each person fact and store that in your collection rather than the content of the fact.
The general pattern then for doing something to each member of the collection is: