I need some help with a CLIPS question. This is the problem:
"Assume that a CLIPS database contains facts that are instantiations of the following template:
(deftemplate recommendation
(slot name)
(slot message)
(slot rating)
)
Write CLIPS rule to print messages in descending order according to rating. Each message is to be printed along with its associated name and rating."
I know the sort rule when there is a list such as:
(deffacts testlist
(list 1 4 2 3 5 8 7 6 9 0)
)
(defrule sort
?f <- (list $?head ?a ?b&:(< ?b ?a) $?tail)
=>
(retract ?f)
(assert (list $?head ?b ?a $?tail))
)
But I am not sure when is it in the deftemplate format. Can someone help please?