Hello!
I have such a problem on the use of Prolog. It is necessary to find whether A and B are connected and to go through all possible steps on the way from A to B, but here you need to use a predicate with 2 atoms and only that. How to do it better?
можнодобраться(А,Б) :- связана(А,Б); (связана(А,В), связана(В,Б)); (связана(А,В), связана(В,Г), связана(Г,Б). Something like that, just somehow it is necessary that in the place where (C and D ... queries were going on with other paths until G and B are found, somehow, I understand that there is a recursion, I just Prolog never worked, and here the task.