editor


tutorial




Logoi Tutorial (Part V):
Intermediate Logic Programming


"We are, doubtless, in the main logical animals, but we are not perfectly so."

Charles Sanders Peirce




;
; What is logic?
;

;
; Logic is the absence of emotional bias.
;




;
; "An Informal Review of Logic Programming"
;
; Imagine a recipe for a delicious meal: Ingredients + Instructions = Result
;

;
; "Traditional programming" is like cooking by looking only at the Instructions.
;

;
; "Logic programming" is like cooking by describing:
;
; 1. the Ingredients, then
; 2. the Result, then
; 3. logically deducing how to turn the Ingredients into the Result (without looking at the Instructions).
;

;
; Fortunately, for the average ape, the aforementioned process of logical deduction (3) is automated entirely by Prolog:
;

%  There are 55 onions.
; -> 'There are {1} {2}.'('55', 'onions').




Next: macros