Comitted-Choice234769:8;<5=6>?

AB EC GF0H
IKDN @NLMJ1,§. , (ï, Fleng ¤}«(Í×ê1di(ßÚHª }ZT{§. @e,Committed-Choice ]di«(Í×ê1¤Ó ÚH(åæªêlÚHk|ûs, êlª¦¥$>9ªèHRq§¤|åæª#0>0ÚHªz§ãj{§.
¦, á³]´cÐ|£ ÌèHºª°Y
Rq-Ødi{§. (ï, ÚHª }+>(è èHRq6+9'|¤¦, Fortran èH,#Hô@| Fortran èH,#</8k</8¤}+>(èH4ª«óS¦A`V|. [n, Committed-Choice ]dY|.
i(U{§ Fleng  for 9>2ZmçªÔ×§¤¦, +>(èH4ªO2;"85ªkAD ¤§. ¨¥cÐ·8_, 9>2ZmçRq§Tð|ît§.
ªÔ×§¤¦8_g%§. Õ, 9>2
¥+>(èH4ª°Y§bW Fortran èH,#
2 Committed-Choice npq Fleng</82
áüDbW¨¦, bWFleng I@]diªÃ¿§èHrô@di{§. %<()!& Prolog £DN|§, .) ª±¼li§-Ø§.
!,8)!ªq©||}·, '4<*!& 3 yzx{~rÎ&§. Committed-Choice ]di, Ë GHC, Q¤}mçªO for 9>2Zmçª Fleng ÔKL1 {§, Fleng  GHC ¥ >-$>9ª×§.
S¦÷|£ÆÒ§.
sum(Vec,Size,R):Fleng ,(for I = 1 to Size init Sum = 0, V = Vec do $>9ªèHRq§.
element(I,V,Elm), «(Í×ê1ªi|+>(1;>Óª§.
next Sum is Sum + Elm
finally R = Sum).
¤¦, 2;"85OèH4ªÎE°Y-Ø{§.
2;"85, ÚH Vec Î Size ª×F!+Gª{¥¾_§=, ÚHÂjÄJª R YF§£{§. 'foo(A,R):- add(A,1,B), mul(B,2,R).
4<*!&±´©§²¦{§. , nextäê1, Id 1]diÓh, Q[¦2;"85 R = (A + 1) * 2 ªRq§£ì^ÁKø¨§ê1{§ª$\§.
{§. Fleng  §^L«"$>9e¨§.
2;"85ûs, foo(A,R) |}õ$>9 ­õ, init Öq}.
ê1&#>2, [´9>2Ö;>9{f~¥¨§, add(A,1,B), mul(B,2,R) |} 2 §.
9>2 ê1ª9>2ÖMi|ûs, init$>9ö~¥¨§. ö~¥¨ add  mul¨¨èHRq¨§. , ûs, mul ÖÀd§. G~úG, init Ö V = Vec
ï B ­_³§¡Rq§|. {§, 9>2  Vec ª9>2¯ V |}¤}ûs, add RqXC B ­_¡§¡ ê1!'&§. ¨! ê1, G~ Elm
, mul Rqª¯¬, add RqXC B ­ 9>2(:>%7<éê1 ©¨§.
9>2ªÝ g, nally !+ªRq, next Wÿ_³§, Rqªw §. mª]òRc§¢, ê1«(Í×{¦, ö~§ ¨ê1xg­ª9>2 V ¹. úGûs, 9>2Ö^L­ Sum ª9>2 ê|.
¤}mªi|§, Fleng á³]´ 1 R ¹|§.
2;"85¥£ÎEèH4ª°Y§ 4 RtwzmIntroduction of loop syntax to committed-choice lanFleng «(Í×Èªi||§¢, (åæªêlguagesÚHk|ûs, êl|åæª#0>01SOUQ

Takuya ARAKI, Hidehiko TANAKA
School of Engineering, the University of TokyoÚHªz§ãj{§. £¨ªq©, Ù Í×¤§l0ªqûs, j`.ªYF§Ø4{§. G~,Vec = {1,2,3},element(1,Vec,Elm),
set_element(1,Vec,100,NewVec)¤}2;"85ëªo~§. , set element(Pos,Vec,NewElm,NewVec) , Vec  Pos àbª NewElm 0|ÚH NewVec ªì£§.  set element ªÙ Í×Rcûs, element Rq set element ¤¦g{l0g­ªS¦Y¡|, j`.ªYF¡}.
, l0Åzªq}P·ÚHªKø|§$>9Êy ¨, Ù Í×ª£m©|. , úGûs, 2;"85ª!+¤}ê§.
Vec = {1,2,3},
get_element(1,Vec,Elm,Vec1),
assign_element(1,Vec1,100,NewVec)(for I = 1 to 100 init V = Vec do
get_element(I,V,VE,V1), RE is VE * 2,assign_element(I,V1,RE,next V)
finally Res = V), 9>23+>ÅzkA¢, ça [1] ¤}Tð<8<¶ ¨§o~§. ûs, 9>2Rq®Qq©¨§. , 2;"85ÚHjÄª 2 Û§|}$\, 9>2[¦ìèHRq-Ø{§. , 2;"85ªQ¤} 2 æ§.
(for I = 1 to 50 init V = Vec do
get_element(I,V,VE,V1), RE is VE * 2,assign_element(I,V1,RE,next V)
finally Tmp1 = V),(for I = 51 to 100 init V = Vec do
get_element(I,V,VE,V1), RE is VE * 2,assign_element(I,V1,RE,next V)
finally Tmp2 = V),(wait(Tmp1)-> Res = Tmp2)

¤}æ§¤¦, I  1 ? 50 ¡ 51? 100 ¡ªèHRq§. , ¨¨ªèHRq-Ø§¢, æ9>2 nally¤¦YF¨§ê1ª¹||. ©, gÞ9>2£ Tmp1  Vec  V ªõ,§. ¡, Res ªKø§P·l0X|§ãj{§¢, wait ªi|¨ªíù|§.
, ¤}9>2æü-Ø© |. ¡, next Wÿ¨|§ê1, #0>÷X¤¦Ù Í×¨|, [¦ìÓÚHªKø|§ãj{§. ¡, Ù Í×ª]òq}¢, &§[¦ì, ÓjÄKø, Íelement(Pos,V,Elm),% (1)×{¥|. ¨, èH,#</8
set_elenet(1,V,2,V1), % (2)§[¦ìªf#Ê\8»ÂÓþY{element(2,V1,Pos)% (3)§. , GCD *&,èH,#</8¤}ûs, Pos ª² (3)!(1) |}#Ê\ DbW¨|§Tðª¡¡li§Êy§. ,  Óh (1) ª get element §.
ê§, (1)!(2) |}#Ê\ªz¡}. 6 TPU
V1 ª² (2)!(3) |}#Ê\£Êy§¢, (1)Committed-Choice ]di Fleng 9>2Zmç! (2)!(3)!(1) |}ñ´#Ê\ªz¡Ô×, xµ,Tð|Z. vg/Ð|, +)-;)!§.
, [nZ¤}xµ,ªq}2;"85ªR
Tðªi|#0>÷Xªq}ûs, +>( Ç§{¥¨§.
#Ê\ª8», ¤}ñ´#Ê\ª6|so|ªíù§ãj{§.
[1] paÑd, ¸¯*â. Committed-choice ]di eng
5 vzuR }<8<¶ ¤§Bº3hTð. ýîô@Î 100 ÚH Vec jÄª 2 ÛÚH Res ª65
7Ï 53 9ÂuÎ7, Vol. 1, No. 3E-8, pp. 347{348,§¤}, !+2;"85ëªo~§. 2;"
September 1996.
85Á½Z#0>÷Xªq{§.

, get element(Pos,Vec,Elm,NewVec) , Vec
 Pos àbªKø, ¨C¥ NewVec ª Vec
ÉÜ§£{§§. , set elementªRq§P·, Vec ªKø|§$>9Êy
|, Ù Í×£m©|. ¢, setelement ªÙ Í×ªq}Zi assign element ö~§§.
, ¤}ê2;"85®Q,ª$\§¢, +)-;)!ª)-Ø4{§. G~,