Next: inv Up: Beispiele in zwei Previous: attval

genints


rfi-p> 
style lisp
rfi-l> destroy
rfi-l> consult "/home/rfm/RFM/extensions/genints.rf"
; Reading file "/home/rfm/RFM/extensions/genints.rf" ..
rfi-l> listing
(ft (genints)
    0 )
(ft (genints)
    (genints `(_sign 0)) )
(ft (genints (_sign _n))
    (is _sign s)
    `(_sign _n) )
(ft (genints (_sign _n))
    (is _sign p)
    `(_sign _n) )
(ft (genints (_sign _n))
    (genints `(_sign (_sign _n))) )
rfi-l> style prolog
rfi-p> listing
genints() :-& 0.
genints() :-& genints(Sign[0]).
genints(Sign[N]) :- Sign is s & Sign[N].
genints(Sign[N]) :- Sign is p & Sign[N].
genints(Sign[N]) :-& genints(Sign[Sign[N]]).


Harold Boley & Michael Herfert (herfert@dfki.uni-kl.de)