Hello World in Prolog
Every programming journey starts with Hello World. Let’s write our first Prolog program and get our first taste of logic programming.
The Code
Create a file named hello.pl:
| |
Every programming journey starts with Hello World. Let’s write our first Prolog program and get our first taste of logic programming.
Create a file named hello.pl:
| |
Prolog’s data model is radically different from mainstream languages. There are no typed declarations, no assignment statements, and no primitive/object divide. Instead, everything is a term, …
Read more →In most languages an operator like + quietly computes something. In Prolog, that assumption will trip you up. Prolog is a logic language, so 1 + 2 is not the number 3 — it is a term, a tree with the …
Control flow in Prolog looks nothing like the if/for/while machinery of imperative languages — and that is the whole point. Prolog is a logic programming language, so the engine’s default …
Showing 1–4 of 4 posts (page 1 of 1)