2 ms·
Does logic programming really count as flow control? To me, it's an entirely different paradigm, where there is no real flow at all; all statements operate simu
by rcfox 15y ago
Does logic programming really count as flow control? To me, it's an entirely different paradigm, where there is no real flow at all; all statements operate simultaneously.
- sp332 15y agoProlog might be a "logic programming" language, but the flow control is explicitly based on backtracking. Each possible solution for each statement is iterated, one at a time, and the results are fed into the next statements. The program is basically run as a search through the constraints in depth-first order. http://www.doc.gold.ac.uk/~mas02gw/prolog_tutorial/prologpages/search.html http://www.doc.gold.ac.uk/~mas02gw/prolog_tutorial/prologpag...
- muyuu 15y agoThey don't operate simultaneously. Order is not defined in some constructs, but it's still there and can also be forced.