Did you know ... | Search Documentation: |
Pack cosmos -- docs/guide4.txt |
x=double(1) y=x print(y)
In the logic paradigm, or logic programming (LP), which we follow to the letter, as our language is in fact a logic programming language, this is simply a set of statements.
We only have to take a moment to conclude that 2 will be written if we run the program, and it is.
2
If a paradigm is a way to look at a given program, the procedural paradigm looks at it imperatively. A program is a recipe, or list of instructions to be executed by the computer.
This paradigm follows the computer program closely. It's the closest to how the computer actually acts.
The following instructions would be executed.
This is on purpose, the language is made so that it can be reasoned or written in this style to some extent.
Though you may often simply see the program as a series of statements in the logic paradigm, it's sometimes needed to know how the computer executes them.
After all, the program runs in a computer.
We'll call this the "Logic-Procedural" paradigm (though it's a made-up term we invented). The Logic-Procedural interpretation of a program is given by how our procedural logic engine executes the logic program.
Often, the only reason we need to know this is so our program has good performance. An efficient program will run as quickly as it can and not consume many memory slots.
Most important for our language is the notion of a pure logic program.
Logic programs allow us to effectively write logical statements and have the language work them out correctly.
All you have to do is use pure relations! Then, your relation is also pure.