From Graham Cooper@grahamcooper7@gmail.com to comp.lang.prolog on Thu Apr 20 03:24:23 2023
From Newsgroup: comp.lang.prolog
after 2 months fixed the prolog bug
DATA.txt
bro tom brad <-------------- try 1
friend brad fredy
bro tom bill <----------------try 2
friend bill fry
friend fry fryfry
rich gaga
pretty gaga
old gaga
daughter brad shelly
friend dob ellen <--------answer
daughter bill dob
PROGRAMS.txt
niece P NIECE
bro P BRO
daughter BRO NIECE
fon P F
niece P N
friend N F
you ask FRIENDOFNIECE tom X ?
and it finds 2 nieces until it finds a friend of one... after the ORANGE BOX it backtracks to re-run NIECE P N
it tries tom's other brother
fon tom X
fon P F
tom >> P
X << F
X >> F
P===tom
F===X
FIND : fon . tom . X .
TAILNUM 2-1 niece P N
P=<=tom
TAILQUERY: niece..tom..N
TAILFIND : niece . tom . N .
niece tom N
niece P NIECE
NIECE ::= N
N ::== NIECE
TAILNUM 1-1 bro P BRO
P=<=tom
TAILQUERY: bro..tom..BRO
TAILFIND : bro . tom . BRO .
bro tom BRO
bro tom brad