An Introduction To MAGMA - University Of Auckland

Transcription

An Introduction to MAGMADon TaylorThe University of Sydney13 February 2012Don Taylor (The University of Sydney)Magma Programming13 February 20121 / 31

A little historyMAGMA is a programming language for computer algebra, geometry,combinatorics and number theory. It has extensive support for grouptheoretic computations and can handle permutation groups, matrix groupsand finitely-presented groups. A more complete list of applications will begiven later.The language was developed by John Cannon and his team at theUniversity of Sydney and was released in December 1993. It replacedCAYLEY, also developed by John Cannon.Don Taylor (The University of Sydney)Magma Programming13 February 20122 / 31

MAGMA 2.18The name ‘MAGMA’ comes from Bourbaki (and Serre) where it is used todenote a set with one or more binary operations without any additionalaxioms. Thus a magma is the most basic of algebraic structures.Today, in 2012, Version 2.18 of MAGMA is a huge system with more than5000 pages of documentation in 13 volumes.MAGMA can be used both interactively and as a programming language.The core of MAGMA is programmed in C but a large part of its functionalityresides in package files written in the MAGMA user language.Don Taylor (The University of Sydney)Magma Programming13 February 20123 / 31

OutlineThe following topics will be illustrated by examples drawn from a selectionof MAGMA packages.1Using MAGMA interactively Using files.Printing.The help system.2Essential data structures: sets, sequences, records and associativearrays.3Functions and procedures, function expressions and maps.4MAGMA’s type system and coercion.5The MAGMA language and styles of programming.Don Taylor (The University of Sydney)Magma Programming13 February 20124 / 31

The MAGMA designThe design principles underpinning both the user language and systemarchitecture are based on ideas from universal algebra and category theory.The MAGMA language attempts to approximate the usual mathematicalmodes of thought and notation as closely as possible. In particular, theprincipal constructs in the user language are sets, algebraic structures suchas groups, rings and fields and morphisms.[The following three slides are from the MAGMA documentation.]Don Taylor (The University of Sydney)Magma Programming13 February 20125 / 31

The MAGMA languageImperative language with standard imperative-style statements andproceduresA functional subset providing closures, higher-order functions, andpartial evaluationGeneral aggregate data types based on algebraic notions: set,sequence, mapping, magmaUniversal structure constructors providing a general mechanism for theconstruction of magmas and mappingsSimple but powerful notation for constructing sets and sequences in anatural mathematical styleSet and sequence operations which are implemented with a strongemphasis on efficiencyCoercion between magmas (including automatic coercion)A package mechanism to support modular program constructionDon Taylor (The University of Sydney)Magma Programming13 February 20126 / 31

The MAGMA languageImperative language with standard imperative-style statements andproceduresA functional subset providing closures, higher-order functions, andpartial evaluationGeneral aggregate data types based on algebraic notions: set,sequence, mapping, magmaUniversal structure constructors providing a general mechanism for theconstruction of magmas and mappingsSimple but powerful notation for constructing sets and sequences in anatural mathematical styleSet and sequence operations which are implemented with a strongemphasis on efficiencyCoercion between magmas (including automatic coercion)A package mechanism to support modular program constructionDon Taylor (The University of Sydney)Magma Programming13 February 20126 / 31

The MAGMA languageImperative language with standard imperative-style statements andproceduresA functional subset providing closures, higher-order functions, andpartial evaluationGeneral aggregate data types based on algebraic notions: set,sequence, mapping, magmaUniversal structure constructors providing a general mechanism for theconstruction of magmas and mappingsSimple but powerful notation for constructing sets and sequences in anatural mathematical styleSet and sequence operations which are implemented with a strongemphasis on efficiencyCoercion between magmas (including automatic coercion)A package mechanism to support modular program constructionDon Taylor (The University of Sydney)Magma Programming13 February 20126 / 31

The MAGMA languageImperative language with standard imperative-style statements andproceduresA functional subset providing closures, higher-order functions, andpartial evaluationGeneral aggregate data types based on algebraic notions: set,sequence, mapping, magmaUniversal structure constructors providing a general mechanism for theconstruction of magmas and mappingsSimple but powerful notation for constructing sets and sequences in anatural mathematical styleSet and sequence operations which are implemented with a strongemphasis on efficiencyCoercion between magmas (including automatic coercion)A package mechanism to support modular program constructionDon Taylor (The University of Sydney)Magma Programming13 February 20126 / 31

The MAGMA languageImperative language with standard imperative-style statements andproceduresA functional subset providing closures, higher-order functions, andpartial evaluationGeneral aggregate data types based on algebraic notions: set,sequence, mapping, magmaUniversal structure constructors providing a general mechanism for theconstruction of magmas and mappingsSimple but powerful notation for constructing sets and sequences in anatural mathematical styleSet and sequence operations which are implemented with a strongemphasis on efficiencyCoercion between magmas (including automatic coercion)A package mechanism to support modular program constructionDon Taylor (The University of Sydney)Magma Programming13 February 20126 / 31

The MAGMA languageImperative language with standard imperative-style statements andproceduresA functional subset providing closures, higher-order functions, andpartial evaluationGeneral aggregate data types based on algebraic notions: set,sequence, mapping, magmaUniversal structure constructors providing a general mechanism for theconstruction of magmas and mappingsSimple but powerful notation for constructing sets and sequences in anatural mathematical styleSet and sequence operations which are implemented with a strongemphasis on efficiencyCoercion between magmas (including automatic coercion)A package mechanism to support modular program constructionDon Taylor (The University of Sydney)Magma Programming13 February 20126 / 31

The MAGMA languageImperative language with standard imperative-style statements andproceduresA functional subset providing closures, higher-order functions, andpartial evaluationGeneral aggregate data types based on algebraic notions: set,sequence, mapping, magmaUniversal structure constructors providing a general mechanism for theconstruction of magmas and mappingsSimple but powerful notation for constructing sets and sequences in anatural mathematical styleSet and sequence operations which are implemented with a strongemphasis on efficiencyCoercion between magmas (including automatic coercion)A package mechanism to support modular program constructionDon Taylor (The University of Sydney)Magma Programming13 February 20126 / 31

The MAGMA languageImperative language with standard imperative-style statements andproceduresA functional subset providing closures, higher-order functions, andpartial evaluationGeneral aggregate data types based on algebraic notions: set,sequence, mapping, magmaUniversal structure constructors providing a general mechanism for theconstruction of magmas and mappingsSimple but powerful notation for constructing sets and sequences in anatural mathematical styleSet and sequence operations which are implemented with a strongemphasis on efficiencyCoercion between magmas (including automatic coercion)A package mechanism to support modular program constructionDon Taylor (The University of Sydney)Magma Programming13 February 20126 / 31

The MAGMA environmentCommand completion and interactive line editingHistory system with recall and editing of previous linesA hierarchical online help facilityPackages containing user-defined intrinsics with automatic compilationEnvironment variables for configuring style of output, etc.Get/set functions and procedures for configuring style, etc.Verbose options for built-in functionsLogging of output, redirection of I/OSpecial file type for fully-featured file I/OAbility to execute system commands from within MagmaInput/output pipes for communication with external programsDon Taylor (The University of Sydney)Magma Programming13 February 20127 / 31

The MAGMA environmentCommand completion and interactive line editingHistory system with recall and editing of previous linesA hierarchical online help facilityPackages containing user-defined intrinsics with automatic compilationEnvironment variables for configuring style of output, etc.Get/set functions and procedures for configuring style, etc.Verbose options for built-in functionsLogging of output, redirection of I/OSpecial file type for fully-featured file I/OAbility to execute system commands from within MagmaInput/output pipes for communication with external programsDon Taylor (The University of Sydney)Magma Programming13 February 20127 / 31

The MAGMA environmentCommand completion and interactive line editingHistory system with recall and editing of previous linesA hierarchical online help facilityPackages containing user-defined intrinsics with automatic compilationEnvironment variables for configuring style of output, etc.Get/set functions and procedures for configuring style, etc.Verbose options for built-in functionsLogging of output, redirection of I/OSpecial file type for fully-featured file I/OAbility to execute system commands from within MagmaInput/output pipes for communication with external programsDon Taylor (The University of Sydney)Magma Programming13 February 20127 / 31

The MAGMA environmentCommand completion and interactive line editingHistory system with recall and editing of previous linesA hierarchical online help facilityPackages containing user-defined intrinsics with automatic compilationEnvironment variables for configuring style of output, etc.Get/set functions and procedures for configuring style, etc.Verbose options for built-in functionsLogging of output, redirection of I/OSpecial file type for fully-featured file I/OAbility to execute system commands from within MagmaInput/output pipes for communication with external programsDon Taylor (The University of Sydney)Magma Programming13 February 20127 / 31

The MAGMA environmentCommand completion and interactive line editingHistory system with recall and editing of previous linesA hierarchical online help facilityPackages containing user-defined intrinsics with automatic compilationEnvironment variables for configuring style of output, etc.Get/set functions and procedures for configuring style, etc.Verbose options for built-in functionsLogging of output, redirection of I/OSpecial file type for fully-featured file I/OAbility to execute system commands from within MagmaInput/output pipes for communication with external programsDon Taylor (The University of Sydney)Magma Programming13 February 20127 / 31

The MAGMA environmentCommand completion and interactive line editingHistory system with recall and editing of previous linesA hierarchical online help facilityPackages containing user-defined intrinsics with automatic compilationEnvironment variables for configuring style of output, etc.Get/set functions and procedures for configuring style, etc.Verbose options for built-in functionsLogging of output, redirection of I/OSpecial file type for fully-featured file I/OAbility to execute system commands from within MagmaInput/output pipes for communication with external programsDon Taylor (The University of Sydney)Magma Programming13 February 20127 / 31

The MAGMA environmentCommand completion and interactive line editingHistory system with recall and editing of previous linesA hierarchical online help facilityPackages containing user-defined intrinsics with automatic compilationEnvironment variables for configuring style of output, etc.Get/set functions and procedures for configuring style, etc.Verbose options for built-in functionsLogging of output, redirection of I/OSpecial file type for fully-featured file I/OAbility to execute system commands from within MagmaInput/output pipes for communication with external programsDon Taylor (The University of Sydney)Magma Programming13 February 20127 / 31

The MAGMA environmentCommand completion and interactive line editingHistory system with recall and editing of previous linesA hierarchical online help facilityPackages containing user-defined intrinsics with automatic compilationEnvironment variables for configuring style of output, etc.Get/set functions and procedures for configuring style, etc.Verbose options for built-in functionsLogging of output, redirection of I/OSpecial file type for fully-featured file I/OAbility to execute system commands from within MagmaInput/output pipes for communication with external programsDon Taylor (The University of Sydney)Magma Programming13 February 20127 / 31

The MAGMA environmentCommand completion and interactive line editingHistory system with recall and editing of previous linesA hierarchical online help facilityPackages containing user-defined intrinsics with automatic compilationEnvironment variables for configuring style of output, etc.Get/set functions and procedures for configuring style, etc.Verbose options for built-in functionsLogging of output, redirection of I/OSpecial file type for fully-f

MAGMA is a programming language for computer algebra, geometry, combinatorics and number theory. It has extensive support for group theoretic computations and can handle permutation groups, matrix groups and finitely-presented groups. A more complete list of applications will be given later. The language was developed by John Cannon and his team at the