3 ms·
In general, Prolog is extremely well suited for tasks where partial information needs to be taken into account. The presence of logic variables, i.e., "true" v
by triska 7y ago
In general, Prolog is extremely well suited for tasks where partial information needs to be taken into account.
The presence of logic variables, i.e., "true" variables in the sense of logic, is one of the defining characteristics of logic programming languages like Prolog. In comparison, what other programming languages call a "variable", is not really a variable but just some concrete value. In contrast, a logic variable truly stands for anything at all and may be bound to any term (in its domain).
For this reason, Prolog is especially well suited for data that has "holes" in it. For example, Prolog was successfully used to investigate the folding structure of DNA, where hypotheses were available about some aspects, but the overall structure of parts was yet unknown. A Prolog specification allows to "leave out" parts of the specification that are unknown.
Hence, a map generation task where some constraints are specified sounds like a very nice project and potentially great application for a logic programming language. Enjoy!
- hjek 7y agoIt's interesting how Prolog has no concept of 'null' as such; just fresh variables whose value we don't know (yet). No more null pointer exceptions!
- harperlee 7y agoIn fact, in some domains (such as SQL), ‘null’ stands for values we dont know: https://modern-sql.com/concept/three-valued-logic https://modern-sql.com/concept/three-valued-logic
- hjek 7y agoYes, looks like SQL got that right as well. I think Prolog is the answer to the question: What if the full stack was relational; not just the database?