Pop-Up Thingie
Sidebar
>>> Magnum BBS <<<
Home
Forum
Files
Dark
Log in
Username
Password
Sidebar
Forum
Usenet
COMP.LANG.PROLOG
nephew(N) ............... almost as powerful as prolog
From
Graham Cooper
@21:1/5 to
All
on Sun Feb 19 15:36:48 2023
TRYING OUT ALL VALUES to get a true result is the HEART of PROLOG
Here we do it in an imperative language with small code
nephew3 brad [?]
YES
nelly nellyson
--------------------------- TRACE --------------------
4 nephew3 brad
P=brad
nephew3 brad
4 1 sibling P A
6 sibling brad A
A=mary
sibling brad mary
4 2 if
4 3 kid A B
4 8 clear A
4 9 clear B
4 10 next
4 11 nephew3 P
4 nephew3 brad
P=brad
nephew3 brad
4 1 sibling P A
7 sibling brad A
A=nelly
sibling brad nelly
4 2 if
4 3 kid A B
10 kid nelly B
B=nellyson
kid nelly nellyson
4 4 print A
4 5 print B
4 6 echo newline
4 7 endif
4 8 clear A
4 9 clear B
4 10 next
4 11 nephew3 P
4 nephew3 brad
P=brad
nephew3 brad
4 1 sibling P A
-------------------------- CODE -------------------------
THIS IS LIKE
nephew(N K)
:-
sibling(N A)
kid(A K)
------
nephew3 P
-sibling P A
-if
-kid A B
-print A
-print B
-echo newline
-endif
-clear A
-clear B
-next
-nephew3 P
sibling alan zeta
sibling brad mary
sibling brad nelly
sibling carl tom
kid alan joe
kid nelly nellyson
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)
Who's Online
System Info
Sysop:
Keyop
Location:
Huddersfield, West Yorkshire, UK
Users:
302
Nodes:
16 (
2
/
14
)
Uptime:
81:29:40
Calls:
6,762
Files:
12,289
Messages:
5,378,185