Counts the number of values retrieved by a query.
- A variable to be bound to the count.
- The variable whose bindings are to be counted.
- A non-ground clause containing ?variable.
(:COUNT ?numFriends ?friend (Friend MIKE ?friend))
(:PRINTLN "MIKE has " ?numFriends " friend(s)")
(:COUNT ?numInst ?inst (:INSTANCE Physical_Objects ?inst))
(:PRINTLN "There are " ?numInst " instances of Physical_Objects in the KB.")
Always succeeds. The countVariable will be zero if the
clause doesn't produce any values.
If clause does not contain the given variable,
the countVariable will be bound to 0.
Algernon Documentation Central
Algernon home page