home *** CD-ROM | disk | FTP | other *** search
/ ftp.umcs.maine.edu / 2015-02-07.ftp.umcs.maine.edu.tar / ftp.umcs.maine.edu / pub / WISR / wisr6 / proceedings / ascii / butler2.ascii < prev    next >
Text File  |  1993-10-19  |  15KB  |  341 lines

  1.  
  2.  
  3.  
  4.  
  5. Reusable  Reliable  Software  Components  for  Computer  Algebra
  6.  
  7.  
  8.  
  9.                                                    Greg Butler
  10.  
  11.  
  12.  
  13.                  Centre Interuniversitaire en Calcul Mathematique Algebrique
  14.  
  15.                                     Department of Computer Science
  16.  
  17.                                             Concordia University
  18.  
  19.                                  Montreal, Quebec, H3G 1M8 Canada
  20.  
  21.                                               Tel:  (514) 848-3031
  22.  
  23.                                               Tel:  (514) 848-3000
  24.  
  25.                                              Fax: (514) 848-2830
  26.  
  27.                                        Email: gregb@cs.concordia.ca
  28.  
  29.  
  30.  
  31.                                                      Abstract
  32.  
  33.  
  34.        Computer algebra is a good testbed for the study of reuse, and reusable libraries and frame-
  35.    works should provide the tools to research software architectures for computer algebra systems.
  36.    Computer algebraists demand correctness, reliability, robustness, and efficiency while insisting
  37.    on ease of adaptability of the software.  However, they do have a strong background in for-
  38.    malisms.  The aim of our work is to construct reliable, reusable libraries and frameworks in
  39.    C++ to support the development of experimental prototypes of next-generation computer alge-
  40.    bra systems which will incorporate high-level object-oriented languages, databases, deduction,
  41.    and planning. There is a particular emphasis on the use of formal methods for specification and
  42.    verification.
  43.  
  44.  
  45.    Keywords: Reuse, formal methods, library, framework, computer algebra
  46.  
  47.  
  48.    Workshop Goals: Learning; networking;
  49.  
  50.  
  51.    Working Groups:  reuse and formal methods, reuse and OO methods, reusable component
  52.    certification, design guidelines for reuse _ C++
  53.  
  54.  
  55.  
  56.                                                      Butler- 1
  57.  
  58.  
  59. 1      Background
  60.  
  61.  
  62.  
  63. The position outlined here derives from a very real need forreliable, reusable and efficient software
  64. components  in  order  to  perform  research  into  software  architectures  for  the  next-generation  of
  65. computer algebra systems. Such systems will integrate features from database and knowledge base
  66. systems, theorem provers, planners, and scientific visualisation with features from existing computer
  67. algebra systems, such as extremely complex algebraic algorithms.  Most likely the user language of
  68. the next-generation systems will combine the paradigms of functional, logic, ob ject-oriented, and
  69. set-based languages. Such a system would provide effective reuse of domain knowledge to novices
  70. and experts alike, where the domain is some subset of mathematics such as algebra, combinatorics,
  71. or group theory.
  72.  
  73.  
  74. Cayley/Magma is one computer algebra system developing in that direction.  It is being develop ed
  75. at the University of Sydney under the leadership of John Cannon.  The Cayleypro ject [1] began in
  76. 1975. It was implemented in Fortran, and concentrated on computational group theory. In 1987 it
  77. was converted to C almost fully automatically. Development has continued in C. The Cayley team
  78. has _ and has had from the very beginning _ a strong emphasis on designand implementation with
  79. reuse and for reuse, because of the very limited manpower.  Since 1974, as part of thisteam, I have
  80. worked on all aspects of software for algebraic algorithms:  conceptualisation, proof of correctness,
  81. complexity analysis, data structures, design and implementation, performance measurement and
  82. tuning. My software is the most heavily used part of the Cayley system.  One suite of routines [2],
  83. for backtrack searches, written in 1978, would now be called a framework.  In 1986 John Cannon
  84. and  I started  work  on  Cayley, version  4  [3],  an  ambitious  step  towards  a  fully  integrated  next-
  85. generation system for discrete algebraic and combinatorial computation.  I focussed on the design
  86. of the user language, and on the knowledge base facilities. My student, Sridhar Iyer, and I built
  87. the first deductive database of groups [4, 5 ], and a prototype knowledge base of groups [6, 7 ], both
  88. using NU-Prolog. NU-Prolog provides a foreign-function interface to our Croutines which perform
  89. the required algebraic computations for the knowledge base. The imp edance mismatch between
  90. mathematical objects, external databases, and Prolog is a major issue.
  91.  
  92.  
  93. These experiences convinced me that a more flexible environment, using a single language, C++,
  94. is needed to research the issues of software architectures and their integration for computer algebra
  95. systems. Also, there is a great need from researchers in algebraic algorithms for a software library.
  96. Since moving to Concordia University atthe end of 1991, my research has focussed on C++ libraries
  97. and frameworks, issues of reuse, and issues of reliability (which includes correctness).
  98.  
  99.  
  100.  
  101. 2      Position
  102.  
  103.  
  104.  
  105. My position can be summarised by the following three points.
  106.  
  107.  
  108. (1) Software Engineering researchers need very close links with real-world software practitioners
  109. and applications; in our case with builders of computer algebra systems.
  110.  
  111.  
  112. (2) Evaluation of reusable libraries and frameworks needs attempts at actual reuse of them; in our
  113. case by builders of computer algebra systems, and develop ersof algebraic algorithms.
  114.  
  115.  
  116. (3) Our principal obstacles to reuse are understanding, trust, and efficiency.
  117.  
  118.  
  119. We  address  understanding  through  a combination  of  documentation,  formal  specification,  and
  120.  
  121.  
  122.  
  123.                                                          Butler- 2
  124.  
  125.  
  126. proofs of correctness (at various levels of formality).
  127.  
  128.  
  129. We  address  trust  through  a  combination  of  the  above,  together  with  suites  of  test  cases,  and  a
  130. history of effective reuse.
  131.  
  132.  
  133. We  address  efficiency  through  the use  of  specialised  algorithms,  hybrid  algorithms,  and  layered
  134. multi-lingual implementations (which allows the use of C and machine code).
  135.  
  136.  
  137. While  there  is  a  consensus  amongst  the  reuse  community  over  understanding  and  trust  being
  138. obstacles to reuse, efficiency is rarely stressed. Our reusers insist on it, as their scientific applications
  139. may be at the frontier of what can be achieved with available computer resources.
  140.  
  141.  
  142. The research plan we follow is to:
  143.  
  144.  
  145.  
  146.     fflIdentify existing algorithms, data structures, components, and tools used in language transla-
  147.        tors, databases, and computer algebra systems (e.g. NU-Prolog, Cayley, ISOM, and Algeb).
  148.        In  particular,  review  existing  libraries  such  as  Leda,  COOL,  Interviews,  NIHCL,  mat++,
  149.        newmat.
  150.  
  151.  
  152.     fflSelect those to reverse engineer (into C++) based on the interests of current students, related
  153.        pro jects, and prototypes under development.
  154.  
  155.  
  156.     fflInsist upon high quality documentation, formal specification, extensive reasoning about cor-
  157.        rectness, and extensive test suites for the components developed for the libraries.
  158.  
  159.  
  160.     fflIdentify efficiency bottlenecks using performance benchmarks and seamlessly eliminate them
  161.        through use of hybrid algorithms, algorithms for special cases, and the use of C and machine
  162.        language routines for critical operations (as done in the bignum library [8]).
  163.  
  164.  
  165.     fflAssimilate  libraries  written  in  very  high  level  languages  (VHLL) (such  as  Algeb, Cayley)
  166.        by  constructing  translators  into  C++  and  provide  the  necessary  run-time  supp ort.  The
  167.        translation must allow the reuse of existing library components for operations or procedures
  168.        written in the VHLL.
  169.  
  170.  
  171.     fflPreferably have the components in use as part of a related project being carried out concur-
  172.        rently with the development of the library components.
  173.  
  174.  
  175.  
  176. Reusability is validated and evaluated by developing small demonstration prototypes of applications.
  177. For example, current work is concentrating on
  178.  
  179.  
  180.  
  181. Framework for deductive databases                     A framework for Datalog is b eing implemented in C++.
  182.        It incorporates several mechanisms for multi-dimensional database retrieval.  Furthermore, a
  183.        formal specification in Z of a relational database and a deductive database is underway.  The
  184.        demonstration prototype will be to implement the TwoGroups database in C++ using the
  185.        framework.
  186.  
  187.  
  188. Framework for Backtrack Searches                     It is planned to reverse engineer the existing framework(s)
  189.        into C++.  Thedemonstration prototype will be to implement the ISOM package for combi-
  190.        natorial enumeration in C++ using the framework.
  191.  
  192.  
  193. Translator for Algeb            The translator from Algeb to C++is b eing implemented in C++.  Library
  194.        components for arithmetic with arbitrary precision integers, reals, p-adic numbers, vectors,
  195.        matrices,  and  polynomials  are  being  implemented  in  C++.  We  plan  to  use  Larch/C++
  196.  
  197.  
  198.                                                          Butler- 3
  199.  
  200.  
  201.        to specify the library components.  The demonstration prototype will be to (automatically)
  202.        translate the Algeb implementation of the LLL algorithm into a highly efficient version coded
  203.        in C++ (and possibly C and machine code).
  204.  
  205.  
  206.  
  207. 3      Comparison
  208.  
  209.  
  210.  
  211. The only comparable computer algebra system to Cayley/Magma is Axiom.  Axiom has a sophisti-
  212. cated type system, and good visualisation tools. However, being more concerned with continuous
  213. mathematics, it does not include database and knowledge base facilities.
  214.  
  215.  
  216. There has been several frameworks developed [9], the best known being Smalltalk's MVCframework
  217. and the Choices framework for operating systems. Don Batory at University of Texas at Austin has
  218. developed a framework for traditional database systems [10], and is in the process of extending it
  219. to object-oriented database systems. His approach views a database as a composition of functional
  220. layers (or realms), and the framework as the realms, their type constraints as functions, and the
  221. alternative implementations. This is different from the usual view of a framework as a collection of
  222. cooperating abstract classes (and concrete subclasses). There has been no work on object-oriented
  223. frameworks  for  deductive  databases,  for  Prolog,  for  knowledge  bases,  or  for  computer  algebra
  224. systems.
  225.  
  226.  
  227. There are several well documented libraries. Some,  such as BigNum [8 ] and Leda [11 ], go as far
  228. as providing pre- and post conditions as part of the interface do cumentation.  To our knowledge,
  229. only  the  work  of  Musser  and  Stepanov  [12,  13 ]  reasons  carefully  about  the  correctness  of  the
  230. library. Work on local certifiability [14 ] and language constructs which support formal reasoning
  231. about reusable components [15 ] by Weide and his colleagues also treat correctness issues, but more
  232. generally.
  233.  
  234.  
  235. Much more work is required on documenting,  specifying,  andreasoning about frameworks,  thus
  236. extending [16 , 17 , 18 ].
  237.  
  238.  
  239.  
  240. References
  241.  
  242.  
  243.  
  244.   [1] J.  Cannon,  "An  Introduction  to  the  Group  Theory  Language,  Cayley,"  in  Computational
  245.       Group Theory (M. Atkinson, ed.), pp. 145-183, London:  Academic Press, 1984.
  246.  
  247.  
  248.   [2] G. Butler, "Computing in Permutation and Matrix GroupsI I: Backtrack Algorithm," Math.
  249.       Comp., vol. 39, pp. 671-680, 1982.
  250.  
  251.  
  252.   [3] G. Butler and J. Cannon, "Cayley,Version 4 :  The User Language," in Symbolic and Alge-
  253.       braic Computation. Proceedings of 1988 International Symposium on Symbolic and Algebraic
  254.       Computation, Rome (P. Gianni, ed.), (Berlin), pp. 456-466, Springer-Verlag, July 4-8 1989.
  255.       Lecture Notes in Computer Science, 358.
  256.  
  257.  
  258.   [4] G. Butler, S. Iyer, and S. Ley, "A Deductive Database for the Groups of Order Dividing 128,"
  259.       in ISSAC 91 (S. Watt, ed.), (New York), pp. 210-218, ACM Press, 1991.
  260.  
  261.  
  262.   [5] G. Butler, S. Iyer, and E. O'Brien, "A Database ofGroups of Prime-Power Order." submitted
  263.       to ACM TODS.
  264.  
  265.  
  266.  
  267.                                                          Butler- 4
  268.  
  269.  
  270.   [6] G. Butler and S. Iyer, "Deductive Mathematical Databases _ A Case Study," in Statistical and
  271.       Scientific  Database  Management.  Proceedings  of  5th  International  Conference  on  Statistical
  272.       and Scientific Databases, Charlotte, North Carolina (Z. Michalewicz, ed.), (Berlin), pp. 50-64,
  273.       Springer-Verlag, April 3-5 1990. Lecture Notes in Computer Science, 420.
  274.  
  275.  
  276.   [7] G. Butler and S. Iyer, "An Experimental KnowledgeBase of Simple Groups." in preparation.
  277.  
  278.  
  279.   [8] B.  Serpette,  J.  Vuillemin,  and  J.  Herve,  "BigNum:  A  Portable  and  Efficient  Package  for
  280.       Arbitrary-Precision  Arithmetic," Tech.  Rep.  Paris  Research  Laboratory  Report  2, Digital
  281.       Equipment Corporation, 1989.
  282.  
  283.  
  284.   [9] R. Johnson and B. Foote, "Designing Reusable Classes,"Journal of Object-Oriented Program-
  285.       ming, vol. 1, pp. 22-35, 1988.
  286.  
  287.  
  288. [10]  D. Batory and S. O'Malley,"The Design and Implementation of Hierarchical Software Systems
  289.       with Reusable Components," ACM Trans. on Software Engineering and methodology, vol. 1,
  290.       no. 4, pp. 355-398, 1992.
  291.  
  292.  
  293. [11]  K. Mehlhorn and S. N{her, "LEDA, a Library of Efficient Data Types and Algorithms," Tech.
  294.       Rep. TR A 04/89, FB10, Universit{t des Saarlandes, Saarbrucken, 1989.
  295.  
  296.  
  297. [12]  D. Musser and A. Stepanov, "Generic programming," LNCS, vol. 358, pp. 13-25, 1989.
  298.  
  299.  
  300. [13]  D.  Musser  and  A.  Stepanov, The  Ada  Generic  Library:  Linear  Data  Structure  Packages.
  301.       Berlin: Springer-Verlag, 1989.
  302.  
  303.  
  304. [14]  B. Weide and J. Hollingsworth, "Scalability of Reuse Technology to Large Systems Requires
  305.       Local Certifiability," in Proceedings of the Fifth Annual Workshop on Software Reuse (L. La-
  306.       tour, S. L. Philbrick, and M. Stevens, eds.), October 1992.
  307.  
  308.  
  309. [15]  D. Harms and B. Weide, "Swapping vs Copying:  Their Influence on the Design of Reusable
  310.       Software Components," IEEE  Transactions  on  Software  Engineering,  vol.  17,  pp.  424-435,
  311.       1991.
  312.  
  313.  
  314. [16]  R. Helm, I. Holland, and D. Gangopadhyay, "Contracts: Specifying Behavioral Compositions
  315.       in Object-Oriented Systems," in ECOOP/OOPSLA'90, pp. 169-180, 1990.
  316.  
  317.  
  318. [17]  R. Johnson, "Documenting Frameworks Using Patterns," in OOPSLA'92, pp. 63-76, 1992.
  319.  
  320.  
  321. [18]  W.  Cook, "Interfaces  and  Specifications  for  the  Smalltalk-80  Collection  Classes," in  OOP-
  322.       SLA'92, pp. 1-15, 1992.
  323.  
  324.  
  325.  
  326. 4      Biography
  327.  
  328.  
  329.  
  330. Gregory Butler is Associate Professor in Computer Science and a member of Centre Interuniver-
  331. sitaire en Calcul Mathematique Algebrique (CICMA) at Concordia University, Montreal, Canada.
  332. He obtained his PhD from the University ofSydney in 1980 for work on computational group the-
  333. ory. He spent 1976/77 at ETH, Zurich as part of his doctoral studies, and for two years, 1979-1981,
  334. was a postdoctoral fellow at McGill and Concordia Universities in Montreal.  He was on the faculty
  335. of the Department of Computer Science at the University of Sydney from 1981 to 1990.  He has
  336. held visiting positions at the University of Delaware and Universit{t Bayreuth.
  337.  
  338.  
  339.  
  340.                                                          Butler- 5
  341.