﻿<?xml-stylesheet type="text/xsl" href="templates/doc.xsl"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
<html 
	xmlns="http://www.w3.org/1999/xhtml" 
	xmlns:doc="http://www.lepus.org.uk/doc" 
	xmlns:classz="http://www.lepus.org.uk/classz" 
	xmlns:fopl="http://www.lepus.org.uk/fopl" 
	xml:lang="en" 
	xmlns:v="urn:schemas-microsoft-com:vml" 
	xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml">
	
<head>
	<link rel="stylesheet" type="text/css" href="http://www.lepus.org.uk/templates/doc.css" />
	<title>About LePUS3 and Class-Z</title>
	<meta name="Author" content="Amnon H Eden" />
</head>

<body>

<p class="pagetitle">About LePUS3 and Class-Z</p>

<div class="abstract">

	<p>
		LePUS3 and Class-Z are formal object-oriented Design Description Languages. 
		They are formal specification lanaguges for modelling non-functional specifications 
		representing the design of object-oriented class libraries, design patterns, and object-oriented application frameworks
		(<a href="http://www.lepus.org.uk/about.xml#What_can_be_modelled_with_LePUS3">What can be modelled with LePUS3</a>).
		LePUS3 diagrams ('Codecharts', or simply charts) are <a href="http://www.lepus.org.uk/ref/refman/refman.xml">axiomatized</a>
		as decidable statements in the first-order predicate logic. 
		LePUS3 is tailored for tool support in fully automated design verification (ie, checking conformance to Codecharts) 
		and program visualization (ie design recovery from source code), 
		as demonstrated by the the <a href="http://ttp.essex.ac.uk/">Two-Tier Programming Toolkit</a>. 
	</p>

</div>

<doc:toc />

<div class="abstract">

	<p>Related links:</p>
		
	<ul>
		<li><a href="ref/lepus3-tutorial.pdf"><strong>Tutorial</strong>: Object-Oriented Modelling with LePUS3 and Class-Z</a> [<a href="ref/lepus3-tutorial.pdf">.pdf</a>][<a href="ref/lepus3-tutorial.ppt">.ppt</a>]</li>
		<li><a href="http://www.lepus.org.uk/ref/legend/legend.xml"><strong>Legend</strong>: Key to LePUS3 and Class-Z Symbols</a></li>
		<li><a href="ref/refman/refman.xml"><strong>Reference Manual</strong> for LePUS3 &amp; Class-Z</a></li>
		<li><a href="ref/companion/"><strong>The 'Gang of Four' Companion</strong>: Formal specification of design patterns in LePUS3 and Class-Z</a></li>
	</ul>
	
</div>


<h1>Objectives</h1>
<p>LePUS3 and Class-Z are formal Design Description Languages tailored for the following purposes:</p>

<ul>
	<li><strong>Scalability</strong>: To model industrial-scale programs using small Codecharts with only few symbols</li>
	<li><strong>Automated design verifiability</strong>: To allow programmers to continuously keep the design in synch with the implementation</li>
	<li><strong>Visualization</strong> (only LePUS3): To allow tools to reverse-engineer legible Codecharts from plain source code modelling their design</li>
	<li><strong>Pattern verification</strong>: To allow tools to determine automatically whether your program <em>implements</em> a design pattern</li>
	<li><strong>Abstraction in early design</strong>: To specify unimplemented programs without committing prematurely to implementation minutia</li>
	<li><strong>Genericity</strong>: To model a design pattern not as a specific implementation but as a design motif</li>
	<li><strong>Rigour</strong>: To be rigorous and allow software designers to be sure exactly what Codecharts mean and reason rigorously about them</li>
</ul>



<h1>What can be modelled with LePUS3</h1>

<table class="chartandschema">
	<tr>
		<td><img class="chart" alt="Collections and Iterators in java.util" src="spec/closed/IteratorImp/IteratorImp1DimHrc.gif" /></td>
		<td><img class="chart" alt="Iterator pattern" src="spec/gof/lepus3/Iterator.gif" /></td>
		<td><img class="chart" alt="Java RMI" src="spec/hybrid/rmi/rmi.gif" /></td>
	</tr>
	
	<tr>
		<th>Object-oriented 
			<a href="http://lepus.org.uk/spec/#Programs_and_class_libraries">programs</a><br />
			(Above: <a href="ref/companion/Composite.xml#Sample_Implementations">
			collections and iterators in java.util</a>)</th>
		<th>Object-oriented 
			<a href="http://lepus.org.uk/ref/companion/">design patterns</a><br />
			(Above: <a href="ref/companion/Iterator.xml">Iterator pattern</a>)
		</th>
		<th>Object-oriented 
			<a href="http://lepus.org.uk/spec/#Application_Frameworks_">application frameworks</a><br />
			(Above: <a href="spec/hybrid/rmi/rmi.xml">Java RMI</a>)
		</th>
	</tr>
</table>

<h1>Context</h1>

<p>LePUS3 and Class-Z relate to languages of the following broad categories:</p>

<ol>
	<li><strong>Object oriented modelling languages</strong> (e.g., UML) are (mostly visual) 
		notations that represent the building-blocks in the design of object-oriented 
		programs.
	<ul>
		<li>Unlike UML, LePUS3 and Class-Z a formal language that are unpacked in a subset of the (first-order) predicate logic </li>
		<li>Unlike UML, Codecharts (specifications in LePUS3) and schemas (specifications in Class-Z) are <a href="http://ttp.essex.ac.uk/index.php?page=verification"> automatically verifiable</a></li>
	</ul>
	</li>
	<li><strong>Formal Specification Languages</strong> are mathematical languages (such as Z, B, and CSP) used to articulate properties of software systems in a language that lends itself to reasoning and verification.
		<ul>
			<li>Unlike these languages, LePUS3 is a visual language and charts therein are decidable formulas.</li>
			<li>Unlike these languages, specifications in LePUS3 are<a href="http://ttp.essex.ac.uk/index.php?page=verification">automatically verifiable</a>
			</li>
		</ul>
	</li>
	<li><strong>Logic Visual Languages </strong>use diagrams to articulate sentences in mathematical logic.
		<ul>
			<li>LePUS3 is a logic visual language geared towards specifications of object-oriented design.</li>
		</ul>
	</li>
	<li><strong><a href="http://www.sei.cmu.edu/str/descriptions/adl_body.html">Architecture Description Languages</a></strong> 
		are non-functional, [semi-]formal specification languages used to 
		represent [architectural-]design decisions, normally associated with tools 
		which integrate specifications with their implementations.
		<ul>
			<li>LePUS3 and Class-Z are Design Description Languages, not 
				Architecture Description Languages. This means, among others, that 
				LePUS3 is suitable for modelling Java programs and design patterns, not 
				architectural styles.
			</li>
		</ul>
	</li>
	<li><strong>Program Visualization Notations </strong>offer a graphical representation of the program in a higher level of 
		abstraction, normally generated by reverse-engineering the source code of 
		the program (see how this is done by the
		<a href="http://ttp.essex.ac.uk/index.php?page=navigation">Design Navigator</a>).
	</li>
</ol>


<h1>The building-blocks of object-oriented design</h1>

<p>Object-oriented programs written in languages such as Java, C++, C# and 
	Smalltalk are encoded in text files ('source-code') which span 
	across many files and directories. The size and complexity of these systems 
	render code-level reasoning prohibitive; we cannot afford to design, understand, 
	and use large systems by reading source code. Instead, we employ <em>design abstractions</em>: mental pictures of course-grained class hierarchies and sets of 
	dynamically-bound methods and their interaction. These building-blocks can be 
	coarse or refined, depending on the level of abstraction. A good specification 
	language must allow us to represent these building-blocks at <em>all</em> levels 
	of abstraction (<a href="#Example:_Composite_Pattern_in_java.awt">example below</a>).
</p>

<p>We contend that a minimal set of conceptual building-blocks of object-oriented design 
	can be observed [<a href="http://www.eden-study.org/articles/2002/isf4(4).pdf">Eden 
	2002</a>], that these building-blocks are amenable to formal analysis (using mathematical logic and finite set 
	theory), and that they can be adequately expressed in a visual formalism 
	(LePUS3). These building-blocks include the following:
</p>
<ol>
	<li>Individual classes (&quot;<a href="http://www.lepus.org.uk/ref/refman/refman.xml#Class_of_dimension_0">classes 
		of dimension 0</a>&quot;) and methods (&quot;<a href="http://www.lepus.org.uk/ref/refman/refman.xml#Method_of_dimension_0">methods 
		of dimension 0</a>&quot;)
	</li>
	<li>Properties of individual classes and methods (&quot;<a href="http://www.lepus.org.uk/ref/refman/refman.xml#Unary_relation">unary 
		relations</a>&quot;) and relations amongst them (&quot;<a href="http://www.lepus.org.uk/ref/refman/refman.xml#Binary_relation">binary 
		relations</a>&quot;)
	</li>
	<li>Sets of classes (&quot;<a href="http://www.lepus.org.uk/ref/refman/refman.xml#class_of_dimension_1">classes 
		of dimension 1</a>&quot;) and methods (&quot;<a href="http://www.lepus.org.uk/ref/refman/refman.xml#Method_of_dimension_1">methods 
		of dimension 1</a>&quot;), in particular dynamically-bound methods
	</li>
	<li>
		Correlations between sets of classes and methods (&quot;<a href="http://www.lepus.org.uk/ref/refman/refman.xml#Predicates">predicates</a>&quot;)
	</li>
</ol>

<p>LePUS3 and Class-Z were tailored to model these building-blocks in a minimal vocabulary.</p>


<table align="center" class="chartandschema">
	<tr>
		<td><img class="chart" alt="" src="http://www.lepus.org.uk/ref/legend/lepus3/vocabulary.gif" /></td>
	</tr>
	
	<tr>
		<th>LePUS3 <a name="vocabulary">vocabulary</a> (see also: <a href="ref/legend/legend.xml">LePUS3 and Class-Z Legend</a>)</th>
	</tr>
</table>



<h1>Principles</h1>

<ul>
	<li><strong>Visuality</strong>: Specifications are articulated using a visual language.
		<ul>
			<li>LePUS3 was tailored to visualize the
				<a href="#The_Building-Blocks_of_Object-Oriented_Design">building-blocks of 
				object-oriented design</a> using a minimal
				<a href="ref/legend/legend.xml">vocabulary</a>. LePUS3 is therefore a 
				notation for software visualization, the language of Codecharts that the
				<a href="http://ttp.essex.ac.uk/index.php?page=navigation">Design Navigator</a> 
				reverse-engineers from any Java 1.4 program. 
			</li>
		</ul>
	</li>
	<li><strong>Verifiability</strong>: Design specifications can be verified fully automatically by a tool (see: the
		<a target="_blank" href="http://ttp.essex.ac.uk/index.php?page=verification">Two-Tier Programming Toolkit</a>).
		<ul>
			<li>LePUS3 and Class-Z specifications are <em>turing decidable,</em> meaning that a 
				design verification tool 
				can determine fully automatically whether a given program <em>satisfies </em>
				the specification, calculating the result in polynomial time and space 
				complexity. In contrast, the main difficulty with 
				other languages has been in the task of proving correctness in practical 
				applications. While formal verification of statements in the majority of 
				formal specification/modelling languages, if possible at all (few 
				specification languages are well-defined, fewer are turing-decidable) is 
				generally a matter of laborious, error-prone manual process.
			</li>
		</ul>
	</li>
	<li><strong>Scalability</strong>: Specifications should model industrial-scale programs using small Codecharts with only few symbols.
		<ul>
			<li>One of the biggest impediments to existing modelling notations is 
				the attempt to model the minute details of programs, yielding 
				highly-cluttered diagrams which do not scale. In contrast, the <a href="ref/legend/legend.xml">potent 
				abstraction mechanisms</a> in LepUS3 and Class-Z scale well and 
				specifications do not clutter with the size of the program. In particular, 
				small and highly abstract specifications (&#8216;architectural charts&#8217;) can be 
				serve as architectural &#8216;road-maps&#8217; to large-scale software.
			</li>
		</ul>
	</li>
	<li><strong>Rigour</strong>: A formal definition defines the semantics 
		of specifications, the 
		mathematical relation between specification and programs, and allows 
		us to reason rigorously about 
		specifications.
		<ul>
			<li>LePUS3 and Class-Z are
				<a target="_blank" href="http://www.cs.cmu.edu/~wing/publications/Wing90a.pdf">formal specification languages</a>. Each specification (in LePUS3:
				<a href="http://www.lepus.org.uk/ref/refman/refman.xml#Chart">Chart</a>, in 
				Class-Z: <a href="http://www.lepus.org.uk/ref/refman/refman.xml#Schema">Schema</a>) stands for a sentence in an axiomatized, recursive 
				(turing-decidable) subset of the 1st-order predicate logic. A 
				semantics is defined using finite structures in mathematical logic, a 
				representation of which (i.e. a relational database of entities and 
				relations) can be generated mechanically from pure source code in 
				programming languages such as Java, C++, and Smalltalk.
			</li>
		</ul>
	</li>
	<li><strong>Abstraction</strong>: A design description language should be 
		abstract in the following senses: It should&mdash;
		<ol>
			<li><strong>Support early design</strong>: A design description language 
				should offer means for modelling 
				unimplemented programs without prematurely committing to implementation 
				minutia.
			</li>
			<li><strong>Support genericity</strong>: A design description 
				language should distinguish between modelling a design pattern (a design motif) 
				from modelling a specific implementation thereof. Unlike UML, LePUS3/Class-Z specifications distinguish between 
				modelling design motifs (such as design patterns) and specific programs. 
				Distinction is made using the standard mathematical distinction between
				<a href="http://www.lepus.org.uk/ref/refman/refman.xml#Terms">variables and 
				constants</a>.
			</li>
		</ol>
	</li>
	<li><strong>Minimality</strong>. A Design Description Language should 
		restrict itself to a minimal number of symbols. It need not attempt to model 
		&quot;everything&quot; and avoid the Symbol Safari Syndrome.
	<ul>
		The visual <a href="ref/legend/legend.xml">vocabulary</a> of LePUS3 consists only of 15 visual tokens.</ul>
	</li>
	<li><strong>Object-orientation</strong>: A Design Description Language 
	should offer expressive abstraction mechanisms that can 
	capture and convey the design of programs and design motifs.<ul>
		<li>&nbsp;LePUS3/Class-Z specifications can 
	capture and convey object-oriented design decisions in a wide range, 
	including:
		<ol>
			<li>Generic design motifs, such as the 
			<a href="ref/companion/">'Gang of Four' design patterns</a></li>
			<li>Concrete programs, including open-source and widely-used 
			large-scale software at varying levels of abstraction in a range of 
			object-oriented programming languages, such as Java Foundation 
			Classes (<a href="http://www.lepus.org.uk/ref/companion/Composite.xml#Sample_Implementations">java.awt</a>,
			<a href="http://ttp.essex.ac.uk/index.php?page=logging">
			java.io.logging</a>,
			<a href="http://www.lepus.org.uk/spec/closed/java.util/coll-iters.xml">
			java.util</a>),
			<a href="http://www.lepus.org.uk/spec/closed/JDOM/jdom.xml">JDom</a>,
			<a href="http://ttp.essex.ac.uk/index.php?page=junit">&nbsp;JUnit</a>,
			<a href="http://ttp.essex.ac.uk/index.php?page=jgraph">&nbsp;JGraph</a>, Microsoft Foundation 
			Classes (MFC), and Smalltalk-80.</li>
			<li>Application frameworks, such as Enterprise JavaBeans and Java 
			Servlets </li>
		</ol>
		</li>
	</ul>
	</li>
</ul>



<h1>Examples</h1>
<p><a href="spec/">All examples</a></p>
<ul>
	<li><a href="spec/hybrid/ejb/">Enterprise JavaBeans</a></li>
	<li><a href="ref/companion/AbstractFactory.xml">Abstract Factory pattern</a></li>
	<li><a href="ref/companion/Composite.xml">Composite pattern and its 
	implementation in java.awt</a></li>
	<li><a href="http://ttp.essex.ac.uk/index.php?page=closeable">The <code>Closable</code> inheritance hierarchy in 
		<code>java.io</code></a></li>
	<li><a href="http://ttp.essex.ac.uk/index.php?page=logging">Package 
		<code>java.util.logging</code></a></li>
	<li><a href="spec/closed/JDOM/jdom.xml">JDom</a></li>
	<li><a href="http://ttp.essex.ac.uk/index.php?page=junit">JUnit</a></li>
</ul>
<div class="abstract">

<h1>Further reading</h1>

	<ul>
		<li><a href="ref/lepus3-tutorial.pdf"><strong>Tutorial</strong>: Object-Oriented Modelling with LePUS3 and Class-Z</a> [<a href="ref/lepus3-tutorial.pdf">.pdf</a>][<a href="ref/lepus3-tutorial.pptx">.pptx</a>]</li>
		<li><a href="ref/refman/refman.xml"><strong>Reference Manual</strong> for LePUS3 &amp; Class-Z</a></li>
	</ul>
</div> 


</body>
</html>