Book contents
- Frontmatter
- Contents
- Preface
- Introduction
- 1 First-Order Terms and Representations of Data
- 2 First-Order Horn Clauses
- 3 First-Order Hereditary Harrop Formulas
- 4 Typed λ-Terms and Formulas
- 5 Using Quantification at Higher-Order Types
- 6 Mechanisms for Structuring Large Programs
- 7 Computations over λ-Terms
- 8 Unification of λ-Terms
- 9 Implementing Proof Systems
- 10 Computations over Functional Programs
- 11 Encoding a Process Calculus Language
- Appendix The Teyjus System
- Bibliography
- Index
6 - Mechanisms for Structuring Large Programs
Published online by Cambridge University Press: 05 August 2012
- Frontmatter
- Contents
- Preface
- Introduction
- 1 First-Order Terms and Representations of Data
- 2 First-Order Horn Clauses
- 3 First-Order Hereditary Harrop Formulas
- 4 Typed λ-Terms and Formulas
- 5 Using Quantification at Higher-Order Types
- 6 Mechanisms for Structuring Large Programs
- 7 Computations over λ-Terms
- 8 Unification of λ-Terms
- 9 Implementing Proof Systems
- 10 Computations over Functional Programs
- 11 Encoding a Process Calculus Language
- Appendix The Teyjus System
- Bibliography
- Index
Summary
In the early stages of developing a programming language or paradigm, the focus is on programming-in-the-small. As the language matures, programming-in-the-large becomes important and a second modules language is often imposed on the previously existing core language. This second language must support the partitioning of code and name spaces into manageable chunks, the enforcement of encapsulation and information hiding, and the interactions between separately defined blocks of code. The addition of such modularity features typically is manifest syntactically in the form of new constructs and directives, such as local, use, import, and include, that affect parsing and compilation. Since the second language is born out of the necessity to build large programs, there may be little or no connection between the semantics of the added modular constructs and the semantics of the core language. The resulting hybrid language consequently may become complex and also may lack declarativeness, even when the core language is based on, say, logic.
In the logic programming setting, it is possible to support some of the abstractions needed for modular programming directly through logical mechanisms. For example, the composition of code can be realized naturally via the conjunction of program clauses, and suitably scoped existential quantifiers can be used to control the visibility of names across program regions. This chapter develops this observation into the design of a specific module language.
- Type
- Chapter
- Information
- Programming with Higher-Order Logic , pp. 150 - 174Publisher: Cambridge University PressPrint publication year: 2012