學術產出-Theses

Article View/Open

Publication Export

Google ScholarTM

政大圖書館

Citation Infomation

  • No doi shows Citation Infomation
題名 剖面導向函數語言之模組化狀態處理
Design and Implementation of Aspects for Localizing Side-Effects
作者 林佳瑩
Lin, Jia Yin
貢獻者 陳恭
Chen, Kung
林佳瑩
Lin, Jia Yin
關鍵詞 剖面導向
函式語言
狀態處理
惰性求值
aspect-oriented programming
side-effect
lazy semantics
monadification
日期 2009
上傳時間 9-May-2016 12:02:29 (UTC+8)
摘要 剖面所進行的運算通常都牽涉到狀態處理。在純粹函數式語言中,利用monadification技術添加狀態處理的剖面必須對程式碼做橫跨性的修改。本論文提出讓純粹函數式語言的剖面具備狀態處理功能,而使用者不須額外改寫既有程式碼的方法。我們提出了簡單直接的狀態操作語言機制,可以用來開發狀態處理剖面;並且設計出系統化的monadification規則,讓編譯器自動對程式碼做轉換,並維持惰性求值的特性。
Computations performed in many typical aspects involve side effects. In a purely functional setting, adding such aspects using techniques such as monadification will generally lead to crosscutting changes. This thesis presents an approach to provide side-effecting aspects for purely lazy functional languages in a user transparent fashion. We propose a simple yet direct state manipulation construct for developing side-effecting aspects and devise a systematic monadification scheme to translate the woven code to a purely monadic style functional code. To maintain the lazy evaluation feature, the monad employed is extended with cache functionality.
參考文獻 [1] Kung Chen, Shu-Chun Weng, Meng Wang, Siau-Cheng Khoo, and Chung-Hsin Chen. A compilation model for aspect-oriented polymorphically typed functional languages. In Static Analysis, 14th International Symposium, SAS 2007, volume 4634 of LNCS, pages 34-51. Springer-Verlag, 2007.
     [2] Martin Erwig and Delin Ren. Monadification of functional programs. Science of Computer Programming, 52(1-3):101-129, 2004.
     [3] Cormac Flanagan, Amr Sabry, Bruce F. Duba, and Matthias Felleisen. The essence of compiling with continuations. In Proceedings of the ACM SIGPLAN 1993 conference on Programming language design and implementation, pages 237-247, 1993.
     [4] John Hatcliff and Olivier Danvy. A generic account of continuation-passing styles. In Proceedings of the 21st ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 237-247, 1993.
     [5] Christian Hofer and Klaus Ostermann. On the relation of aspects and monads. In Foundations of Aspect-Oriented Languages Workshop at AOSD, pages 37-46. ACM Press, 2007.
     [6] Gregor Kiczales, Erik Hilsdale, Jim Hugunin, Mik Kersten, Jeffrey Palm, and William G. Griswold. An overview of aspectj. In ECOOP `01: Proceedings of the
     15th European Conference on Object-Oriented Programming, volume 2072 of LNCS, pages 327-353. Springer-Verlag, 2001.
     [7] Amir Kishon. Theory and Art of Semantics-Directed Program Execution Monitoring. PhD thesis, Yale University, June 1992.
     [8] Amir Kishon and Paul Hudak. Semantics directed program execution monitoring. Journal of Functional Programming, 5(4):501-547, 1995.
     [9] Ralf Lammel. Reuse by program transformation. In Functional Programming Trends 1999. Intellect, 2000. Selected papers from the 1st Scottish Functional Programming Workshop. Intellect, 2000.
     [10] Sheng Liang, Paul Hudak, and Mark Jones. Monad transformers and modular interpreters. In Proceedings of the 22nd ACM SIGPLAN-SIGACT Symposium on
     Principles of Programming Languages, pages 333-343, 1995.
     [11] W. De Meuter. Monads as a theoretical foundation for aop. In International Workshop on Aspect-Oriented Programming at ECOOP, 1997.
     [12] Philip Wadler. The essence of functional programming. In Proceedings of the 19th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 1-14, 1992.
     [13] Meng Wang, Kung Chen, and Siau-Cheng Khoo. Type-directed weaving of aspects for higher-order functional languages. In PEPM `06: Workshop on Partial Evaluation and Program Manipulation, pages 78-87. ACM Press, 2006.
     [14] Keith Wansbrough and Simon Peyton Jones. Once upon a polymorphic type. In Twenty-sixth ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 15-28, January 1999.
描述 碩士
國立政治大學
資訊科學學系
95753004
資料來源 http://thesis.lib.nccu.edu.tw/record/#G0095753004
資料類型 thesis
dc.contributor.advisor 陳恭zh_TW
dc.contributor.advisor Chen, Kungen_US
dc.contributor.author (Authors) 林佳瑩zh_TW
dc.contributor.author (Authors) Lin, Jia Yinen_US
dc.creator (作者) 林佳瑩zh_TW
dc.creator (作者) Lin, Jia Yinen_US
dc.date (日期) 2009en_US
dc.date.accessioned 9-May-2016 12:02:29 (UTC+8)-
dc.date.available 9-May-2016 12:02:29 (UTC+8)-
dc.date.issued (上傳時間) 9-May-2016 12:02:29 (UTC+8)-
dc.identifier (Other Identifiers) G0095753004en_US
dc.identifier.uri (URI) http://nccur.lib.nccu.edu.tw/handle/140.119/94858-
dc.description (描述) 碩士zh_TW
dc.description (描述) 國立政治大學zh_TW
dc.description (描述) 資訊科學學系zh_TW
dc.description (描述) 95753004zh_TW
dc.description.abstract (摘要) 剖面所進行的運算通常都牽涉到狀態處理。在純粹函數式語言中,利用monadification技術添加狀態處理的剖面必須對程式碼做橫跨性的修改。本論文提出讓純粹函數式語言的剖面具備狀態處理功能,而使用者不須額外改寫既有程式碼的方法。我們提出了簡單直接的狀態操作語言機制,可以用來開發狀態處理剖面;並且設計出系統化的monadification規則,讓編譯器自動對程式碼做轉換,並維持惰性求值的特性。zh_TW
dc.description.abstract (摘要) Computations performed in many typical aspects involve side effects. In a purely functional setting, adding such aspects using techniques such as monadification will generally lead to crosscutting changes. This thesis presents an approach to provide side-effecting aspects for purely lazy functional languages in a user transparent fashion. We propose a simple yet direct state manipulation construct for developing side-effecting aspects and devise a systematic monadification scheme to translate the woven code to a purely monadic style functional code. To maintain the lazy evaluation feature, the monad employed is extended with cache functionality.en_US
dc.description.tableofcontents 1 Introduction 1
     1.1 Motivation 1
     1.2 Research Objectives 2
     1.3 Contributions 2
     1.4 Organization of This Thesis 3
     2 Background 4
     2.1 Monad 4
     2.2 Related Work 5
     2.3 AspectFun Language 7
     2.3.1 Type-Scoped Advice and Advised Types 9
     2.3.2 Curried Pointcuts 12
     2.3.3 Control-flow Based Pointcuts 13
     2.3.4 Second-Order Advice 15
     3 Side-Effecting Aspects 17
     4 Monadifying Aspect Programs 23
     4.1 Pre-Processing 24
     4.1.1 A-Normal Form 24
     4.1.2 Specialized η-conversion 25
     4.2 Monadifying Pure Expressions 26
     4.3 Monadifying State-Aware Functions 28
     4.4 Preserving Laziness 32
     4.5 Monadifying Programs Using Control Flow-Based Pointcuts 41
     5 Transforming Monadic Programs 42
     5.1 Using Monad Transformers 42
     5.2 Unified Monadification Scheme 44
     6 Conclusions and Future Work 46
     7 References 48
     Appendix 50
zh_TW
dc.source.uri (資料來源) http://thesis.lib.nccu.edu.tw/record/#G0095753004en_US
dc.subject (關鍵詞) 剖面導向zh_TW
dc.subject (關鍵詞) 函式語言zh_TW
dc.subject (關鍵詞) 狀態處理zh_TW
dc.subject (關鍵詞) 惰性求值zh_TW
dc.subject (關鍵詞) aspect-oriented programmingen_US
dc.subject (關鍵詞) side-effecten_US
dc.subject (關鍵詞) lazy semanticsen_US
dc.subject (關鍵詞) monadificationen_US
dc.title (題名) 剖面導向函數語言之模組化狀態處理zh_TW
dc.title (題名) Design and Implementation of Aspects for Localizing Side-Effectsen_US
dc.type (資料類型) thesisen_US
dc.relation.reference (參考文獻) [1] Kung Chen, Shu-Chun Weng, Meng Wang, Siau-Cheng Khoo, and Chung-Hsin Chen. A compilation model for aspect-oriented polymorphically typed functional languages. In Static Analysis, 14th International Symposium, SAS 2007, volume 4634 of LNCS, pages 34-51. Springer-Verlag, 2007.
     [2] Martin Erwig and Delin Ren. Monadification of functional programs. Science of Computer Programming, 52(1-3):101-129, 2004.
     [3] Cormac Flanagan, Amr Sabry, Bruce F. Duba, and Matthias Felleisen. The essence of compiling with continuations. In Proceedings of the ACM SIGPLAN 1993 conference on Programming language design and implementation, pages 237-247, 1993.
     [4] John Hatcliff and Olivier Danvy. A generic account of continuation-passing styles. In Proceedings of the 21st ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 237-247, 1993.
     [5] Christian Hofer and Klaus Ostermann. On the relation of aspects and monads. In Foundations of Aspect-Oriented Languages Workshop at AOSD, pages 37-46. ACM Press, 2007.
     [6] Gregor Kiczales, Erik Hilsdale, Jim Hugunin, Mik Kersten, Jeffrey Palm, and William G. Griswold. An overview of aspectj. In ECOOP `01: Proceedings of the
     15th European Conference on Object-Oriented Programming, volume 2072 of LNCS, pages 327-353. Springer-Verlag, 2001.
     [7] Amir Kishon. Theory and Art of Semantics-Directed Program Execution Monitoring. PhD thesis, Yale University, June 1992.
     [8] Amir Kishon and Paul Hudak. Semantics directed program execution monitoring. Journal of Functional Programming, 5(4):501-547, 1995.
     [9] Ralf Lammel. Reuse by program transformation. In Functional Programming Trends 1999. Intellect, 2000. Selected papers from the 1st Scottish Functional Programming Workshop. Intellect, 2000.
     [10] Sheng Liang, Paul Hudak, and Mark Jones. Monad transformers and modular interpreters. In Proceedings of the 22nd ACM SIGPLAN-SIGACT Symposium on
     Principles of Programming Languages, pages 333-343, 1995.
     [11] W. De Meuter. Monads as a theoretical foundation for aop. In International Workshop on Aspect-Oriented Programming at ECOOP, 1997.
     [12] Philip Wadler. The essence of functional programming. In Proceedings of the 19th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 1-14, 1992.
     [13] Meng Wang, Kung Chen, and Siau-Cheng Khoo. Type-directed weaving of aspects for higher-order functional languages. In PEPM `06: Workshop on Partial Evaluation and Program Manipulation, pages 78-87. ACM Press, 2006.
     [14] Keith Wansbrough and Simon Peyton Jones. Once upon a polymorphic type. In Twenty-sixth ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 15-28, January 1999.
zh_TW