Committed-Choice

457 Fleng 9<>=<>?A8:;B@C6DE
GH KI ML3N
PQJRFRO,VSXU1]fk
 ±(Öáð0©Þ°«ª¡"B<¬_C±" °ïWIr¬©«@ç»]½_Ù§ ¡ïWÂ°·NIr1ãfk~¬A IrTÂçý{¦ B/B3*.×  B/B3*.°J«÷¦ TÂ°× ¬ég~¬ ­d%
TÂ°× ¬Kô ?:?¿9 ì0"B<° "B<bu¬"B<bupª­¬ ºý?:?¿9 ÞÿaZ­¬üu¤1ã~¬¦ ¾f1ãüuçýù £ "B<bu2> :8$[°ð¬1ã2~¬¦ 2> :8ÈÔ,B)1>B7Ä°rég~« ×\2> :8¾f¬wà~¬Yo2> :8°?:?¿9 ¬^ð¬©« â$"B<°?:?¿91ã¬Kô°¼ ¬ Kô°¾f¬©« ×\2> :8§d%TÂ°× ¬1ã¬
2 Committed-Choice hjk FlengXQ]fk°ÉÆ¬ïWtöQfk~¬ $?)*&§UF¬ /*-:*°r¯À (7?+&× &¬]fk Ò~¬ ªB."B<°J«÷§ËÜ¬ ¡"B<°ïWIr¬ ±(Öáð0°f,B)1>BÞ°¬©« 2> :8G¡ïW2°·N1ã~¬VÅÕ²°Y¦¬2> :8!/©P
­¬Committed-Choice

Fleng,(Fleng)

,,.

,,.

,,

1

[1],,,.

,,,.

, Fleng,.

,.

Fleng.

prolog,,. Committed-Choice

KL1, Fleng,

GHC,GHC.

Fleng,.

.

,.

.

An inlineing-based granularity control method of acommitted-choice language Fleng
Takuya ARAKI, Hidehiko TANAKA
Faculty of Engineering,the University of Tokyo

abs(A,R) :- greater(A,0,IsGt),abs1(IsGt,A,R).
abs1(true,A,R):- R = A.
abs1(false,A,R):- sub(0,A,R).

xÎ°3*.ë +Î°6,Bëh"B<°°hN 1B­ ­­ïWIr­¬ ©«×  ° Ïä Ïä¬ ²©í üu°Irüu"B<°1B¬
Ir°9E¬¦ ²ég ²
IrLª`»­
Ir°9E©  ²`£üu #&5?.¬ ²`£¬+4-­¬ ©"B<ÞDÞ°¬£ CO.C`:-',.

, greater,. greater

.

IsGt

true

abs1

IsGt

R = A

abs

abs1

A,

0false, true, false

sub(0,A,R).

, abs1IsGt,.

greater

abs1IsGt,.

IsGt.

,

Fleng.

,,greater(#A,#B,R):- compute(>,A,B,R).

©
=4<»­¬  # ¬ð0 ²`£­#&5?.
¬°ê²`£¬
°Ç¼ #&5?.Ir¬
3monmopqtºý ?:?¿9 ¬"B<ÞÿaZ­¬§gª­¬ V Æ¢ ¶h­¬¨ ?:?¿9 ­ Ø *0~¬ `»
üu¨ °#&5?.­5²ßª­¦~¬
È"B<°?:?¿91ã¬¦° ¸ 2> :8°!/©ð¬°V¬Fleng.

, ` ',. compute,.

,.

greater, abs

absabs11, greater,.

A

abs1.

, Fleng,. greater,greater(A,B,R):(isvar(A)-->suspend(greater(A,B,R),A);isvar(B)-->suspend(greater(A,B,R),B);compute(>,A,B,R)).

©¬ -->ÿaí°ê í~« µHfkÿaíÞ$[°G ëí ð0Ïä­¬°¹¡¬
$[~¬ £Ø *0cª­
"B<°#&5?.¬ Ø *0#&5?.c)¬ð0°c¬ #&5?.¬|ð0"B<°1*¬ég~¬¦~¬ði2> :8 £ Ïä­üu
#&5?.  Ïä­¬üu>°Ir¬$[« ðÇ2> :8$[(´¬©í¸°r©« Þ°rëí°3*.ª6,B' ¬ © 3*.ëÞ°r¯!B.ð¬?:?
¿91ã¬ üuH©¬.

, Cond.

Then ; Else

Non-blocking

,.

Cond

isvar.

,suspend(12,,).

, AB

greater, Acompute(B,A,B,R),.

Non-blocking

suspend

Fleng,.

,. abs.

,.

,,.

,.

.

,,,.

,,,,,.

,,2,,,.

,üu Ïä­¬üu"B<1BB/B3*.}d­¬ ª§?:?¿9 4Q¬!/©¬
greater.

abs1,,.

abs(A,R) :(isvar(A)-->suspend(greater(A,0,IsGt),A);
compute(>,A,0,IsGt)),
abs1(IsGt,A,R).
, Aru©?:?¿9°rüu ég¬ð0Ïä­üuMíl2ßª­¬ Ïä­üul2N  2>:8#&5?.R¥­¢s¦ ÈÔMíÐÂmû°Û3¬1ã~¬pª­¬£ "B<bu°rüuð0Ïä­üu§lRmû¬ £ "B<bu?:?¿9æ ¬!B.#'­¢Í×  ,B)#Ñ\±õ7Ä1ãüu ¬"B<bu°¾f¡ ~«"B<bu¾f üu?:?¿9°¾f¡ ~¬pª­¬
5wxt
IÌô ?:?¿9¡ "B<Õ û©ð°r §§±õ¨«ó~¬  ©Þ°6,Bër©ð2> :8 !?0<!B.9B%[  !?0:° 0&n3 £ Þëí!B.°6,Bë'Ý ª!B.û?:?¿9°riºý!?0<°róôpª­¬©n3°¬ !?0:±õ0§aS V >B'?,$? ©z¾0 0&^Ie1ã~¬0&^!?0: Þëí6,BëP­¬
Pk°÷µHfk!?
0:Þe§¬£ "B<°?:?¿9¬¿9i
2> :8!B.#'2ã× ,Z¬ Q
Ê½2>1:°f©«Óh­¬"B<°bN ­°?:?¿9¬©¡ ~®6WTX Þëí°6,BëP¬©?:?¿9°rKô°¼  
Kô! ]fk¨ ,B)1>BÞ°ãGÒfk§¾f1ã~¬pª­¬vlsiq]Ú` ø³åî Á¶-è]fk¬Ã½TÂ1jKô þòöQ6Ø 8Èv×6
4.

.

,

1.

2,

suspend.

abs(A,R) :(isvar(A)-->suspend(greater(A,0,IsGt),A),
suspend(abs1(IsGt,A,R),IsGt);
compute(>,A,0,IsGt),(IsGt=true --> R = A; compute(-,0,A,R))).

üu Ïä­¬óí ©Ïä­¬ñú­¬°££¿9¬ ¬ £ ²Ïä­¬ñú­¬§?:?¿9¬ zL½ `»¬üu "B<_C°Ir¬1ã¬
Kô°f¬ y¬"B<°?:
?¿9¬§1ã~« ­<B2?>B;? °rËÜ¬,A, IsGt

putecom-, abs1.

, A, sub(0,A,R)

,, 1

.

,,.

A,.

,.

Fleng,.

Fleng

Committed-Choice,.

[1],,.

Fleng51

Committed-choice.

, Vol. 6, No. 2P-8, pp. 101{102, September 1995.