prolog - Purpose of param in do-loops -


I'm learning to learn Prolog from the "Prolog" book. I am quite a newbie in Prolol.

R]), (Foreshem (e, matrix, [i, j]), the ultimate (transpose) subscript (transjees, [j, ii], e)). Play

:

  matrix = [] ([] (11,12), [] (21,22), [] (31,32 )), Moved (matrix, transposed). Results  
  matrix = [] ([] (11, 12), [] (21, 22), [] (31, 32)   

I do not understand the purpose of param

/ code>. Please help me understand. Thank you.

variable transpose listed param so that it does do / 2 should be available inside the loop.

Consider the do / 2 call macros as ECLIPs compiler turns them into assisted predictions.

Your Bill transpo Something like:

  Transfer (matrix, transjections): - dim (matrix, [r, c]), dim (transges, [c, r ]), Do__1 (..., transjees). Do__1 (..., transjees): -!! Do__1 (..., transges): - Forummusic, subscript (transjeges, [j, ii], e), dod_1 ( ..., transges).   

how do__1 actually looks for the ends of the foreachelem , I do not know. But in any case, all the variables in the param entry are added to the variable in the do__1 head, so they can be available within the predictive forecast. Without it, the transpose / 2 bills of do / 2 inside the loop transpose variable transpose outside of the variable Loop

Edit : A good introduction to do / 2 - Loop in ECLiPSe, in which very Can be found in Chapter 7 of "limited logic programming using CCLIPS" by Krzisstuff App and Mark Wallace.

Comments

Popular posts from this blog

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -