Goals produce their resulting substitutions one by one, as if by yield in Python.
alwaysO is defined so that it produces an infinite stream of copies of its input substitution, unchanged. But it produces them one by one.
Then run feeds this stream from its first goal, to the second goal, #u, which rejects it. Since run 1 demands one solution from its subgoals, it retries them until one solution / substitution goes through.
Which never happens.
So this should result in infinite looping.
Again, both arms are tried -- first, the first one; then, after its (one) result gets rejected by the subsequent #u, the second arm is tried. And the resulting substitution gets rejected, again. Ad infinitum:
;; we have
(defrel (alwayso)
(conde
(#s)
((alwayso))))
;; running:
(run 1 q
(alwayso)
#u)
=
(run 1 q
(conde ; (a OR b) , c
(#s)
((alwayso)))
#u)
=
(run 1 q ; (a , c) OR (b , c)
(conde
(#s #u)
((alwayso) #u)))
=
(run 1 q
(alwayso)
#u)
=
.....
Getting stuck.