Mozart
The Mozart Programming System is the open-source implementation of Oz 3, the multi-paradigm research language from DFKI, SICS and UCLouvain that unified functional, dataflow-concurrent, object-oriented, constraint and distributed programming in one kernel language - the platform behind the textbook Concepts, Techniques, and Models of Computer Programming
Created by Oz was designed from 1991 by Gert Smolka and his group at DFKI Saarbrücken (Martin Henz, Michael Mehl, Ralf Scheidhauer, later Christian Schulte, Denys Duchier, Leif Kornstaedt, Tobias Müller and others); Mozart was built by the Mozart Consortium of Saarland University/DFKI (Smolka), the Swedish Institute of Computer Science (Seif Haridi, Per Brand, Konstantin Popov, Erik Klintskog) and Université catholique de Louvain (Peter Van Roy); Mozart 2 was written at UCLouvain by Sébastien Doeraene and Yves Jaradin
Mozart - in full, the Mozart Programming System - is the open-source implementation of Oz 3, the last major revision of the Oz language. Oz began in June 1991 in Gert Smolka’s Programming Systems Lab at the German Research Center for Artificial Intelligence (DFKI) in Saarbrücken as an attempt to repair the shortcomings of logic programming by adding constraints, concurrency and objects; it ended, eight years and three language revisions later, as a system in which functional, logic, constraint, object-oriented, concurrent and distributed programming were all expressed as thin layers over one small kernel language. Mozart 1.0 was released on 25 January 1999 by a consortium of DFKI/Saarland University, the Swedish Institute of Computer Science (SICS) and the Université catholique de Louvain (UCLouvain). It was widely downloaded in the 2000s, served as the platform for Peter Van Roy and Seif Haridi’s textbook Concepts, Techniques, and Models of Computer Programming (MIT Press, 2004), and in its 64-bit Mozart 2 form still teaches programming paradigms, even though the language’s original research community dispersed long ago.
The name needs a word of explanation. “Oz” (suggested by graduate student Martin Henz) is the language; “DFKI Oz” was the name of the first two implementations (1.0 in 1995, 2.0 in 1996); “Mozart” has been the name of the implementation since 1998. In practice the two words are used interchangeably - the mailing lists were mozart-users and mozart-hackers, the conference was MOZ 2004, and programming-language databases often list the system as “Mozart/Oz”.
History and origins
Out of logic programming (1991-1994)
Oz belongs to a family tree that starts with Prolog. In the 1980s Prolog research split into two lines: concurrent logic programming (Parlog, Concurrent Prolog, GHC and the Japanese Fifth Generation project) and constraint logic programming (Prolog II, CLP(R), finite-domain constraints). Vijay Saraswat’s concurrent constraint model of 1990 reunited them conceptually, and at SICS Sverker Janson and Seif Haridi built the Andorra Kernel Language (AKL) on it, introducing the computation space - a constraint store together with its agents - as the implementation device that made encapsulated search possible inside a concurrent language.
The HYDRA project at DFKI, started in June 1991 by Smolka with Henz, Michael Mehl and Ralf Scheidhauer, had made a first Oz prototype by the time the European ACCLAIM project began in September 1992: an Emacs front end, a compiler written in Smolka’s earlier typed logic language TEL, an abstract machine in C++, and a graphics layer. Two decisions from this period shaped everything after. First, procedures were identified by unique, unforgeable names, which sidestepped undecidable higher-order unification and let Oz be higher-order and logic-based at once. Second, under ACCLAIM’s influence Oz adopted the concurrent constraint model from AKL, replacing CSP-style synchronous communication with asynchronous, dataflow-synchronised communication. In 1993 finite-domain constraints and a higher-order combinator for encapsulated search were added - the HOPL authors call the result “the first concurrent and higher-order programming language that integrates Prolog-style problem solving”, and note that Oz took AKL’s 1991 solution to encapsulated search and made it a first-class, programmable combinator. By November 1993 the system was circulating informally with a 350-page handbook; a study for Daimler-Benz Research, presented on 20 October 1994, argued that Oz beat their Allegro Common Lisp platform for multi-agent work, in some cases by an order of magnitude in implementation effort.
DFKI Oz 1 and 2 (1995-1996)
DFKI Oz 1.0 was publicly released on 23 January 1995: interactive interface, a concurrent Browser that displays data structures as they become bound, incremental compiler, emulator, garbage collector, standalone applications and an object-oriented interface to Tcl/Tk. Oz 1 used implicit thread creation - a statement that blocked was moved into a new thread while the main thread carried on - and an object system in which every method threaded hidden state arguments to keep updates serialised. Christian Schulte’s Explorer, a visual tool for walking a search tree, dates from this period, and the first Oz workshop (WOz'95, Martigny, November 1995) drew about 40 people from academia and industry.
In 1995, as ACCLAIM ended, the Swedish and German groups decided to pool their work into one system. Two national projects, both named PERDIO, began in early 1996 with the stated goal of open, distributed, fault-tolerant applications. Peter Van Roy - who had come to DFKI from DEC’s Paris lab when it closed in October 1994 - spent January 1996 at SICS working on the distribution model, Haridi took a sabbatical in Saarbrücken, and Van Roy moved to UCLouvain in October 1996, creating the three-site consortium that would carry Mozart. During 1996 the language changed radically into Oz 2: threads became explicit (thread ... end), sequential composition the default, the object system was redesigned and made much faster (Henz’s thesis), exceptions were added, and ports - many-to-one asynchronous channels borrowed from AKL - became the building block for actor-style programming. DFKI Oz 2.0 shipped in September 1996 for Unix and Windows.
Oz 3 and Mozart 1.0 (1997-1999)
Oz 3 was a conservative extension of Oz 2 aimed at programming in the large and across networks. Smolka, Denys Duchier and Leif Kornstaedt designed functors and modules: a functor is a module specification, a function from imported modules to a new module, and a running application is a graph of modules. The module manager itself was written in Oz using a new lazy-evaluation mechanism, so modules loaded on first use and applications started in a fraction of a second. Read-only views of variables were added so that abstractions built on logic variables could be encapsulated. Distribution was built on network transparency: all Mozart processes conceptually share one store, a process exports a reference by turning it into a text ticket, and every language type - variables, cells, ports, objects, procedures, records - has its own distributed protocol. Pickles serialised stateless values for storage and for MOGUL, the Mozart Global User Library of third-party packages. A parallel constraint search engine written in a few hundred lines of Oz on top of these facilities showed what the combination could do.
The implementation had been called Mozart since 1998, and Mozart 1.0.0 was released on 25 January 1999 under a BSD-style licence as a 32-bit system comprising about 180,000 lines of C/C++, 140,000 lines of Oz and 65,000 source lines of HTML documentation. It came with the Emacs-based Oz Programming Interface, the Browser, Explorer, the Ozcar debugger, a profiler and standalone-application tooling. Within three days the announcement drew some 17,000 page requests and 250 downloads; the archives show more than 5,000 downloads in 1999 and over 10,000 across 1999-2001.
The Mozart period (1999-2009)
For a decade Mozart was the reference multi-paradigm system. The SourceForge archive records a steady cadence - 1.0.1 (February 1999), 1.1.0 (February 2000), 1.2.0 (May 2001), 1.2.1 to 1.2.5 (2001-2002, with Mac OS X binaries from 1.2.4 alongside Linux, FreeBSD, Solaris and Windows), 1.3.0 and 1.3.1 (April and June 2004), 1.3.2 (June 2006) and 1.4.0 (July 2008). The language itself stayed almost fixed: the main semantic fix was making lazy evaluation properly declarative in 2003. The big engineering changes were in distribution, redesigned as a modular subsystem separate from the emulator (Erik Klintskog, 2005) and given language-level failure detection (Raphaël Collet, 2007).
The community activity of these years was real: the mozart-users list was highly active from 2001 to 2009; MOGUL accumulated 68 packages, 58 from outside the core team; MOZ 2004 in Charleroi had 49 participants and 23 papers, 16 by outsiders, published as LNCS 3389; and Oz was adopted as the primary teaching language at sixteen universities unconnected with its authors. Most durably, Van Roy and Haridi spent 1999-2003 writing Concepts, Techniques, and Models of Computer Programming (“CTM”), which organised programming itself around Oz’s layered kernel languages and had sold more than 10,000 copies by 2018. Stewardship passed in 2005 from the Consortium to a Mozart Board of senior community members.
Then it stopped. In the HOPL authors’ own assessment, “we failed to navigate the transition between funded research … and open-source development”. Once Mozart 1.0 had achieved the goal of multi-paradigm programming, the sense of purpose faded; the German and Swedish teams moved on (Schulte to the Gecode constraint library, Smolka’s lab to Alice ML), key developers were PhD students who graduated, and after 1.4.0 in July 2008 only Van Roy’s group at UCLouvain remained.
Mozart 2 and the education period (2009-present)
All Mozart 1 releases were 32-bit, which became a serious problem as desktops went 64-bit. Mozart 2 is a clean reimplementation of the virtual machine, started at UCLouvain’s PLDC group by Sébastien Doeraene and Yves Jaradin (repository created December 2011, first alpha tagged December 2012). It is a 64-bit C++11 VM with a reflection interface intended to let distribution be reimplemented in Oz itself - a plan that was never completed - and it dropped the constraint and distribution subsystems, since the UCL team “did not have the resources” and its priority was teaching. Constraint support through an interface to Gecode was announced as planned but did not ship. Two 2014 master’s projects added list comprehensions (François Fonteyn) and an Erlang-style multicore extension in which Mozart processes exchange copied values through ports (Benoit Daloze). Mozart 2.0.1, released on 5 September 2018 by Guillaume Maudoux and described as “the first stable release of Mozart2”, shipped x86-64 packages for Linux, macOS and Windows.
UCLouvain kept using Oz to teach every engineering student for fifteen years and, after joining edX in 2013, ran the course as two MOOCs, Louv1.1x and Louv1.2x, until 2018 - about 50,000 students in all, with Oz exercises auto-graded on the INGInious platform.
Design philosophy
The kernel language approach
The defining idea of Oz, and of CTM, is that a large practical language should be defined as syntactic sugar over a tiny kernel language with a simple formal semantics, and that each programming paradigm corresponds to a particular kernel language obtained by adding one concept at a time. Start with a declarative kernel (values, single-assignment variables, procedures, if, case); add thread and you have declarative dataflow concurrency, still deterministic; add lazy evaluation (fun lazy) and you have demand-driven programming; add ports and you have message-passing (actor) concurrency; add cells (mutable state) and you have imperative and object-oriented programming; add computation spaces and you have constraint and relational programming. Every layer is a conservative extension, so a program written in the smaller layer keeps its meaning and its reasoning properties inside the larger one. CTM states the discipline as the principle of least expressiveness: “the right computation model for the component is the least expressive model that results in a natural program”.
Explicitness
The HOPL authors record that they repeatedly tried to make things implicit - maximal concurrency by default, implicit thread creation in Oz 1, implicit search in the Prolog tradition - and repeatedly reversed course. Oz 2 and 3 create threads only where the program says thread, perform search only inside an explicit computation space driven by a programmer-chosen engine, and make distribution explicit in the acts of creating tickets and choosing protocols while keeping semantics network-transparent.
Development methodology
The Oz team combined implementors and theoreticians: no abstraction was admitted without a prototype and an application that needed it, and none without a simple formal semantics. That is why the core language stayed so stable after 1999, and why almost every feature has a corresponding academic paper - the Programming Systems Lab’s work on futures and by-need synchronisation, Schulte’s Programming Constraint Services (LNAI 2302, 2002), Henz’s Objects for Concurrent Constraint Programming (1997), Duchier, Gardent and Niehren’s 300-page lecture notes on Oz for natural-language processing (1999), and the dissertations of Mehl and Scheidhauer on the virtual machine.
Key features
Syntax in brief
Oz syntax is unusual, and the designers came to regard that as a mistake (see below). Procedure and function calls use braces, {Browse X}; records are written tree(key:K left:L right:R); lists use | and [a b c]; variables begin with a capital letter, atoms with a lower-case one; and everything is a statement inside declare ... end, local ... in ... end, proc {...} ... end or fun {...} ... end.
declare
fun {Fact N}
if N == 0 then 1 else N * {Fact N-1} end
end
{Browse {Fact 20}}
Dataflow variables and declarative concurrency
An Oz variable is a single-assignment dataflow variable: it is created unbound, may be bound exactly once, and any operation that needs its value suspends until it is bound. Combined with cheap threads, this gives concurrency that is deterministic - the result of a program does not depend on the scheduler.
declare X Y Z
thread Z = X + Y end % suspends until X and Y are bound
thread X = 40 end
Y = 2
{Browse Z} % displays 42 once Z is bound
Mozart’s threads are “ultralightweight”: the system was built to run hundreds of thousands of them in one operating-system process, and the iCities simulator used that to model a million agents.
Lazy evaluation
fun lazy creates a function whose body runs only when its result is needed, and the result is an ordinary dataflow variable, so laziness composes with concurrency without a separate mechanism:
declare
fun lazy {Ints N} N | {Ints N+1} end
L = {Ints 0}
{Browse {List.take L 5}} % [0 1 2 3 4]
Ports and message passing
A port is a many-to-one channel whose messages appear on a stream (a list whose tail is an unbound variable). Reading the stream in a thread gives an actor:
declare S P
P = {NewPort S}
thread for M in S do {Browse M} end end
{Send P hello}
{Send P world}
State and objects
Mutable state enters through cells ({NewCell 0}, @C, C := V); the class system is built on cells and records, with attributes, multiple inheritance, features, and a $ nesting marker for returning values from methods:
declare
class Counter
attr val
meth init(N) val := N end
meth inc(Step) val := @val + Step end
meth get(N) N = @val end
end
C = {New Counter init(0)}
{C inc(5)}
{Browse {C get($)}} % 5
Constraints and computation spaces (Mozart 1 only)
Mozart 1 provides finite-domain and finite-set constraints, propagators written in C++ through an interface, and computation spaces as first-class values: a space encapsulates a constraint store and the threads working on it, and search engines (SearchAll, SearchOne, branch-and-bound, the graphical Explorer, a parallel distributed engine) are ordinary Oz programs that clone and commit spaces. The classic SEND + MORE = MONEY puzzle from the Mozart finite-domain tutorial reads:
declare
proc {Money Root}
S E N D M O R Y
in
Root = sol(s:S e:E n:N d:D m:M o:O r:R y:Y)
Root ::: 0#9
{FD.distinct Root}
S \=: 0
M \=: 0
1000*S + 100*E + 10*N + D
+ 1000*M + 100*O + 10*R + E
=: 10000*M + 1000*O + 100*N + 10*E + Y
{FD.distribute ff Root}
end
{Browse {SearchAll Money}}
Because spaces are values, Mozart could offer “first-class Prolog top levels”: several independent searches running concurrently inside one program, each yielding solutions on demand.
Distribution (Mozart 1 only)
A Mozart 1 process could export any reference as a ticket string, and the receiving process then used the reference as if it were local, with the system choosing a protocol per type - mobile-state protocols for cells and objects, eager or lazy copying for procedures and records. Code (classes, procedures) moved between machines automatically because it was just data. Failure detection was exposed in the language after Collet’s 2007 redesign.
Tools and standalone programs
The Emacs-based OPI let you select any region and feed it to the running system; the Browser and later the Inspector displayed live, partially-bound data structures; Ozcar was the debugger; the Explorer drew search trees; QTk (Donatien Grolaux, 2001) described Tk user interfaces as Oz records. Standalone programs are functors compiled with ozc:
functor
import
System
Application
define
{System.showInfo "Hello, World!"}
{Application.exit 0}
end
ozc -x hello.oz produces an executable that runs on the Mozart emulator.
Evolution
| Version | Date | Group | What changed |
|---|---|---|---|
| Oz prototype | 1992 | DFKI (HYDRA) | Named first-class procedures, records inspired by LIFE, Emacs front end, TEL compiler, C++ abstract machine |
| Informal Oz | November 1993 | DFKI | Concurrent constraint model, finite-domain constraints, encapsulated search combinator, 350-page handbook |
| DFKI Oz 1.0 | 23 January 1995 | DFKI | First public release: Browser, incremental compiler, emulator, GC, Tcl/Tk objects; implicit threads |
| DFKI Oz 2.0 | September 1996 | DFKI with SICS | Explicit threads, new object system, exceptions, ports; Unix and Windows |
| Mozart 1.0.0 (Oz 3) | 25 January 1999 | Mozart Consortium (DFKI/Saarland, SICS, UCLouvain) | Functors and modules, lazy loading, pickling, network-transparent distribution, MOGUL; BSD-style licence; 32-bit |
| Mozart 1.1 - 1.3.2 | 2000-2006 | Consortium, then Mozart Board | Mac OS X, FreeBSD and Solaris builds; declarative laziness (2003); modular distribution subsystem (2005) |
| Mozart 1.4.0 | July 2008 | Mozart Board | Last full-featured release; redesigned failure detection; final macOS rebuild February 2012 |
| Mozart 2.0.0-alpha | December 2012 | UCLouvain PLDC | New 64-bit C++11 VM, reflection interface; constraints and distribution dropped; list comprehensions and multicore extension in 2014 |
| Mozart 2.0.1 | 5 September 2018 | UCLouvain and volunteers | First stable Mozart 2; x86-64 packages for Linux, macOS, Windows; CI |
Current relevance
Mozart is dormant as a research project and quietly maintained as a teaching tool. The last release is 2.0.1 from September 2018; the GitHub repository still accepts small fixes (April 2023, February 2025, January 2026) but there is no roadmap, and the promised return of constraint and distributed programming to Mozart 2 never happened. Anyone who needs those features runs Mozart 1.4.0, a 32-bit binary from 2008, which is why UCLouvain students packaged it in a Docker container in 2021 and why it survives in course images and community packaging rather than in mainstream distribution repositories. The Mozart 1.4.0 documentation, the MOGUL archive and the full HOPL history remain online at mozart2.org.
The designers’ own verdict, published in 2020, is unusually frank. The multi-paradigm goal was achieved, but the community was not: the syntax was “widely different from existing syntaxes”, verbose for lambdas and unpolished for objects, and created a threshold that kept newcomers out; more importantly, researchers who had built the system under grant funding never managed the handover to volunteer open-source development. Their advice to future designers - be prepared to make big syntax changes, as Erlang’s community did with Elixir - reads as a lesson learned at their own expense. UCLouvain master’s theses in 2020 and 2021, under a project called NewOz, have since explored a modernised, Scala-inspired syntax for Oz, with a NewOz-to-Oz compiler, but it has not been adopted by the Mozart system itself.
Why it matters
Oz and Mozart matter far beyond their user base. Concepts that were exotic in 1999 and are ordinary now were worked out here in a single coherent system: ultralightweight threads with shared immutable data (the HOPL authors point to Go), the mutable/immutable distinction (Scala lists Oz among its influences, and Sébastien Doeraene - later the author of Scala.js - built Ozma to put Oz’s dataflow and ports into Scala), deterministic dataflow of the kind cloud analytics tools rely on, actors that return futures, and first-class computation spaces that let search strategies be programmed independently of the constraint model - the idea Christian Schulte carried into Gecode, one of the most used constraint solvers. Alice ML from Smolka’s lab extended Standard ML with Oz-style futures and constraints and ran its early versions on the Mozart VM.
Above all, Oz is the language of Concepts, Techniques, and Models of Computer Programming. Because the language was layered from the start, it could serve as the one notation in which a textbook shows functional, dataflow, message-passing, stateful, object-oriented and constraint programming as a sequence of small additions to a common kernel, each with reasoning techniques appropriate to it. That approach - teaching paradigms as concepts rather than as languages - was taught to every UCLouvain engineering student for fifteen years and to tens of thousands more through edX, and it is the reason a research system from 1999 is still installed on students’ laptops.
Further reading
- Peter Van Roy, Seif Haridi, Christian Schulte and Gert Smolka, “A History of the Oz Multiparadigm Language”, Proc. ACM Program. Lang. 4, HOPL, Article 83 (June 2020): doi.org/10.1145/3386333 (PDF at webperso.info.ucl.ac.be/~pvr)
- Mozart Programming System site, with Mozart 2 downloads, publications list and Mozart 1.4.0 documentation: mozart2.org (also mozart.github.io)
- Mozart 2 source and releases: github.com/mozart/mozart2; Mozart 1 source: github.com/mozart/mozart
- All Mozart 1.x binaries (1.0.0 to 1.4.0, dated directories): sourceforge.net/projects/mozart-oz/files/v1
- Peter Van Roy and Seif Haridi, Concepts, Techniques, and Models of Computer Programming, MIT Press, 2004: mitpress.mit.edu
- Gert Smolka, “The Oz Programming Model”, in Computer Science Today, LNCS 1000, 1995
- Peter Van Roy (ed.), Multiparadigm Programming in Mozart/Oz: Second International Conference, MOZ 2004, LNCS 3389, Springer, 2005
- The DFKI Oz 2.0 system page: ps.uni-saarland.de/oz2
- Community Docker image for Mozart 1.4.0 (UCLouvain, 2021): github.com/fdekeers/mozart-container
Timeline
Notable Uses & Legacy
SimGen for SimICS/Simics (Virtutech, later Intel and Wind River)
SimGen, the tool that generates the interpreter core of the SimICS full-system simulator from an instruction-set specification, was written by Fredrik Larsson - originally in C for Ericsson's APZ switch processor project, then rewritten in Oz from early 1997 for its symbolic-manipulation needs. It used Mozart's constraint solver to check valid instruction patterns, was later moved to Mozart 2 with a custom finite-domain solver, and, according to the 2020 HOPL paper, is still in use, making it 'probably one of the longest lasting projects using Mozart'
Friar Tuck sports-tournament scheduler
Martin Henz built Friar Tuck, a round-robin tournament scheduler, on Mozart's finite-domain constraints and GUI tools. It scheduled tournaments in England and the USA in 1999-2000 (the West of England Club Cricket Championship, the Wisconsin Intercollegiate Athletic Conference) and, according to Henz's 2001 paper as summarised in the HOPL history, reproduced the 1997/98 Atlantic Coast Conference basketball schedule in about one minute of computation where the accepted Nemhauser-Trick integer-programming approach had reportedly taken 24 hours. The company founded around it, now Workforce Optimizer, later replaced the Mozart solver with a local-search max-SAT solver when workforce problems outgrew it
OMEGA proof assistant (DFKI and Saarland University)
Jörg Siekmann's OMEGA mathematical assistant - a proof planner with the LOUI distributed graphical interface, the MBase mathematical database, the LINEQ constraint solver and bridges to provers such as OTTER, SPASS and INKA and to computer algebra systems - was one of the first large applications built on Mozart, exercising its distributed, constraint and GUI programming together
iCities agent simulation (EU project, 2000-2003)
A discrete-time simulator of web users and sites written entirely in Oz using Mozart's network-transparent distribution, lightweight threads and dataflow synchronisation. According to the figures reported by Popov et al. (2003) and repeated in the HOPL history, in 2002 it supported up to a million simulated users on ten thousand sites; on a cluster of 16 AMD Athlon 1900+ machines on 100 Mbit switched Ethernet under Linux it achieved parallel speedups of 11 to 14 over a single machine, on which ten thousand users doing a hundred steps took about one minute at 1 GHz
Strasheela and computer-music constraint programming
Torsten Anders implemented Strasheela, a generic music constraint system in which a composer specifies a score as a constraint satisfaction problem over a rich polyphonic music representation, in Mozart as part of his PhD (Queen's University Belfast, 2007). An earlier Oz music system, COMPOzE (Henz, Lauer and Zimmermann, 1996), composed four-voice pieces by constraint programming
Programming education: UCLouvain, 16 other universities and two edX MOOCs
Oz was the primary language of programming courses at 16 universities beyond the authors' own (Iowa State, Brigham Young, Texas A&M, Rensselaer, Dartmouth, NTNU, the National University of Singapore, Linköping and others) and taught all UCLouvain engineering students for 15 years. From 2013 to 2018 the course ran as the edX MOOCs Louv1.1x and Louv1.2x, covering five paradigms with Oz exercises auto-graded on the INGInious platform; around 50,000 students attended
Language Influence
Influenced By
Influenced
Running Today
Run examples using the official Docker image:
docker pull fdekeers/mozart-1.4.0Example usage:
docker run --rm -v $(pwd):/work -w /work fdekeers/mozart-1.4.0 bash -c 'ozc -x hello.oz && ./hello'