I know in prolog we ask for is that true or false , can we also do compute for example average and how the predicate look like?
2 Answers
4
votes
3
votes
Prolog does not ask if something is true of false. That is a common misconception. Prolog tries to unify query goals with program predicates. If it succeeds, it returns an assignment to the variables appearing in the query. If it fails - Which is not supposed to be the common case - It returns "false".
As for averages, see 3electrologos' answer.