Handbook
Glossary
unify* ( x x-env y y-env trail tmp-env -- success? )
Vocabulary
logic
.
private
Inputs
x
an
object
x-env
an
object
y
an
object
y-env
an
object
trail
an
object
tmp-env
an
object
Outputs
success?
an
object
Definition
USING:
assocs
formatting
io
kernel
math
namespaces
prettyprint
;
IN:
logic.private
::
unify*
( x x-env y y-env trail tmp-env -- success? )
*trace?*
get-global
:>
trace? 0
:>
depth! trace?
[
*trace-depth*
counter
depth! depth
[
"\t"
printf
]
times
"Unification of "
printf
x-env x
of
pprint
" and "
printf
y
pprint
nl
]
when
x x-env y y-env trail tmp-env
(unify*)
:>
success? trace?
[
depth
[
"\t"
printf
]
times
success?
[
"==> Success\n"
]
[
"==> Fail\n"
]
if
"%s\n"
printf
*trace-depth*
get-global
1
-
*trace-depth*
set-global
]
when
success?
;
inline