05.03.2003Marc Conrad, University of Luton1 Abstract Classes – pure computer science meets pure mathematics. The Beauty of Implementing Abstract Structures.

Slides:



Advertisements
Similar presentations
Object-Oriented Application Frameworks Much of the cost and effort stems from the continuous re- discovery and re-invention of core concepts and components.
Advertisements

Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
Cryptography and Network Security
Cryptography and Network Security Chapter 4 Fourth Edition by William Stallings.
Chapter 4 – Finite Fields. Introduction will now introduce finite fields of increasing importance in cryptography –AES, Elliptic Curve, IDEA, Public Key.
Computer Science Dept. Fall 2003 Object models Object models describe the system in terms of object classes An object class is an abstraction over a set.
OOP - Object Oriented Programming Object Oriented Programming is an approach to programming that was developed to make large programs easier to manage.
OBJECT ORIENTED PROGRAMMING M Taimoor Khan
Computer science is a field of study that deals with solving a variety of problems by using computers. To solve a given problem by using computers, you.
Classes and Object- Oriented... tMyn1 Classes and Object-Oriented Programming The essence of object-oriented programming is that you write programs in.
A First Attempt towards a Logical Model for the PBMS PANDA Meeting, Milano, 18 April 2002 National Technical University of Athens Patterns for Next-Generation.
Aalborg Media Lab 23-Jun-15 Inheritance Lecture 10 Chapter 8.
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
Computer Science I Inheritance Professor Evan Korth New York University.
Object-oriented design CS 345 September 20,2002. Unavoidable Complexity Many software systems are very complex: –Many developers –Ongoing lifespan –Large.
CSCI-383 Object-Oriented Programming & Design Lecture 15.
CSSE501 Object-Oriented Development
Inheritance. © 2004 Pearson Addison-Wesley. All rights reserved 8-2 Inheritance Inheritance is a fundamental object-oriented design technique used to.
Copyright © Cengage Learning. All rights reserved.
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
2009 Mathematics Standards of Learning Training Institutes Algebra II Virginia Department of Education.
1 1.0 Students solve equations and inequalities involving absolute value. Algebra 2 Standards.
Object Oriented Programming Development
FINITE FIELDS 7/30 陳柏誠.
1 Using the Synergies Between the Object-Oriented Paradigm and Mathematics in Joint Mathematics/Computer Science Programs Marc Conrad - Tim French University.
Limitations of the relational model. Just as the relational model supplanted the network and hierarchical model so too will the object – orientated model.
11 1 Object oriented DB (not in book) Database Systems: Design, Implementation, & Management, 6 th Edition, Rob & Coronel Learning objectives: What.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Rational Expressions Much of the terminology and many of the techniques for the arithmetic of fractions of real numbers carry over to algebraic fractions,
Object-Oriented Programming (OOP) CSC-2071 (3+1=4 Credits) Lecture No. 1 MBY.
CS200 Algorithms and Data StructuresColorado State University Part 4. Advanced Java Topics Instructor: Sangmi Pallickara
Introduction to Object Oriented Programming CMSC 331.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
Data Security and Encryption (CSE348) 1. Lecture # 12 2.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
Week III  Recap from Last Week Review Classes Review Domain Model for EU-Bid & EU-Lease Aggregation Example (Reservation) Attribute Properties.
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
Object Oriented Modeling David Li CTO, DigitalSesame.
9-Dec Dec-15  INTRODUCTION.  FEATURES OF OOP.  ORGANIZATION OF DATA & FUNCTION IN OOP.  OOP’S DESIGN.
1 Object Oriented Programming Development z By: Marc Conrad University of Luton z z Room: D104.
C++ Inheritance Data Structures & OO Development I 1 Computer Science Dept Va Tech June 2007 © McQuain Generalization versus Abstraction Abstraction:simplify.
Ontology Support for Abstraction Layer Modularization Hyun Cho, Jeff Gray Department of Computer Science University of Alabama
Lecture 2: Review of Object Orientation. © Lethbridge/La ganière 2005 Chapter 2: Review of Object Orientation What is Object Orientation? Procedural.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
 Description of Inheritance  Base Class Object  Subclass, Subtype, and Substitutability  Forms of Inheritance  Modifiers and Inheritance  The Benefits.
Data Models. 2 The Importance of Data Models Data models –Relatively simple representations, usually graphical, of complex real-world data structures.
ISBN Chapter 12 Support for Object-Oriented Programming.
CSCI 383 Object-Oriented Programming & Design Lecture 15 Martin van Bommel.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
Object Oriented Programming Development
OOP - Object Oriented Programming
Unit - 3 OBJECT ORIENTED DESIGN PROCESS AND AXIOMS
Programming paradigms
Sachin Malhotra Saurabh Choudhary
JAVA By Waqas.
Lecture 12 Inheritance.
Testing Object-Oriented Software Concepts and Definitions
Lecture 2 of Computer Science II
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
Road Map Inheritance Class hierarchy Overriding methods Constructors
The Object-Oriented Thought Process Chapter 08
Object-Oriented Programming
Object Oriented Programming & Mathematics
Lecture 10 Concepts of Programming Languages
Axiomatic Mathematics meets Object Oriented Programming
Presentation transcript:

Marc Conrad, University of Luton1 Abstract Classes – pure computer science meets pure mathematics. The Beauty of Implementing Abstract Structures as Abstract Structures. Marc Conrad, University of Luton.

Marc Conrad, University of Luton2 An Overview – the context. Mathematics before the 20 th century axiomatic (Hilbert, Bourbaki, …) algorithmic (Turing, Church, …) "pure" mathematics computer science computer algebra etc.

Marc Conrad, University of Luton3 Some motivating remarks Students in Computer Science learn object oriented techniques as a method for designing software systems. Without explicitly knowing it they learn fundamental principles of abstract mathematics. Java as an object oriented language is widely used and accepted for many areas as Graphical User Interfaces or Networking. We will see that the underlying principles are also very well suited for implementing "mathematics". More possibilities to deal with abstract mathematical entities in software. L'art pour l'art

Marc Conrad, University of Luton4 Object Oriented Concepts History: Since 1962 with SIMULA 1. Inheritance used since 1967 in SIMULA 67. Today: Java, C++. Concepts: Objects send messages to other objects. Classes are blueprints for objects. A class defines the behaviour of an object using methods. Classes are linked via associations & inheritance.

Marc Conrad, University of Luton5 Classes and Objects: A class has data and methods. Textbook Example: A car class may have the following methods: startEngine() move() And as data: speed, numberOfDoors, numberOfSeats,... Math Example A finite field class may have as methods: add(), multiply(), subtract(), divide(), exponentiate(), computeFrobenius() And as data: characteristic, generating polynomial, generator of multiplicative group,... Rings, spaces, categories, etc. can easily identified as classes or objects.

Marc Conrad, University of Luton6 Inheritance: Give one class (the child class) all the methods and data of another class (the parent class): An "is a" relationship. Textbook: Math Example Vehicle Car The class car gets all methods of the vehicle + additional own methods. Quadratic Extension F(  d) Complex Field C C = R(  -1) "is a" quadratic extension of R Specifying a special case from a general concept.

Marc Conrad, University of Luton7 Inheritance hierarchies usually have a tree or directed graph structure Estate Bicycle Car Vehicle Hatchback Ring R R / f RR[x] C = R(  -1) F(  d) = F/ (x 2 – d)F R

Marc Conrad, University of Luton8 Overriding methods: Reimplement a method of the parent class in the child class. Textbook: Vehicle: Implement a method move(). Car (inherits Vehicle): Also implements a method move().  Car objects execute the move() method defined in the Car class. Math Example F(  d): Implement multiplication C (inherits F(  d) ): Re-implement multiplication, e.g. using polar coordinates in some cases. Reinterpreting behavior in the specialisation

Marc Conrad, University of Luton9 An advantage of Overriding methods: Generic algorithms Textbook: A class Driver can be associated with the Vehicle class. The Driver can move the Vehicle moving in fact a car or a bicycle. Math Example Define a polynomial ring over an arbitrary ring of coefficients and obtain polynomials over C, Q, F(  d) etc. Define new structures on an abstract level.

Marc Conrad, University of Luton10 Abstract methods – abstract classes. That is, the driver moves only Cars, Bicycles, but not a "Vehicle". In fact the Vehicle class does not need to define the move() method. Similarly a Ring class does not need to define addition and multiplication. (But it is obvious, that a Ring has addition, multiplication, etc.) The object oriented paradigm allows to declare a method in a class without implementing it. This is the concept of abstract classes.

Marc Conrad, University of Luton11 Abstract methods: Declare a method in the parent class – implement in the child class. Textbook: Vehicle: Declare a method move(). Car (inherits Vehicle): Also implements a method move().  Car objects execute the move() method defined in the Car class. Math Example A Ring R: Declare multiplication. C (inherits R): Implement multiplication. Reinterpreting behavior in the specialisation

Marc Conrad, University of Luton12 Example: A ring. We cannot implement: addition negation multiplication inversion "zero" "one" check if zero We can implement: subtraction: a-b = a + (-b) exponentiation: a n = a ...  a. embedding of Z, Q. check for equality polynomials over this ring etc. n abstract methods

Marc Conrad, University of Luton13 An Experiment. Implementing abstract mathematics in Java from scratch. Implement a class Ring. Methods which cannot be implemented are declared abstract. Implement a polynomial ring using an abstract Ring as coefficient ring. The polynomial ring is a child of the ring class. Implement Z as a child of the Ring class.  This generates a simple arithmetic for multivariate polynomials with integral coefficients. See for a Java implementation.

Marc Conrad, University of Luton14 Some results It is astonishing simple to implement complex mathematical structures in an object oriented environment from scratch. Drawbacks: Performance. Decisions on how to organise classes (e.g. is field a property of a ring or is it a child class of a ring). Special algorithms as primality testing or factoring do not fit into an object oriented environment.

Marc Conrad, University of Luton15 More abstract structures It is possible to work with abstract structures! Modular Ring R/p(x), where R is abstract. Quotient Field Quot(R), where R is abstract. Same amount of work as implementing Z/mZ or Q. Infinite algebraic extensions. Multivariate polynomials can be used although only univariate polynomials have been implemented Advanced structures can be derived as child classes: Complex numbers, rational function fields, cyclotomic fields... Concepts for automatic mapping from one ring to another.

Marc Conrad, University of Luton16 Conclusions The experiments with Java show that object oriented programming deserves a closer look in the context of mathematics. Knowledge of the mechanism of overriding and dynamic binding allows a straightforward implementation of abstract mathematical structures. Object oriented programming should be a main feature in CAS (as user defined functions a couple of years ago). Mathematical software should use object oriented terminology instead of "reinventing the wheel".

Marc Conrad, University of Luton17 Maple/Mathematica and Object Oriented Programming Maple Not designed to be object oriented. Maple 8.0 allows to link Maple with Java using MathML as interface language The aim however is not to do “object oriented” mathematics but to allow the design of Java applets (MapleNet, Maplets). Mathematica Not designed as an object oriented system. The J/Link technology enables calling of Java classes from Mathematica and vice versa.

Marc Conrad, University of Luton18 Other Systems and Object Oriented Programming Axiom. Although not explicitly designed as an Object Oriented System it has many aspects of this. E.g. a type hierarchy, generic functions, generic types. Since September 2002 Axiom is open source. MuPAD Has clearly object oriented aspects. Allows Domains which are organised similar to a class hierarchy. The user can add own domains. Not related to Java or C++. Limited capabilities compared to Maple/Mathematica.