Handbook
Glossary
(rule) ( head body pos -- )
Vocabulary
logic
.
private
Inputs
head
an
object
body
an
object
pos
an
object
Outputs
None
Definition
USING:
accessors
arrays
combinators
kernel
sequences
vectors
;
IN:
logic.private
::
(rule)
( head body pos -- )
reset-anonymouse-var-no
head
replace-'__'
def>goal
:>
head-goal body
replace-'__'
normalize
split-body
pos
at-the-beginning
=
[
reverse
]
when
dup
empty?
[
head-goal
swap
2array
1vector
head-goal
pred>>
[
pos
at-the-end
=
[
swap
]
when
append!
]
change-defs
drop
]
[
f
:>
negation?!
[
[
{
{
~quotation~ ~quotation~
}
{
~quotation~ ~quotation~
}
{
~quotation~ ~quotation~
}
{
~quotation~ ~quotation~
}
{
~quotation~ ~quotation~
}
[
drop
dummy-item
f
negation?!
]
}
cond
]
map
dummy-item
swap
remove
:>
body-goals
V{
{
head-goal body-goals
}
}
head-goal
pred>>
[
pos
at-the-end
=
[
swap
]
when
append!
]
change-defs
drop
]
each
]
if
;