Grain of Salt - November 16th, 2010 [entries|archive|friends|userinfo]
snauts

[ userinfo | sc userinfo ]
[ archive | journal archive ]

November 16th, 2010

SICP [Nov. 16th, 2010|05:06 pm]
Vispār es biju redzējis, ka prologā var visādas perversijas, tur tipo:
> (append (a b) (c d) ?x)
?x = (a b c d)

> (append ?x (c d) (a b c d))
?x = (a b)

> (append (a b) ?x (a b c d))
?x = (c d)

vai:
> (append ?x ?y (a b c d))
?x = (), ?y = (a b c d)
?x = (a), ?y = (b c d)
?x = (a b), ?y = (c d)
?x = (a b c), ?y = (d)
?x = (a b c d), ?y = ()

bet tas ko es ieraudzīju SICPā ka tur var rakstīt:
> (?x (a b) (c d) (a b c d))
?x = append

mani vienkārši satrieca.
link2 comments|post comment

bug in my prolog program [Nov. 16th, 2010|08:34 pm]
great grandson == great great son == great great great same
linkpost comment

navigation
[ viewing | November 16th, 2010 ]
[ go | Previous Day|Next Day ]