Groups
Sign in
Groups
comp.lang.prolog
Conversations
About
Send feedback
Help
info
Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss
Learn more
kid(P K) working.... using OR(A B)
1 view
Skip to first unread message
Graham Cooper
unread,
Feb 20, 2023, 4:46:00 AM
2/20/23
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
In this example we use OR() to calculate son(P K) or daughter(P K)
kid mary [?]
YES
dot mary maryson
maryson
2 kid mary
C=mary
X=
kid mary
2 1 or son dot X
1 or son dot X
A=son
B=dot
or son dot X
1 1 if
1 2 A C X
1 8 if
1 9 B C X
9 dot mary X
X=maryson
dot mary maryson
1 10 print B
1 11 print C
1 12 print X
1 13 echo newline
1 14 endif
2 2 print X
-------------------------------- CODE -----------------------
or A B X
-if
-A C X
-print A
-print C
-print X
-echo newline
-else
-if
-B C X
-print B
-print C
-print X
-echo newline
-endif
kid C X
-or son dot X
-print X
sis alan zeta
sis brad mary
bro brad nelly
bro carl tom
son alan joe
son nelly nellyson
dot mary maryson
son a b
dot c d
0 new messages