Please use this identifier to cite or link to this item:
https://ptsldigital.ukm.my/jspui/handle/123456789/513477
Title: | The formal semantics of the concept construct and constrained templates in generic programming |
Authors: | Bashar Abu Sa' (P46475) |
Keywords: | Semantics Generic programming Generic programming (Computer science) |
Issue Date: | 31-Oct-2013 |
Description: | Generic programming is a programming approach that enables programmers to use generic algorithms for different data types without having to rewrite the codes. It is normally implemented through standard template libraries. Templates use unconstrained generic parameters that cannot be checked at compilation time. Concepts are constructs that are designed to give constraints on the template parameters of C++ in order to solve the problem of type checking. Concepts are designed in a way that can be related to each other in a hierarchical structure using the property of refinement. This construct needs to be described formally in order to be defined, implemented and used accurately. The objective of this research is to construct a formal semantics model for a group of constructs related to generic programming. These constructs are concepts, concept map and constrained template classes. In spite of the importance of these constructs in the development of generic programming, the semantic description of them is mainly informal. Formal description of the semantics of these constructs is more precise for the purpose of implementation, understanding, using and proving of semantics properties. We used the approach of algebraic specification to describe the formal semantics of simple concept-based languages. These languages are CDL that can define concepts with function signatures, CDLAT that can define concepts with associated types and CDLREF that can define concepts with the property of refinement. Our approach is based on defining systematic transformation rules to transform the concept, concept map and template classes of these mini-languages into parameterized specifications and to define systematic interpretation rules to interpret the specifications using algebras. We use the transformation rules as a mechanism to transform concepts into the parameterized specification. We also utilize the hierarchical algebraic specification to reflect the refinement relation of concepts. Using algebraic specification, we presented a model of these constructs which is efficient in describing concepts and concept maps because of their nature as an interface-like constructs which resembles the structure of algebraic specifications, both parameterized and hierarchical. We present and give a proof of a group of properties that our model satisfies related to the semantics of simple languages such as preserving the semantics of the methods of the concept map, their associated types and parameters. We then prove that when a certain type models a concept then it models the concepts that it refines (that are in upper levels in the concept hierarchy). We also prove that when a constrained class can be successfully instantiated for a certain actual type then it can be also be instantiated for the same type when constrained by a refined concept in the hierarchy. The result of the study demonstrates the efficiency of the algebraic specification approach in formal description of concepts, concept maps and constrained templates with refinement for describing data types and revealing their properties. The proposed model can be used by the language implementer to add to the features of constrained generic programming into the programming languages.,Ph.D |
Pages: | 224 |
Call Number: | QA76.6245.A257 2013 3 |
Publisher: | UKM, Bangi |
Appears in Collections: | Faculty of Information Science and Technology / Fakulti Teknologi dan Sains Maklumat |
Files in This Item:
File | Description | Size | Format | |
---|---|---|---|---|
ukmvital_74707+Source01+Source010.PDF Restricted Access | 1.88 MB | Adobe PDF | View/Open |
Items in DSpace are protected by copyright, with all rights reserved, unless otherwise indicated.