ãšã³ããªãŒ
ãã®æçš¿ã§ã¯ãåéãä»ã®æçš¿ãèªãã®ãæäŒããããšæã£ãŠããŸãã ããã¯ãããã°ã©ãã³ã°èšèªã®çè«ïŒTNLïŒã§äœ¿çšãããè¡šèšæ³ã®å éã³ãŒã¹ã§ãã ãããã¯ã®ããè¯ãç 究ã®ããã«ãFelleisenãFindlerãããã³Flattã«ããPLT Redexã䜿çšããBenjamin C. Pierceããã³Semantic Engineeringã«ããåãšããã°ã©ãã³ã°èšèªããå§ãããŸãã èªè ã¯çµéšè±å¯ãªããã°ã©ããŒã§ãããšä»®å®ããŸãããæ°åŠãšTNLã¯ããã»ã©åªããŠããŸããã åºæ¬çãªå®çŸ©ããå§ããŠãããã«ç解ã§ããããã«ããŸãã
ã»ãããã¿ãã«ãé¢ä¿ãããã³ã«ãŒã«å®çŸ©
å€ãã®èªè ã¯ã»ãããã¿ãã«ãããã³é¢ä¿ã«ç²ŸéããŠãããšæããŸãããåž°çŽçå®çŸ©ã«ç²ŸéããŠããªãå Žåã¯ã以äžã®ãã«ãŒã«ã«ããå®çŸ©ããšããã»ã¯ã·ã§ã³ããèªã¿ãã ããã
å€ãã®
TNCã§äœ¿çšããäž»ãªæ§æèŠçŽ ã¯å€æ°ã§ãã ãªããžã§ã¯ãïŒãŸãã¯èŠçŽ ïŒã®ã³ã¬ã¯ã·ã§ã³ã ããšãã°ãæåã®3ã€ã®èªç¶æ°ã§æ§æãããã»ããïŒ{0ã1ã2}ã
éèŠãªã®ã¯ããªããžã§ã¯ããã»ããã«å±ããŠãããã©ããã ãã§ãã éè€ããããã©ããããŸãã¯ã»ããå ã®ãªããžã§ã¯ãã®å€èŠ³ã®é åºã¯é¢ä¿ãããŸããã ããšãã°ãã»ãã{0ã2ã1}ãäžèšãšåãã»ããã è¡šèšÎµã¯ãcããæå³ããŸãã ãããã£ãŠã1â{0ã1ã2}ã¯çã§ããã3â{0ã1ã2}ã¯åœã§ãã ã»ããã«ã¯ãç¡éã®æ°ã®èŠçŽ ãå«ããããšãã§ããŸãã ããšãã°ã Nã§ç€ºããããã¹ãŠã®èªç¶æ°ïŒè² ã§ãªãæŽæ°ïŒã®ã»ããã
ã¿ãã«
å¥ã®ãã«ãã£ã³ã°ãããã¯ã¯ã¿ãã«ã§ãã ãªããžã§ã¯ãã®é åºä»ããããã³ã¬ã¯ã·ã§ã³ã T.O. ïŒ0ã1ã2ïŒã¯3ã€ã®èŠçŽ ã®ã¿ãã«ã§ãããã¿ãã«ïŒ0ã2ã1ïŒãšã¯ç°ãªããŸãã ç·åœ¢éè¡šèšt iã¯ãã¿ãã«tã®içªç®ïŒã€ã³ããã¯ã¹iïŒã®èŠçŽ ãæå³ããŸãã ããšãã°ãt =ïŒ0ã2ã1ïŒãt 1 = 0ãt 2 = 2ãt 3 = 1ã®å Žåãã¿ãã«ã«ã¯åžžã«æéæ°ã®èŠçŽ ãå«ãŸããéåžžã¯ããªãå€ãã®èŠçŽ ãå«ãŸããŸãã ã¿ãã«ãæå®ããããã«ãäžžæ¬åŒ§ã®ä»£ããã«å±±æ¬åŒ§ã䜿çšãããå ŽåããããŸãã ã
é¢ä¿
ã¿ãã«ãšã»ãããçµã¿åããããšãé¢ä¿ãåŸãããŸãã é¢ä¿ã¯å€ãã®ã¿ãã«ã§ãã
{ïŒ0ã1ïŒãïŒ1,2ïŒãïŒ2ã3ïŒãïŒ3ã4ïŒã...}
å€ãã®å Žåãå ¥åå€ãé±æ«ã«ãããã³ã°ããããã«é¢ä¿ã䜿çšããŸãã ããšãã°ãäžèšã®é¢ä¿ã¯ãèªç¶æ°ãããã®ãã©ãã¯ãŒãžã®ãããã³ã°ãã€ãŸã 次ã«å€§ããèªç¶æ°ã«ã äžèšã®å®çŸ©ã¯ïŒ...ïŒã䜿çšããŠãããããããªãäžæ£ç¢ºã§ãã 幞ããªããšã«ãç¡éã®ã»ãããšé¢ä¿ãèšè¿°ããããã®ããæ£ç¢ºãªè¡šèšæ³ããããŸãã
ã«ãŒã«ã«ããå®çŸ©
TNCã§ç¡éã»ãããå®çŸ©ããäž»ãªæ¹æ³ã¯ãã»ããã«å«ãŸããèŠçŽ ãèšè¿°ããã«ãŒã«ã®ã»ãããæäŸããããšã§ãã äžèšã®ã»ããã«ååRã䜿çšããŸãããã 次ã«ã次ã®2ã€ã®ã«ãŒã«ã«ãããRã®æ£ç¢ºãªå®çŸ©ãåŸãããŸãã2çªç®ã®ã«ãŒã«ã¯ãããèªäœãåç §ãããšããæå³ã§ååž°çã§ããããšã«æ³šæããŠãã ããã ããã¯ãéåžžã®ããªãäžè¬çãªç¶æ³ã§ãã
- ïŒ0ã1ïŒâR
- ä»»æã®èªç¶æ°nããã³mã«ã€ããŠãïŒnãmïŒâRã®å ŽåãïŒn + 1ãm + 1ïŒâR
ã«ãŒã«ã䜿çšããŠã»ãããå®çŸ©ããå Žåããããã®ã«ãŒã«ã䜿çšããŠã»ããå ã®ãã®èŠçŽ ã®æ€åºãæ£åœåããæ¹æ³ããªãå Žåãã»ããã«èŠçŽ ãå«ãŸããªãããšãæå³ããŸãã ãããã£ãŠãïŒ0ã0ïŒã¯Rã«å«ãŸããŸãããããã¯ãäžèšã®èŠåã䜿çšãããšãïŒ0ã0ïŒãå«ãŸããããšãæ£åœåããããšãã§ããªãããã§ãã
äžéšã®ã«ãŒã«ã»ããã¯ç¡æå³ã§ãããå€ããå®çŸ©ããŠããŸããã ããšãã°ã次ã®ããã«ãã«ãŒã«ã¯äºãã«ççŸããªãããã«ããå¿ èŠããããŸãã
- ïŒ0ã1ïŒâR
- ïŒ0ã1ïŒâR.
TNLã®æç§æžã§ã¯ããè¯ããã«ãŒã«ã»ããã®å¶éã«ã€ããŠèª¬æããŠããŸãããããã«ã€ããŠã¯èª¬æããŸããã å°ãªããšã1ã€ã®ã«ãŒã«ã¯éååž°çã§ãªããã°ãªãããåæ§ã®è«ççççŸã¯ååšããªãã¯ãã§ãã
äžèšã®ã«ãŒã«ã®äžè¬çãªè¡šèšã§ã¯ããifããšãthenãã®éã®æ°Žå¹³ããŒã䜿çšããŸãã ããšãã°ãRã®åçã®å®çŸ©ã¯æ¬¡ã®ããã«ãªããŸãã
ã«ãŒã«2ãããæ£ã®æŽæ°nããã³mã«ã€ããŠããçç¥ããŸãããã«ãŒã«ã«çŸããnãmãªã©ã®å€æ°ã¯ãæ£ããã¿ã€ãã®ãªããžã§ã¯ãã§çœ®ãæããããšãã§ãããšããèŠåã䜿çšããŸãã ãã®å Žåãèªç¶æ°ã å€ãã®å Žåããæ£ããã¿ã€ããã¯ãäŒè©±ã®ã³ã³ããã¹ãããæšæž¬ã§ãããã®ã§ãã ãã®å Žåãèªç¶æ°ã
ããèŠçŽ ãRã«ãããšäž»åŒµãããšããŸããïŒ2ã3ïŒâRãšèšããŸããããªãã¯ç§ãä¿¡ããŠããªããšçããããšãã§ããŸãã çŽåŸãããããã«ãã«ãŒã«ãïŒ2ã3ïŒâRãšããäºå®ãã©ã®ããã«æ£åœåãããã瀺ãå¿ èŠããããŸããçµè«ã瀺ããªããã°ãªããŸããã æšè«ã¯ãnãmãªã©ã®å€æ°ãç¹å®ã®å€ã«çœ®ãæããããïŒnãmïŒâRãªã©ã®åæãããå ·äœçãªçµè«ã«çœ®ãæããããäžé£ã®ã«ãŒã«ã§ãã
åºåã®åã¹ãããã«ã«ãŒã«çªå·ãä»ããŸããã ç§ããã«ãŒã«å®çŸ©ããšåŒã¶ãã®ã®ä»®åã¯åž°çŽçå®çŸ©ã§ãã
èšèªãšææ³ã®æ§æ
äžèšã§è¡ã£ãããã«ãã»ãããå®çŸ©ããããã®ã«ãŒã«ã®äœ¿çšã¯ãããã°ã©ãã³ã°èšèªã®æ§æãå®çŸ©ããã®ã«ãé©ããŠããããšãããããŸãã æŽæ°æŒç®çšã®åçŽãªèšèªãå®çŸ©ããå¿ èŠããããšããŸãã ãããã¢ãªã¹ãšåŒã³ãŸãããã 1 + 3ã-ïŒ5 + 2ïŒãªã©ã®åŒãå«ãŸããŸãã Zã¯æŽæ°ã®ã»ããã§ããããšãæãåºããŠãã ããã 次ã«ãArithã説æããå€ãã®ã«ãŒã«ã¯æ¬¡ã®ããã«ãªããŸãã
- iâZã®å ŽåãiâArithã§ããããšã¯äºå®ã§ãã
- ä»»æã®eã«ã€ããŠãeâArithã®å Žåã-eâArithã
- ä»»æã®e1ããã³e2ã«ã€ããŠãe1âArithããã³e2âArithã®å Žåãe1 + e2âArithã
- ä»»æã®eã«ã€ããŠãeâArithã®å ŽåãïŒeïŒâArithã
Backus-Naura FormïŒBNFïŒã¯ãèšèªã®æ§æãå®çŸ©ããã«ãŒã«ãæžãçããããã®ãã1ã€ã®äžè¬çãªè¡šèšæ³ã§ãããããã¯åãããšãæå³ããŸãã ïŒBNFã«ã¯ããã€ãã®ãªãã·ã§ã³ããããŸããããã§ã©ãã䜿çšãããå¿ããŸãããïŒã«ãŒã«ã®ã»ããã¯ææ³ãšåŒã°ããŸãã
ã¢ãªã¹:: =æŽæ° ã¢ãªã¹:: = "-"ã¢ãªã¹ Arith :: = Arith "+" Arith ã¢ãªã¹:: = "ïŒ"ã¢ãªã¹ "ïŒ"
æ§æãç°¡æœã«ããããã«ã瞊æ£ïŒããŸãã¯ããæå³ããïŒããã䜿çšãããŸãã
ã¢ãªã¹:: =æŽæ°| ã-ãã¢ãªã¹| ã¢ãªã¹ "+"ã¢ãªã¹| ãïŒ "ã¢ãªã¹"ïŒã
TNLã§ã¯ãå®çŸ©ãããèšèªïŒãã®å Žåã¯ArithïŒã®ååããArithèŠçŽ ãééããããã«äœ¿çšãããå€æ°ã«çœ®ãæãããBPFã®ç¹æ®ãªããªã¢ã³ãã䜿çšããŸãã ããã§ãå€æ°iãæŽæ°ã®ãã¬ãŒã¹ãã«ããŒãšããŠäœ¿çšããeãArithèŠçŽ ã®ãã¬ãŒã¹ãã«ããŒãšããŠäœ¿çšãããšããŸãã ãã®åŸã次ã®ããã«ææ³ãæžãããšãã§ããŸãã
e :: = i ⣠âe ⣠e + e
æ¬åŒ§ãçç¥ããŠããããšã«æ³šæããŠãã ããã äžè¬ã«ãã©ã®èšèªã§ãæ¬åŒ§ãèš±å¯ãããŠãããšç解ãããŠããŸãã åºåã®æŠå¿µã¯ã解æããªãŒãšåãã§ãã ã©ã¡ãããç¹å®ã®èŠçŽ ãå€æ°ã«å«ãŸããŠããçç±ã瀺ããŠããŸãã
æäœäžã®ã»ãã³ãã£ã¯ã¹
èšèªãèšè¿°ãããšã¯ããã®èšèªã§ããã°ã©ã ãèµ·åãããšãã«äœãèµ·ããããèšè¿°ããããšã§ãã ããã¯ãŸãã«æäœäžã®ã»ãã³ãã£ã¯ã¹ãè¡ãããšã§ãã Arithã®å Žåãããã°ã©ã ããšã«æŽæ°ã®çµæãæå®ããå¿ èŠããããŸãã åè¿°ã®ããã«ããªã¬ãŒã·ã§ã³ã·ããã䜿çšããŠå ¥åãçµæã«ãããã³ã°ã§ããŸãã éåžžãããã¯TNPã§è¡ããŸãã ããã€ãã®ç°ãªãé¢ä¿ã¹ã¿ã€ã«ããããŸãã æåã«æ€èšããã®ã¯ãããã°ã©ã ããã®çµæã«çŽæ¥ããããã倧ããªã¹ãããã®ã»ãã³ãã£ã¯ã¹ã§ãã
ããã°ã¹ãããã®ã»ãã³ãã£ã¯ã¹
ArithèŠçŽ ãæŽæ°ã«ãããã³ã°ããEvalãªã¬ãŒã·ã§ã³ãå®çŸ©ããŸãã ããšãã°ãæ¡ä»¶ïŒ-ïŒ2 + -5ïŒã3ïŒâEvalãæºãããªããã°ãªããŸããã ãã®é¢ä¿ã¯ç¡éã«ãªããŸãïŒArithã«ã¯ç¡éã®æ°ã®ããã°ã©ã ãããããïŒã ç¹°ãè¿ããŸãããäžé£ã®ã«ãŒã«ã䜿çšããŠEvalã決å®ããŸãã ããããå§ããåã«ãç¥èªã玹ä»ããŸãã ã¯ïŒeãiïŒâEvalãæå³ããŸãã 以äžã«ã氎平衚èšã䜿çšããŠEvalãå®çŸ©ããã«ãŒã«ã説æããŸãã 1ã€ã®ããã°ã©ã ãèŠéããªãããã«ãåArithæ§æã«ãŒã«ã«å¯ŸããŠ1ã€ã®ã«ãŒã«ãäœæããŸãïŒ3ã€ãããŸãïŒã 1ã€ã®ã«ãŒã«ãèšèªã®åæ§æã«ãŒã«ã«å¯Ÿå¿ããå Žåãã«ãŒã«ã¯æ§ææåã§ãããšèšããŸãã
ã-ãã§ã-ããã+ãã§ã+ããå®çŸ©ããã®ã¯å°ãå¥åŠã«æãããããããŸããã ããã¯åŸªç°äŸåã§ããïŒ çãã¯ããŒã§ãã ãã©ã¹ãšãã€ãã¹ã¯ã誰ããåŠæ ¡ã§çµéšããæŽæ°ã®éåžžã®ç®è¡æŒç®ã§ãã ãã®æå³ã§ãArithã32ããããŸãã¯64ãããã®ç®è¡æŒç®ã䜿çšããªãã®ã¯ããã«å¥åŠã§ãã Arithãå®è£ ããããã°ã©ãã¯ãããã±ãŒãžã䜿çšããŠBigIntegerãæäœããç®è¡ãåŠçã§ããŸãã
å°ããªã¹ãããã®ã»ãã³ãã£ã¯ã¹
æäœã»ãã³ãã£ã¯ã¹ã®2çªç®ã®æãäžè¬çãªã¹ã¿ã€ã«ã¯ãå°ããªã¹ãããã®ã»ãã³ãã£ã¯ã¹ã§ãã ãã®ã¹ã¿ã€ã«ã§ã¯ãæ 床ã¯çµæã«ããã°ã©ã ã衚瀺ããŸããã 代ããã«ãããã°ã©ã ãè¥å¹²åçŽåãããããã°ã©ã ã«ãããããŸãããã®ããã°ã©ã ã§ã¯ãéšååŒãçµæã«çœ®ãæããããŸãã ãã®ã¹ã¿ã€ã«ã¯ããã¹ãã®çœ®æãšèããããšãã§ããŸãã ãã®ã¹ã¿ã€ã«ã®äŸãæããã«ã¯ãStepãªã¬ãŒã·ã§ã³ãå®çŸ©ããŸãã ãã®é¢ä¿ã«ã¯ãä»ã®å€ãã®èŠçŽ ãšåæ§ã«ã次ã®èŠçŽ ãå«ãŸããŸãã
ïŒ-ïŒ2 + -5ïŒã-ïŒ-3ïŒïŒâã¹ããã ïŒ-ïŒ-3ïŒã3ïŒâã¹ããã
ç¥èªãå床玹ä»ããŸãã ã¯ïŒe1ãe2ïŒâã¹ããããæå³ããŸãã ãããŠãã¹ãããããŸãšãããšã æå³ãã ãã㊠ã stepã®å矩èªã¯ãreduceãšããçšèªã§ãã åã®2ã¹ãããã®äŸã¯ã次ã®ããã«èšè¿°ã§ããŸãã
次ã«ãStepãå®çŸ©ããã«ãŒã«ã«é²ã¿ãŸãããã 以äžã§èª¬æãã5ã€ã®ã«ãŒã«ããããŸãã
ã«ãŒã«ïŒ1ïŒãšïŒ2ïŒã¯æãèå³æ·±ããã®ã§ãã 圌ãã¯ç®è¡ãè¡ããŸãã ãããããèšç®äžã®åæžã«ãŒã«ããšåŒã³ãŸãã ã«ãŒã«ïŒ3ã5ïŒã䜿çšãããšãéšååŒã«ç§»åããŠèšç®ãå®è¡ã§ããŸãã ãããã¯ãç§ãã¡ãä»ã«å ¥ã£ãŠããªãçç±ã§ãã°ãã°ååèŠåãšåŒã°ããŸãã ã«ãŒã«ïŒ5ïŒã§å€æ°iã䜿çšãããšãçž®å°ãå·Šããå³ã«è¡ãããããšãæå³ããŸãã ç¹ã«ãå·Šã®åŒãæŽæ°ã«ãªããŸã§ãå³ã®åŒã+èšå·ããæžããããšã¯ã§ããŸããã
äœè«ïŒããã§æ€èšããŠããå·Šããå³ã®é åºã¯ãèšèªãã¶ã€ããŒãšããŠéžæãããŠããŸãã é åºã決å®ã§ããããããŸãã«ãªããŸããã ç§ãã¡ã®èšèªã«ã¯å¯äœçšããªãã®ã§ãé åºã¯é¢ä¿ãããŸããã ãã ããã»ãšãã©ã®èšèªã«ã¯å¯äœçšããããé åºã決å®ããŸãïŒãã¹ãŠã§ã¯ãããŸããïŒããã®ãããé åºãé垞決å®ãããæ¹æ³ã®äŸãæ€èšããå¿ èŠããããšèããŸããã
äŸã®æéã ã¹ãããã®åºåãèŠãŠã¿ãŸãããã
èšç®ã®1ã¹ããããã€ãŸã é¢ä¿ã¹ãããã ãããããŸã å®äºããŠããŸããã å®äºåã«ããã°ã©ã ãå®è¡ããããšã®æå³ããŸã 決å®ããå¿ èŠããããŸãã ãããè¡ãã«ã¯ãã¹ãããé¢ä¿ã®èŠ³ç¹ããEvalãå®çŸ©ããŸãã èšãæããã°ãåŒeããŒã以äžã®ã¹ãããã§æŽæ°iã«éå ãããå ŽåãEval 'é¢ä¿ã«ã¯ä»»æã®ãã¢ïŒeãiïŒãå«ãŸããŸãã 以äžã«èª¬æããæ°ããè¡šèšæ³ããããŸãã
è¡šèš{... ⣠...}ã¯ã»ããã³ã³ã¹ãã©ã¯ã¿ãå®çŸ©ããŸãã åçŽããŒã®å·ŠåŽã®åŒã¯ãã»ããã®å žåçãªèŠçŽ ã®ãã³ãã¬ãŒããå®çŸ©ããå³åŽã®åŒã¯ãã»ããã®èŠçŽ ã®å¶éãå®çŸ©ããŸãã è¡šèšæ³ ãŒã以äžã®ã¹ããããæå³ããŸãã ã«ãŒã«ã䜿çšããŠããããã®ãã«ãã¹ããããªã¬ãŒã·ã§ã³ã·ãããå®çŸ©ããŸãã
ïŒç§ã¯Lispã®ãããªãªã¹ãã®èŠ³ç¹ããããã«ã€ããŠèãããã ãããæåã®ã«ãŒã«ã¯nilã§ããã2çªç®ã®ã«ãŒã«ã¯consã§ãããïŒ
åã·ã¹ãã ïŒäŸãšããŠã©ã ãèšç®ã䜿çšïŒ
å€ãã®ããã°ã©ãã³ã°èšèªã¯éçã«åä»ããããŠããŸãã ã³ã³ãã€ã©ãŒã¯ãå®éã®ã³ã³ãã€ã«ãå®è¡ããåã«ããã€ãã®æ€èšŒãã§ãã¯ãå®è¡ããŸãã éåžžããã§ãã¯äžã«ãã³ã³ãã€ã©ãŒã¯ãªããžã§ã¯ããé©åã«äœ¿çšãããŠããããšã確èªããŸãã äŸãã°ã誰ãæŽæ°ãé¢æ°ãšããŠäœ¿çšããããšããŠããªããšããããšã§ãã èšèªèšèšè ãã©ã®ç¹å®ã®ãã§ãã¯ãå®è¡ããå¿ èŠããããã瀺ãæ¹æ³ã¯ãèšèªã®åã·ã¹ãã ãå®çŸ©ããããšã§ãã Arithã¯éåžžã«åçŽãªã®ã§ãèå³æ·±ãåãã§ãã¯ã¯ãããŸããã TNLã§ç¹°ãè¿ã䜿çšãããããè€éãªèšèª-ã©ã ãèšç®ïŒæè¡çã«ã¯ãåçŽåãããã¿ã€ãã®ã©ã ãèšç®ïŒãæ€èšããŠãã ããã ã©ã ãèšç®ã¯ãå¿åé¢æ°ã®ã¿ã§æ§æãããŸãã ã©ã ãèšç®ãæ¡åŒµããŠãç®è¡åŒãå«ãŸããããã«ããŸãã ãã®åŸãç§ãã¡ã®èšèªã¯æ¬¡ã®ææ³ã«ãã£ãŠæ±ºå®ãããŸãã
e :: = i ⣠âe ⣠e + e ⣠x ⣠ee â£Î»xïŒTe
å€æ°xã¯ãfooãgãªã©ã®ãã©ã¡ãŒã¿ãŒåããªã¹ãããŸãã å³åŽã®æ¬¡ã®2ã€ã®åŒïŒeeïŒã¯ãé¢æ°ã®é©çšïŒãŸãã¯é¢æ°åŒã³åºãïŒãæå³ããŸãã Cã«ç²ŸéããŠããå Žåãe1 e2ãe1ïŒe2ïŒãšèªãããšãã§ããŸãã ã©ã ãèšç®ã§ã¯ãé¢æ°ã¯ãã©ã¡ãŒã¿ãŒã1ã€ã ãåããããé¢æ°ãåŒã³åºãã«ã¯1ã€ã®åŒæ°ããå¿ èŠãããŸããã æ§æλxïŒTeã¯ãã¿ã€ãTã®1ã€ã®ãã©ã¡ãŒã¿ãŒxïŒããã«ã¿ã€ãã決å®ããŸãïŒãšåŒeã§æ§æãããæ¬äœãæã€é¢æ°ãäœæããŸãã ïŒå€ãã®å Žåãxã¯é¢æ°ã®ååã§ãããšèª€è§£ãããŸããå®éã«ã¯ãé¢æ°ã¯å¿åã§ãããããã€ãŸãååããªããããããã¯ãã©ã¡ãŒã¿ãŒã®ååã§ããïŒé¢æ°ã®æ»ãå€ã¯åŒeã®çµæã«ãªããŸãã 次ã«ãããã°ã©ã ã®å®è¡äžã«ã©ã®ãªããžã§ã¯ããååšããããèããŠã¿ãŸãããã ãããã¯æŽæ°ãšé¢æ°ã§ãã Tã䜿çšããŠããŸããŸãªã¿ã€ããåæããããŸããŸãªãªããžã§ã¯ããèšè¿°ããããã«å€ãã®ã¿ã€ããäœæããŸãã
æ©èœã¿ã€ã ãT 1ã¯ãã©ã¡ãŒã¿ãŒã®ã¿ã€ããT 2ã¯æ»ãå€ã®ã¿ã€ãã§ãã
åã·ã¹ãã ã®ä»äºã¯ãåŒã®çµæãæã€å€ã®åãäºæž¬ããããšã§ãã ããšãã°ãåŒ-ïŒ5 + 2ïŒã¯Intåã§ããå¿ èŠããããŸããããã¯ãçµæ-ïŒ5 + 2ïŒãæ°å€-3ïŒæŽæ°ïŒã§ããããã§ãã èšèªã®æ§æãŸãã¯æäœäžã®ã»ãã³ãã£ã¯ã¹ã決å®ããå Žåãšåæ§ã«ãTNCçè«å®¶ã¯é¢ä¿ãšèŠåã䜿çšããŠåã·ã¹ãã ã決å®ããŸãã WellTypedãªã¬ãŒã·ã§ã³ãå®çŸ©ããŸããããã¯ãæåã®è¿äŒŒã§ã¯ãåŒãåã«ãããã³ã°ããŸãã ããšãã°ãïŒ-ïŒ5 + 2ïŒãIntïŒâWellTypedã
ãã ãã ã©ã ãèšç®ã«ã¯å€æ°ãå«ãŸããŸããã©ã®å€æ°ãã©ã®ã¿ã€ããæã€ãã远跡ããã«ã¯ãäœããã®çš®é¡ã®ã·ã³ãã«ããŒãã«ã¢ããã°ãã¿ã€ãç°å¢ãšåŒã°ããé¢ä¿ãå¿ èŠã§ãã ã®ãªã·ã£æåã®ÎïŒã¬ã³ãïŒã¯ããã®ç®çã§äžè¬çã«äœ¿çšãããŸãã å€éšã¹ã³ãŒãããå€æ°ãé ãæ©èœãåãããå€ããã®ããæ°ããã¿ã€ãã®ç°å¢ãäœæã§ããå¿ èŠããããŸãã ãããã®å¯èœæ§ã®æ°åŠçè£ çœ®ã決å®ããããã«ãxã§å§ãŸãã¿ãã«ãé€å€ãããããšãé€ããÎâxã¯Îãšåãé¢ä¿ã«ãªããšä»®å®ããŸãã ïŒåã·ã¹ãã ã®å®çŸ©æ¹æ³ã«ãã£ãŠã¯ãxã§å§ãŸã0ãŸãã¯1ã¿ãã«ããããåã®ç°å¢ãéšåé¢æ°ãšåŒã°ããç¹å¥ãªçš®é¡ã®é¢ä¿ã«ããå ŽåããããŸããïŒåç°å¢ãå€æ°xã§æ¡åŒµããå Žåã«ãã£ãŠã¯ä»¥åã®å®çŸ©ããªãŒããŒã©ã€ããã次ã®ããã«å®çŸ©ããŸãã
ãšä»®å®ãã
ãããã
åç°å¢ã¯ãã³ã³ãã€ã©ãŒã®ã°ããŒãã«ã·ã³ãã«ããŒãã«ãšã¯ç°ãªããã¹ã³ãŒãããšã«è€æ°ã®åç°å¢ãããå ŽåããããŸãã ããã«ãã¿ã€ãç°å¢ãæŽæ°ããã代ããã«ãå€ãç°å¢ãšãããã«ç°ãªãæ°ããç°å¢ãäœæããŸãã ããã°ã©ãã³ã°ã®èŠ³ç¹ãããããã§äœ¿çšããæ°åŠçã¡ã¿èšèªã¯çŽç²ã«æ©èœçã§ãã å¯äœçšã¯å«ãŸããŠããŸããã èªè ã¯ãããéå¹çã«ã€ãªããã®ã§ã¯ãªãããšå¿é ãããããããŸããããããã§ããã°ã©ã ãæžããŠããã®ã§ã¯ãªããä»æ§ãæžããŠããããšãæãåºããŠãã ããïŒ æå¿«ãã¯ç§ãã¡ã«ãšã£ãŠæãéèŠã§ãã ãããŠãæž æœã«ä¿ã€ããšã§ãããç解ãããããã®ãæžãããšãã§ããŸãã
WellTypedãªã¬ãŒã·ã§ã³ã«æ»ããšã2ã€ã®èŠçŽ ã®ã¿ãã«ïŒ2ã¿ãã«ããã¢ïŒãå«ã代ããã«ã3ã€ã®èŠçŽ ã®ã¿ãã«ïŒ3ã¿ãã«ãããªãã«ïŒã®åœ¢åŒïŒÎãeãTïŒãå«ãŸããŸãã ãããã£ãŠãåç°å¢ã®ã³ã³ããã¹ãã§åãåŒã«å²ãåœãŠãŸãã ãã1ã€ã®ç¥èªã玹ä»ããŸãïŒTNLçè«å®¶ã¯ç¥èªã倧奜ãã§ãïŒïŒã æžããŸã ïŒÎãeãTïŒâWellTypedã®ä»£ããã«ã ããã§ãWellTypedãå®çŸ©ããã«ãŒã«ããªã¹ãããæºåãã§ããŸããã
äžèšã®ã«ãŒã«ãèŠçŽããŸãã ç®è¡æŒç®åã¯æŽæ°ã§æ©èœããŸãã å€æ°ã¯ç°å¢ããã¿ã€ããååŸããŸãã ã©ã ãã¯ããã©ã¡ãŒã¿ãŒã®ã¿ã€ããšçµæã®åºåã¿ã€ãã«åºã¥ããæ©èœã¿ã€ãã§ãã ã©ã ãæ¬äœã¯ããã®ã©ã ãã®ãã©ã¡ãŒã¿ãŒã䜿çšããŠå±éãããäœæãã€ã³ãããã®ç°å¢ã䜿çšããŠãã§ãã¯ãããŸãïŒåå¥ã¹ã³ãŒãïŒã ãŸããé¢æ°ã®äœ¿çšã¯ãåŒæ°ã®åããã©ã¡ãŒã¿ãŒã®åãšäžèŽããéããèšèªã®ããžãã¯ã«éåããŸããã
ãããã«
ããã§ãããã°ã©ãã³ã°èšèªã®çè«ã§äœ¿çšãããŠããè¡šèšæ³ã§ãã®ã¯ã©ãã·ã¥ã³ãŒã¹ãçµäºããŸãã ãã®æçš¿ã§ã¯åºæ¬ã®ã¿ã説æããŠããŸãããå¿ èŠãªè¿œå ã®è¡šèšæ³ã®å€ãã¯ãããã§èª¬æããè¡šèšæ³ã®ããªãšãŒã·ã§ã³ã§ãã ãèªã¿ããã ããã³ã¡ã³ãã§è³ªåããŠãã ããã