|
|
|
|
|
by kyllo
4189 days ago
|
|
You're implying that the opposite of "imperative" is "nondeterministic." That's incorrect. Prolog is declarative as opposed to imperative. User source code declares rules/constraints, and the Prolog compiler performs a search algorithm to arrive at a solution that satisfies the constraints. |
|
Let me explain:
Given the same input Prolog program and imperative (Pascal?) one will give the same results. Because Prolog is imperative.
Non-imparative languages give estimated results (actually I don't know any of these). Why? Because for example data is too large to do simple things like counting all elements. Thats non-imperative. Result is no longer based on what is in the data space, but based on its characteristics. For example, you may calculate a number of helium atoms in a cubic inch, but you will never do such thing like counting them one by one (imperative way).