Index: doc/theses/andrew_beach_MMath/code/cond-catch.cfa
===================================================================
--- doc/theses/andrew_beach_MMath/code/cond-catch.cfa	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ doc/theses/andrew_beach_MMath/code/cond-catch.cfa	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -19,5 +19,5 @@
 		throw_exception();
 	} catch (empty_exception * exc ; should_catch) {
-		// ...
+		asm volatile ("# catch block (conditional)");
 	}
 }
@@ -37,5 +37,5 @@
 			cond_catch();
 		} catch (empty_exception * exc) {
-			// ...
+			asm volatile ("# catch block (unconditional)");
 		}
 	}
Index: doc/theses/andrew_beach_MMath/code/cond-catch.cpp
===================================================================
--- doc/theses/andrew_beach_MMath/code/cond-catch.cpp	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ doc/theses/andrew_beach_MMath/code/cond-catch.cpp	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -22,4 +22,5 @@
 			throw;
 		}
+		asm volatile ("# catch block (conditional)");
 	}
 }
@@ -39,5 +40,5 @@
 			cond_catch();
 		} catch (EmptyException &) {
-			// ...
+			asm volatile ("# catch block (unconditional)");
 		}
     }
Index: doc/theses/andrew_beach_MMath/code/cond-fixup.cfa
===================================================================
--- doc/theses/andrew_beach_MMath/code/cond-fixup.cfa	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ doc/theses/andrew_beach_MMath/code/cond-fixup.cfa	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -19,5 +19,5 @@
 		throw_exception();
 	} catchResume (empty_exception * exc ; should_catch) {
-		// ...
+		asm volatile ("# fixup block (conditional)");
 	}
 }
@@ -37,5 +37,5 @@
 			cond_catch();
 		} catchResume (empty_exception * exc) {
-			// ...
+			asm volatile ("# fixup block (unconditional)");
 		}
 	}
Index: doc/theses/andrew_beach_MMath/code/cross-catch.cfa
===================================================================
--- doc/theses/andrew_beach_MMath/code/cross-catch.cfa	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ doc/theses/andrew_beach_MMath/code/cross-catch.cfa	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -7,12 +7,11 @@
 EHM_EXCEPTION(not_raised_exception)();
 
+EHM_VIRTUAL_TABLE(not_raised_exception, not_vt);
+
 int main(int argc, char * argv[]) {
 	unsigned int times = 1;
-	unsigned int total_frames = 1;
+	bool should_throw = false;
 	if (1 < argc) {
 		times = strtol(argv[1], 0p, 10);
-	}
-	if (2 < argc) {
-		total_frames = strtol(argv[2], 0p, 10);
 	}
 
@@ -20,7 +19,10 @@
 	for (unsigned int count = 0 ; count < times ; ++count) {
 		try {
-			// ...
+			asm volatile ("# try block" : "=rm" (should_throw));
+			if (should_throw) {
+				throw (not_raised_exception){&not_vt};
+			}
 		} catch (not_raised_exception *) {
-			// ...
+			asm volatile ("# catch block");
 		}
 	}
Index: doc/theses/andrew_beach_MMath/code/cross-catch.cpp
===================================================================
--- doc/theses/andrew_beach_MMath/code/cross-catch.cpp	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ doc/theses/andrew_beach_MMath/code/cross-catch.cpp	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -11,4 +11,5 @@
 int main(int argc, char * argv[]) {
 	unsigned int times = 1;
+	bool should_throw = false;
 	if (1 < argc) {
 		times = strtol(argv[1], nullptr, 10);
@@ -18,7 +19,10 @@
 	for (unsigned int count = 0 ; count < times ; ++count) {
 		try {
-			// ...
+			asm volatile ("# try block" : "=rm" (should_throw));
+			if (should_throw) {
+				throw NotRaisedException();
+			}
 		} catch (NotRaisedException &) {
-			// ...
+			asm volatile ("# catch block");
 		}
 	}
Index: doc/theses/andrew_beach_MMath/code/cross-finally.cfa
===================================================================
--- doc/theses/andrew_beach_MMath/code/cross-finally.cfa	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ doc/theses/andrew_beach_MMath/code/cross-finally.cfa	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -5,20 +5,24 @@
 #include <stdlib.hfa>
 
+EHM_EXCEPTION(not_raised_exception)();
+
+EHM_VIRTUAL_TABLE(not_raised_exception, not_vt);
+
 int main(int argc, char * argv[]) {
 	unsigned int times = 1;
-	unsigned int total_frames = 1;
+	bool should_throw = false;
 	if (1 < argc) {
 		times = strtol(argv[1], 0p, 10);
-	}
-	if (2 < argc) {
-		total_frames = strtol(argv[2], 0p, 10);
 	}
 
 	Time start_time = timeHiRes();
 	for (unsigned int count = 0 ; count < times ; ++count) {
-		 try {
-			// ...
+		try {
+			asm volatile ("# try block" : "=rm" (should_throw));
+			if (should_throw) {
+				throw (not_raised_exception){&not_vt};
+			}
 		} finally {
-			// ...
+			asm volatile ("# finally block");
 		}
 	}
Index: doc/theses/andrew_beach_MMath/code/cross-resume.cfa
===================================================================
--- doc/theses/andrew_beach_MMath/code/cross-resume.cfa	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ doc/theses/andrew_beach_MMath/code/cross-resume.cfa	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -20,7 +20,7 @@
 	for (unsigned int count = 0 ; count < times ; ++count) {
 		try {
-			// ...
+			asm volatile ("");
 		} catchResume (not_raised_exception *) {
-			// ...
+			asm volatile ("");
 		}
 	}
Index: doc/theses/andrew_beach_MMath/code/resume-detor.cfa
===================================================================
--- doc/theses/andrew_beach_MMath/code/resume-detor.cfa	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ doc/theses/andrew_beach_MMath/code/resume-detor.cfa	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -12,15 +12,15 @@
 
 void ^?{}(WithDestructor & this) {
-    // ...
+	asm volatile ("# destructor body");
 }
 
 void unwind_destructor(unsigned int frames) {
-    if (frames) {
+	if (frames) {
 
-        WithDestructor object;
-        unwind_destructor(frames - 1);
-    } else {
-        throwResume (empty_exception){&empty_vt};
-    }
+		WithDestructor object;
+		unwind_destructor(frames - 1);
+	} else {
+		throwResume (empty_exception){&empty_vt};
+	}
 }
 
@@ -36,11 +36,11 @@
 
 	Time start_time = timeHiRes();
-    for (int count = 0 ; count < times ; ++count) {
-        try {
-            unwind_destructor(total_frames);
-        } catchResume (empty_exception *) {
-            // ...
-        }
-    }
+	for (int count = 0 ; count < times ; ++count) {
+		try {
+			unwind_destructor(total_frames);
+		} catchResume (empty_exception *) {
+			asm volatile ("# fixup block");
+		}
+	}
 	Time end_time = timeHiRes();
 	sout | "Run-Time (ns): " | (end_time - start_time)`ns;
Index: doc/theses/andrew_beach_MMath/code/resume-empty.cfa
===================================================================
--- doc/theses/andrew_beach_MMath/code/resume-empty.cfa	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ doc/theses/andrew_beach_MMath/code/resume-empty.cfa	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -32,5 +32,5 @@
 			unwind_empty(total_frames);
 		} catchResume (empty_exception *) {
-			// ...
+			asm volatile ("# fixup block");
 		}
 	}
Index: doc/theses/andrew_beach_MMath/code/resume-finally.cfa
===================================================================
--- doc/theses/andrew_beach_MMath/code/resume-finally.cfa	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ doc/theses/andrew_beach_MMath/code/resume-finally.cfa	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -14,5 +14,5 @@
 			unwind_finally(frames - 1);
 		} finally {
-			// ...
+			asm volatile ("# finally block");
 		}
 	} else {
@@ -36,5 +36,5 @@
 			unwind_finally(total_frames);
 		} catchResume (empty_exception *) {
-			// ...
+			asm volatile ("# fixup block");
 		}
 	}
Index: doc/theses/andrew_beach_MMath/code/resume-other.cfa
===================================================================
--- doc/theses/andrew_beach_MMath/code/resume-other.cfa	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ doc/theses/andrew_beach_MMath/code/resume-other.cfa	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -16,5 +16,5 @@
 			unwind_other(frames - 1);
 		} catchResume (not_raised_exception *) {
-			// ...
+			asm volatile ("# fixup block (stack)");
 		}
 	} else {
@@ -38,5 +38,5 @@
 			unwind_other(total_frames);
 		} catchResume (empty_exception *) {
-			// ...
+			asm volatile ("# fixup block (base)");
 		}
 	}
Index: doc/theses/andrew_beach_MMath/code/throw-detor.cfa
===================================================================
--- doc/theses/andrew_beach_MMath/code/throw-detor.cfa	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ doc/theses/andrew_beach_MMath/code/throw-detor.cfa	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -12,5 +12,5 @@
 
 void ^?{}(WithDestructor & this) {
-	// ...
+	asm volatile ("# destructor body");
 }
 
@@ -39,5 +39,5 @@
 			unwind_destructor(total_frames);
 		} catch (empty_exception *) {
-			// ...
+			asm volatile ("# catch block");
 		}
 	}
Index: doc/theses/andrew_beach_MMath/code/throw-detor.cpp
===================================================================
--- doc/theses/andrew_beach_MMath/code/throw-detor.cpp	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ doc/theses/andrew_beach_MMath/code/throw-detor.cpp	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -10,5 +10,7 @@
 
 struct WithDestructor {
-	~WithDestructor() {}
+	~WithDestructor() {
+		asm volatile ("# destructor body");
+	}
 };
 
@@ -37,5 +39,5 @@
 			unwind_destructor(total_frames);
 		} catch (EmptyException &) {
-			// ...
+			asm volatile ("# catch block");
 		}
 	}
Index: doc/theses/andrew_beach_MMath/code/throw-empty.cfa
===================================================================
--- doc/theses/andrew_beach_MMath/code/throw-empty.cfa	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ doc/theses/andrew_beach_MMath/code/throw-empty.cfa	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -32,5 +32,5 @@
 			unwind_empty(total_frames);
 		} catch (empty_exception *) {
-			// ...
+			asm volatile ("# catch block");
 		}
 	}
Index: doc/theses/andrew_beach_MMath/code/throw-empty.cpp
===================================================================
--- doc/theses/andrew_beach_MMath/code/throw-empty.cpp	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ doc/theses/andrew_beach_MMath/code/throw-empty.cpp	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -32,5 +32,5 @@
 			unwind_empty(total_frames);
 		} catch (EmptyException &) {
-			// ...
+			asm volatile ("# catch block");
 		}
 	}
Index: doc/theses/andrew_beach_MMath/code/throw-finally.cfa
===================================================================
--- doc/theses/andrew_beach_MMath/code/throw-finally.cfa	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ doc/theses/andrew_beach_MMath/code/throw-finally.cfa	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -14,5 +14,5 @@
 			unwind_finally(frames - 1);
 		} finally {
-			// ...
+			asm volatile ("# finally block");
 		}
 	} else {
@@ -36,5 +36,5 @@
 			unwind_finally(total_frames);
 		} catch (empty_exception *) {
-			// ...
+			asm volatile ("# catch block");
 		}
 	}
Index: doc/theses/andrew_beach_MMath/code/throw-other.cfa
===================================================================
--- doc/theses/andrew_beach_MMath/code/throw-other.cfa	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ doc/theses/andrew_beach_MMath/code/throw-other.cfa	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -16,5 +16,5 @@
 			unwind_other(frames - 1);
 		} catch (not_raised_exception *) {
-			// ...
+			asm volatile ("# catch block (stack)");
 		}
 	} else {
@@ -38,5 +38,5 @@
 			unwind_other(total_frames);
 		} catch (empty_exception *) {
-			// ...
+			asm volatile ("# catch block (base)");
 		}
 	}
Index: doc/theses/andrew_beach_MMath/code/throw-other.cpp
===================================================================
--- doc/theses/andrew_beach_MMath/code/throw-other.cpp	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ doc/theses/andrew_beach_MMath/code/throw-other.cpp	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -16,5 +16,5 @@
 			unwind_other(frames - 1);
 		} catch (NotRaisedException &) {
-			// ...
+			asm volatile ("# catch block (stack)");
 		}
 	} else {
@@ -38,5 +38,5 @@
 			unwind_other(total_frames);
 		} catch (EmptyException &) {
-			// ...
+			asm volatile ("# catch block (base)");
 		}
 	}
Index: libcfa/prelude/builtins.c
===================================================================
--- libcfa/prelude/builtins.c	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ libcfa/prelude/builtins.c	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -10,6 +10,6 @@
 // Created On       : Fri Jul 21 16:21:03 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Apr 13 17:26:32 2021
-// Update Count     : 117
+// Last Modified On : Tue Jul 20 17:31:40 2021
+// Update Count     : 128
 //
 
@@ -78,18 +78,18 @@
 
 static inline {
-	forall( DT & | { DT & ?+=?( DT &, one_t ); } )
-	DT & ++?( DT & x ) { return x += 1; }
+	forall( T | { T ?+=?( T &, one_t ); } )
+	T ++?( T & x ) { return x += 1; }
 
-	forall( DT & | sized(DT) | { void ?{}( DT &, DT ); void ^?{}( DT & ); DT & ?+=?( DT &, one_t ); } )
-	DT & ?++( DT & x ) { DT tmp = x; x += 1; return tmp; }
+	forall( T | { T ?+=?( T &, one_t ); } )
+	T ?++( T & x ) { T tmp = x; x += 1; return tmp; }
 
-	forall( DT & | { DT & ?-=?( DT &, one_t ); } )
-	DT & --?( DT & x ) { return x -= 1; }
+	forall( T | { T ?-=?( T &, one_t ); } )
+	T --?( T & x ) { return x -= 1; }
 
-	forall( DT & | sized(DT) | { void ?{}( DT &, DT ); void ^?{}( DT & ); DT & ?-=?( DT &, one_t ); } )
-	DT & ?--( DT & x ) { DT tmp = x; x -= 1; return tmp; }
+	forall( T | { T ?-=?( T &, one_t ); } )
+	T ?--( T & x ) { T tmp = x; x -= 1; return tmp; }
 
-	forall( DT & | { int ?!=?( const DT &, zero_t ); } )
-	int !?( const DT & x ) { return !( x != 0 ); }
+	forall( T | { int ?!=?( T, zero_t ); } )
+	int !?( T & x ) { return !( x != 0 ); }
 } // distribution
 
Index: libcfa/src/Makefile.am
===================================================================
--- libcfa/src/Makefile.am	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ libcfa/src/Makefile.am	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -11,6 +11,6 @@
 ## Created On       : Sun May 31 08:54:01 2015
 ## Last Modified By : Peter A. Buhr
-## Last Modified On : Sat Apr 24 09:09:56 2021
-## Update Count     : 254
+## Last Modified On : Fri Jul 16 16:00:40 2021
+## Update Count     : 255
 ###############################################################################
 
@@ -45,4 +45,5 @@
 	exception.h \
 	gmp.hfa \
+	math.trait.hfa \
 	math.hfa \
 	time_t.hfa \
Index: libcfa/src/math.trait.hfa
===================================================================
--- libcfa/src/math.trait.hfa	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
+++ libcfa/src/math.trait.hfa	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -0,0 +1,69 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// math.trait.hfa -- 
+//
+// Author           : Peter A. Buhr
+// Created On       : Fri Jul 16 15:40:52 2021
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Tue Jul 20 17:47:19 2021
+// Update Count     : 19
+// 
+
+#pragma once
+
+trait Not( T ) {
+	void ?{}( T &, zero_t );
+	int !?( T );
+}; // Not
+
+trait Equality( T | Not( T ) ) {
+	int ?==?( T, T );
+	int ?!=?( T, T );
+}; // Equality
+
+trait Relational( T | Equality( T ) ) {
+	int ?<?( T, T );
+	int ?<=?( T, T );
+	int ?>?( T, T );
+	int ?>=?( T, T );
+}; // Relational
+
+trait Signed( T ) {
+	T +?( T );
+	T -?( T );
+	T abs( T );
+}; // Signed
+
+trait Additive( T | Signed( T ) ) {
+	T ?+?( T, T );
+	T ?-?( T, T );
+	T ?+=?( T &, T );
+	T ?-=?( T &, T );
+}; // Additive
+
+trait Incdec( T | Additive( T ) ) {
+	void ?{}( T &, one_t );
+	// T ?++( T & );
+	// T ++?( T &);
+	// T ?--( T & );
+	// T --?( T & );
+}; // Incdec
+
+trait Multiplicative( T | Incdec( T ) ) {
+	T ?*?( T, T );
+	T ?/?( T, T );
+	T ?%?( T, T );
+	T ?/=?( T &, T );
+}; // Multiplicative
+
+trait Arithmetic( T | Relational( T ) | Multiplicative( T ) ) {
+}; // Arithmetic
+
+// Local Variables: //
+// mode: c //
+// tab-width: 4 //
+// End: //
Index: libcfa/src/rational.cfa
===================================================================
--- libcfa/src/rational.cfa	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ libcfa/src/rational.cfa	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -10,6 +10,6 @@
 // Created On       : Wed Apr  6 17:54:28 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Feb  8 17:56:36 2020
-// Update Count     : 187
+// Last Modified On : Tue Jul 20 16:30:06 2021
+// Update Count     : 193
 //
 
@@ -18,13 +18,13 @@
 #include "stdlib.hfa"
 
-forall( RationalImpl | arithmetic( RationalImpl ) ) {
+forall( T | Arithmetic( T ) ) {
 	// helper routines
 
 	// Calculate greatest common denominator of two numbers, the first of which may be negative. Used to reduce
 	// rationals.  alternative: https://en.wikipedia.org/wiki/Binary_GCD_algorithm
-	static RationalImpl gcd( RationalImpl a, RationalImpl b ) {
+	static T gcd( T a, T b ) {
 		for ( ;; ) {									// Euclid's algorithm
-			RationalImpl r = a % b;
-		  if ( r == (RationalImpl){0} ) break;
+			T r = a % b;
+		  if ( r == (T){0} ) break;
 			a = b;
 			b = r;
@@ -33,9 +33,9 @@
 	} // gcd
 
-	static RationalImpl simplify( RationalImpl & n, RationalImpl & d ) {
-		if ( d == (RationalImpl){0} ) {
+	static T simplify( T & n, T & d ) {
+		if ( d == (T){0} ) {
 			abort | "Invalid rational number construction: denominator cannot be equal to 0.";
 		} // exit
-		if ( d < (RationalImpl){0} ) { d = -d; n = -n; } // move sign to numerator
+		if ( d < (T){0} ) { d = -d; n = -n; } // move sign to numerator
 		return gcd( abs( n ), d );						// simplify
 	} // Rationalnumber::simplify
@@ -43,36 +43,36 @@
 	// constructors
 
-	void ?{}( Rational(RationalImpl) & r ) {
-		r{ (RationalImpl){0}, (RationalImpl){1} };
-	} // rational
-
-	void ?{}( Rational(RationalImpl) & r, RationalImpl n ) {
-		r{ n, (RationalImpl){1} };
-	} // rational
-
-	void ?{}( Rational(RationalImpl) & r, RationalImpl n, RationalImpl d ) {
-		RationalImpl t = simplify( n, d );				// simplify
+	void ?{}( Rational(T) & r, zero_t ) {
+		r{ (T){0}, (T){1} };
+	} // rational
+
+	void ?{}( Rational(T) & r, one_t ) {
+		r{ (T){1}, (T){1} };
+	} // rational
+
+	void ?{}( Rational(T) & r ) {
+		r{ (T){0}, (T){1} };
+	} // rational
+
+	void ?{}( Rational(T) & r, T n ) {
+		r{ n, (T){1} };
+	} // rational
+
+	void ?{}( Rational(T) & r, T n, T d ) {
+		T t = simplify( n, d );				// simplify
 		r.[numerator, denominator] = [n / t, d / t];
 	} // rational
 
-	void ?{}( Rational(RationalImpl) & r, zero_t ) {
-		r{ (RationalImpl){0}, (RationalImpl){1} };
-	} // rational
-
-	void ?{}( Rational(RationalImpl) & r, one_t ) {
-		r{ (RationalImpl){1}, (RationalImpl){1} };
-	} // rational
-
 	// getter for numerator/denominator
 
-	RationalImpl numerator( Rational(RationalImpl) r ) {
+	T numerator( Rational(T) r ) {
 		return r.numerator;
 	} // numerator
 
-	RationalImpl denominator( Rational(RationalImpl) r ) {
+	T denominator( Rational(T) r ) {
 		return r.denominator;
 	} // denominator
 
-	[ RationalImpl, RationalImpl ] ?=?( & [ RationalImpl, RationalImpl ] dest, Rational(RationalImpl) src ) {
+	[ T, T ] ?=?( & [ T, T ] dest, Rational(T) src ) {
 		return dest = src.[ numerator, denominator ];
 	} // ?=?
@@ -80,14 +80,14 @@
 	// setter for numerator/denominator
 
-	RationalImpl numerator( Rational(RationalImpl) r, RationalImpl n ) {
-		RationalImpl prev = r.numerator;
-		RationalImpl t = gcd( abs( n ), r.denominator ); // simplify
+	T numerator( Rational(T) r, T n ) {
+		T prev = r.numerator;
+		T t = gcd( abs( n ), r.denominator ); // simplify
 		r.[numerator, denominator] = [n / t, r.denominator / t];
 		return prev;
 	} // numerator
 
-	RationalImpl denominator( Rational(RationalImpl) r, RationalImpl d ) {
-		RationalImpl prev = r.denominator;
-		RationalImpl t = simplify( r.numerator, d );	// simplify
+	T denominator( Rational(T) r, T d ) {
+		T prev = r.denominator;
+		T t = simplify( r.numerator, d );	// simplify
 		r.[numerator, denominator] = [r.numerator / t, d / t];
 		return prev;
@@ -96,25 +96,29 @@
 	// comparison
 
-	int ?==?( Rational(RationalImpl) l, Rational(RationalImpl) r ) {
+	int ?==?( Rational(T) l, Rational(T) r ) {
 		return l.numerator * r.denominator == l.denominator * r.numerator;
 	} // ?==?
 
-	int ?!=?( Rational(RationalImpl) l, Rational(RationalImpl) r ) {
+	int ?!=?( Rational(T) l, Rational(T) r ) {
 		return ! ( l == r );
 	} // ?!=?
 
-	int ?<?( Rational(RationalImpl) l, Rational(RationalImpl) r ) {
+	int ?!=?( Rational(T) l, zero_t ) {
+		return ! ( l == (Rational(T)){ 0 } );
+	} // ?!=?
+
+	int ?<?( Rational(T) l, Rational(T) r ) {
 		return l.numerator * r.denominator < l.denominator * r.numerator;
 	} // ?<?
 
-	int ?<=?( Rational(RationalImpl) l, Rational(RationalImpl) r ) {
+	int ?<=?( Rational(T) l, Rational(T) r ) {
 		return l.numerator * r.denominator <= l.denominator * r.numerator;
 	} // ?<=?
 
-	int ?>?( Rational(RationalImpl) l, Rational(RationalImpl) r ) {
+	int ?>?( Rational(T) l, Rational(T) r ) {
 		return ! ( l <= r );
 	} // ?>?
 
-	int ?>=?( Rational(RationalImpl) l, Rational(RationalImpl) r ) {
+	int ?>=?( Rational(T) l, Rational(T) r ) {
 		return ! ( l < r );
 	} // ?>=?
@@ -122,45 +126,73 @@
 	// arithmetic
 
-	Rational(RationalImpl) +?( Rational(RationalImpl) r ) {
-		return (Rational(RationalImpl)){ r.numerator, r.denominator };
+	Rational(T) +?( Rational(T) r ) {
+		return (Rational(T)){ r.numerator, r.denominator };
 	} // +?
 
-	Rational(RationalImpl) -?( Rational(RationalImpl) r ) {
-		return (Rational(RationalImpl)){ -r.numerator, r.denominator };
+	Rational(T) -?( Rational(T) r ) {
+		return (Rational(T)){ -r.numerator, r.denominator };
 	} // -?
 
-	Rational(RationalImpl) ?+?( Rational(RationalImpl) l, Rational(RationalImpl) r ) {
+	Rational(T) ?+?( Rational(T) l, Rational(T) r ) {
 		if ( l.denominator == r.denominator ) {			// special case
-			return (Rational(RationalImpl)){ l.numerator + r.numerator, l.denominator };
+			return (Rational(T)){ l.numerator + r.numerator, l.denominator };
 		} else {
-			return (Rational(RationalImpl)){ l.numerator * r.denominator + l.denominator * r.numerator, l.denominator * r.denominator };
+			return (Rational(T)){ l.numerator * r.denominator + l.denominator * r.numerator, l.denominator * r.denominator };
 		} // if
 	} // ?+?
 
-	Rational(RationalImpl) ?-?( Rational(RationalImpl) l, Rational(RationalImpl) r ) {
+	Rational(T) ?+=?( Rational(T) & l, Rational(T) r ) {
+		l = l + r;
+		return l;
+	} // ?+?
+
+	Rational(T) ?+=?( Rational(T) & l, one_t ) {
+		l = l + (Rational(T)){ 1 };
+		return l;
+	} // ?+?
+
+	Rational(T) ?-?( Rational(T) l, Rational(T) r ) {
 		if ( l.denominator == r.denominator ) {			// special case
-			return (Rational(RationalImpl)){ l.numerator - r.numerator, l.denominator };
+			return (Rational(T)){ l.numerator - r.numerator, l.denominator };
 		} else {
-			return (Rational(RationalImpl)){ l.numerator * r.denominator - l.denominator * r.numerator, l.denominator * r.denominator };
+			return (Rational(T)){ l.numerator * r.denominator - l.denominator * r.numerator, l.denominator * r.denominator };
 		} // if
 	} // ?-?
 
-	Rational(RationalImpl) ?*?( Rational(RationalImpl) l, Rational(RationalImpl) r ) {
-		return (Rational(RationalImpl)){ l.numerator * r.numerator, l.denominator * r.denominator };
+	Rational(T) ?-=?( Rational(T) & l, Rational(T) r ) {
+		l = l - r;
+		return l;
+	} // ?-?
+
+	Rational(T) ?-=?( Rational(T) & l, one_t ) {
+		l = l - (Rational(T)){ 1 };
+		return l;
+	} // ?-?
+
+	Rational(T) ?*?( Rational(T) l, Rational(T) r ) {
+		return (Rational(T)){ l.numerator * r.numerator, l.denominator * r.denominator };
 	} // ?*?
 
-	Rational(RationalImpl) ?/?( Rational(RationalImpl) l, Rational(RationalImpl) r ) {
-		if ( r.numerator < (RationalImpl){0} ) {
+	Rational(T) ?*=?( Rational(T) & l, Rational(T) r ) {
+		return l = l * r;
+	} // ?*?
+
+	Rational(T) ?/?( Rational(T) l, Rational(T) r ) {
+		if ( r.numerator < (T){0} ) {
 			r.[numerator, denominator] = [-r.numerator, -r.denominator];
 		} // if
-		return (Rational(RationalImpl)){ l.numerator * r.denominator, l.denominator * r.numerator };
+		return (Rational(T)){ l.numerator * r.denominator, l.denominator * r.numerator };
 	} // ?/?
 
+	Rational(T) ?/=?( Rational(T) & l, Rational(T) r ) {
+		return l = l / r;
+	} // ?/?
+
 	// I/O
 
-	forall( istype & | istream( istype ) | { istype & ?|?( istype &, RationalImpl & ); } )
-	istype & ?|?( istype & is, Rational(RationalImpl) & r ) {
+	forall( istype & | istream( istype ) | { istype & ?|?( istype &, T & ); } )
+	istype & ?|?( istype & is, Rational(T) & r ) {
 		is | r.numerator | r.denominator;
-		RationalImpl t = simplify( r.numerator, r.denominator );
+		T t = simplify( r.numerator, r.denominator );
 		r.numerator /= t;
 		r.denominator /= t;
@@ -168,10 +200,10 @@
 	} // ?|?
 
-	forall( ostype & | ostream( ostype ) | { ostype & ?|?( ostype &, RationalImpl ); } ) {
-		ostype & ?|?( ostype & os, Rational(RationalImpl) r ) {
+	forall( ostype & | ostream( ostype ) | { ostype & ?|?( ostype &, T ); } ) {
+		ostype & ?|?( ostype & os, Rational(T) r ) {
 			return os | r.numerator | '/' | r.denominator;
 		} // ?|?
 
-		void ?|?( ostype & os, Rational(RationalImpl) r ) {
+		void ?|?( ostype & os, Rational(T) r ) {
 			(ostype &)(os | r); ends( os );
 		} // ?|?
@@ -179,30 +211,35 @@
 } // distribution
 
-forall( RationalImpl | arithmetic( RationalImpl ) | { RationalImpl ?\?( RationalImpl, unsigned long ); } )
-Rational(RationalImpl) ?\?( Rational(RationalImpl) x, long int y ) {
-	if ( y < 0 ) {
-		return (Rational(RationalImpl)){ x.denominator \ -y, x.numerator \ -y };
-	} else {
-		return (Rational(RationalImpl)){ x.numerator \ y, x.denominator \ y };
-	} // if
-}
+forall( T | Arithmetic( T ) | { T ?\?( T, unsigned long ); } ) {
+	Rational(T) ?\?( Rational(T) x, long int y ) {
+		if ( y < 0 ) {
+			return (Rational(T)){ x.denominator \ -y, x.numerator \ -y };
+		} else {
+			return (Rational(T)){ x.numerator \ y, x.denominator \ y };
+		} // if
+	} // ?\?
+
+	Rational(T) ?\=?( Rational(T) & x, long int y ) {
+		return x = x \ y;
+	} // ?\?
+} // distribution
 
 // conversion
 
-forall( RationalImpl | arithmetic( RationalImpl ) | { double convert( RationalImpl ); } )
-double widen( Rational(RationalImpl) r ) {
+forall( T | Arithmetic( T ) | { double convert( T ); } )
+double widen( Rational(T) r ) {
  	return convert( r.numerator ) / convert( r.denominator );
 } // widen
 
-forall( RationalImpl | arithmetic( RationalImpl ) | { double convert( RationalImpl ); RationalImpl convert( double ); } )
-Rational(RationalImpl) narrow( double f, RationalImpl md ) {
+forall( T | Arithmetic( T ) | { double convert( T ); T convert( double ); } )
+Rational(T) narrow( double f, T md ) {
 	// http://www.ics.uci.edu/~eppstein/numth/frap.c
-	if ( md <= (RationalImpl){1} ) {					// maximum fractional digits too small?
-		return (Rational(RationalImpl)){ convert( f ), (RationalImpl){1}}; // truncate fraction
+	if ( md <= (T){1} ) {					// maximum fractional digits too small?
+		return (Rational(T)){ convert( f ), (T){1}}; // truncate fraction
 	} // if
 
 	// continued fraction coefficients
-	RationalImpl m00 = {1}, m11 = { 1 }, m01 = { 0 }, m10 = { 0 };
-	RationalImpl ai, t;
+	T m00 = {1}, m11 = { 1 }, m01 = { 0 }, m10 = { 0 };
+	T ai, t;
 
 	// find terms until denom gets too big
@@ -221,5 +258,5 @@
 	  if ( f > (double)0x7FFFFFFF ) break;				// representation failure
 	} // for
-	return (Rational(RationalImpl)){ m00, m10 };
+	return (Rational(T)){ m00, m10 };
 } // narrow
 
Index: libcfa/src/rational.hfa
===================================================================
--- libcfa/src/rational.hfa	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ libcfa/src/rational.hfa	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -12,6 +12,6 @@
 // Created On       : Wed Apr  6 17:56:25 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Mar 26 23:16:10 2019
-// Update Count     : 109
+// Last Modified On : Tue Jul 20 17:45:29 2021
+// Update Count     : 118
 //
 
@@ -19,91 +19,77 @@
 
 #include "iostream.hfa"
-
-trait scalar( T ) {
-};
-
-trait arithmetic( T | scalar( T ) ) {
-	int !?( T );
-	int ?==?( T, T );
-	int ?!=?( T, T );
-	int ?<?( T, T );
-	int ?<=?( T, T );
-	int ?>?( T, T );
-	int ?>=?( T, T );
-	void ?{}( T &, zero_t );
-	void ?{}( T &, one_t );
-	T +?( T );
-	T -?( T );
-	T ?+?( T, T );
-	T ?-?( T, T );
-	T ?*?( T, T );
-	T ?/?( T, T );
-	T ?%?( T, T );
-	T ?/=?( T &, T );
-	T abs( T );
-};
+#include "math.trait.hfa"								// Arithmetic
 
 // implementation
 
-forall( RationalImpl | arithmetic( RationalImpl ) ) {
+forall( T | Arithmetic( T ) ) {
 	struct Rational {
-		RationalImpl numerator, denominator;			// invariant: denominator > 0
+		T numerator, denominator;						// invariant: denominator > 0
 	}; // Rational
 
 	// constructors
 
-	void ?{}( Rational(RationalImpl) & r );
-	void ?{}( Rational(RationalImpl) & r, RationalImpl n );
-	void ?{}( Rational(RationalImpl) & r, RationalImpl n, RationalImpl d );
-	void ?{}( Rational(RationalImpl) & r, zero_t );
-	void ?{}( Rational(RationalImpl) & r, one_t );
+	void ?{}( Rational(T) & r );
+	void ?{}( Rational(T) & r, zero_t );
+	void ?{}( Rational(T) & r, one_t );
+	void ?{}( Rational(T) & r, T n );
+	void ?{}( Rational(T) & r, T n, T d );
 
 	// numerator/denominator getter
 
-	RationalImpl numerator( Rational(RationalImpl) r );
-	RationalImpl denominator( Rational(RationalImpl) r );
-	[ RationalImpl, RationalImpl ] ?=?( & [ RationalImpl, RationalImpl ] dest, Rational(RationalImpl) src );
+	T numerator( Rational(T) r );
+	T denominator( Rational(T) r );
+	[ T, T ] ?=?( & [ T, T ] dest, Rational(T) src );
 
 	// numerator/denominator setter
 
-	RationalImpl numerator( Rational(RationalImpl) r, RationalImpl n );
-	RationalImpl denominator( Rational(RationalImpl) r, RationalImpl d );
+	T numerator( Rational(T) r, T n );
+	T denominator( Rational(T) r, T d );
 
 	// comparison
 
-	int ?==?( Rational(RationalImpl) l, Rational(RationalImpl) r );
-	int ?!=?( Rational(RationalImpl) l, Rational(RationalImpl) r );
-	int ?<?( Rational(RationalImpl) l, Rational(RationalImpl) r );
-	int ?<=?( Rational(RationalImpl) l, Rational(RationalImpl) r );
-	int ?>?( Rational(RationalImpl) l, Rational(RationalImpl) r );
-	int ?>=?( Rational(RationalImpl) l, Rational(RationalImpl) r );
+	int ?==?( Rational(T) l, Rational(T) r );
+	int ?!=?( Rational(T) l, Rational(T) r );
+	int ?!=?( Rational(T) l, zero_t );					// => !
+	int ?<?( Rational(T) l, Rational(T) r );
+	int ?<=?( Rational(T) l, Rational(T) r );
+	int ?>?( Rational(T) l, Rational(T) r );
+	int ?>=?( Rational(T) l, Rational(T) r );
 
 	// arithmetic
 
-	Rational(RationalImpl) +?( Rational(RationalImpl) r );
-	Rational(RationalImpl) -?( Rational(RationalImpl) r );
-	Rational(RationalImpl) ?+?( Rational(RationalImpl) l, Rational(RationalImpl) r );
-	Rational(RationalImpl) ?-?( Rational(RationalImpl) l, Rational(RationalImpl) r );
-	Rational(RationalImpl) ?*?( Rational(RationalImpl) l, Rational(RationalImpl) r );
-	Rational(RationalImpl) ?/?( Rational(RationalImpl) l, Rational(RationalImpl) r );
+	Rational(T) +?( Rational(T) r );
+	Rational(T) -?( Rational(T) r );
+	Rational(T) ?+?( Rational(T) l, Rational(T) r );
+	Rational(T) ?+=?( Rational(T) & l, Rational(T) r );
+	Rational(T) ?+=?( Rational(T) & l, one_t );			// => ++?, ?++
+	Rational(T) ?-?( Rational(T) l, Rational(T) r );
+	Rational(T) ?-=?( Rational(T) & l, Rational(T) r );
+	Rational(T) ?-=?( Rational(T) & l, one_t );			// => --?, ?--
+	Rational(T) ?*?( Rational(T) l, Rational(T) r );
+	Rational(T) ?*=?( Rational(T) & l, Rational(T) r );
+	Rational(T) ?/?( Rational(T) l, Rational(T) r );
+	Rational(T) ?/=?( Rational(T) & l, Rational(T) r );
 
 	// I/O
-	forall( istype & | istream( istype ) | { istype & ?|?( istype &, RationalImpl & ); } )
-	istype & ?|?( istype &, Rational(RationalImpl) & );
+	forall( istype & | istream( istype ) | { istype & ?|?( istype &, T & ); } )
+	istype & ?|?( istype &, Rational(T) & );
 
-	forall( ostype & | ostream( ostype ) | { ostype & ?|?( ostype &, RationalImpl ); } ) {
-		ostype & ?|?( ostype &, Rational(RationalImpl) );
-		void ?|?( ostype &, Rational(RationalImpl) );
+	forall( ostype & | ostream( ostype ) | { ostype & ?|?( ostype &, T ); } ) {
+		ostype & ?|?( ostype &, Rational(T) );
+		void ?|?( ostype &, Rational(T) );
 	} // distribution
 } // distribution
 
-forall( RationalImpl | arithmetic( RationalImpl ) |{RationalImpl ?\?( RationalImpl, unsigned long );} )
-Rational(RationalImpl) ?\?( Rational(RationalImpl) x, long int y );
+forall( T | Arithmetic( T ) | { T ?\?( T, unsigned long ); } ) {
+	Rational(T) ?\?( Rational(T) x, long int y );
+	Rational(T) ?\=?( Rational(T) & x, long int y );
+} // distribution
 
 // conversion
-forall( RationalImpl | arithmetic( RationalImpl ) | { double convert( RationalImpl ); } )
-double widen( Rational(RationalImpl) r );
-forall( RationalImpl | arithmetic( RationalImpl ) | { double convert( RationalImpl );  RationalImpl convert( double );} )
-Rational(RationalImpl) narrow( double f, RationalImpl md );
+forall( T | Arithmetic( T ) | { double convert( T ); } )
+double widen( Rational(T) r );
+forall( T | Arithmetic( T ) | { double convert( T );  T convert( double );} )
+Rational(T) narrow( double f, T md );
 
 // Local Variables: //
Index: tests/.expect/rational.txt
===================================================================
--- tests/.expect/rational.txt	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ tests/.expect/rational.txt	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -1,20 +1,37 @@
 constructor
-3/1 4/1 0/1 0/1 1/1
-1/2 5/7
-2/3 -3/2
--2/3 3/2
-logical
--2/1 -3/2
-1
-1
-1
-0
-0
+a : 3/1 b : 4/1 c : 0/1 d : 0/1 e : 1/1
+a : 1/2 b : 5/7
+a : 2/3 b : -3/2
+a : -2/3 b : 3/2
+
+comparison
+a : -2/1 b : -3/2
+a == 0 : 0
+a == 1 : 0
+a != 0 : 1
+! a : 0
+a != b : 1
+a <  b : 1
+a <=  b : 1
+a >  b : 0
+a >=  b : 0
+
 arithmetic
--2/1 -3/2
--7/2
--1/2
-3/1
-4/3
+a : -2/1 b : -3/2
+a + b : -7/2
+a += b : -7/2
+++a : -5/2
+a++ : -5/2
+a : -3/2
+a - b : 0/1
+a -= b : 0/1
+--a : -1/1
+a-- : -1/1
+a : -2/1
+a * b : 3/1
+a / b : 4/3
+a \ 2 : 4/1 b \ 2 : 9/4
+a \ -2 : 1/4 b \ -2 : 4/9
+
 conversion
 0.75
@@ -24,5 +41,5 @@
 1/7
 355/113
-decompose
+
 more tests
 -3/2
Index: tests/rational.cfa
===================================================================
--- tests/rational.cfa	(revision 3d7d407c86239c5ee651fee5045aca8ced5be3fb)
+++ tests/rational.cfa	(revision 6acd020457c926d3dfdc0cddae757d1e4921ed80)
@@ -10,6 +10,6 @@
 // Created On       : Mon Mar 28 08:43:12 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Feb  8 18:46:23 2020
-// Update Count     : 86
+// Last Modified On : Tue Jul 20 18:13:40 2021
+// Update Count     : 107
 //
 
@@ -26,35 +26,49 @@
 	sout | "constructor";
 	RatInt a = { 3 }, b = { 4 }, c, d = 0, e = 1;
-	sout | a | b | c | d | e;
+	sout | "a : " | a | "b : " | b | "c : " | c | "d : " | d | "e : " | e;
 
 	a = (RatInt){ 4, 8 };
 	b = (RatInt){ 5, 7 };
-	sout | a | b;
+	sout | "a : " | a | "b : " | b;
 	a = (RatInt){ -2, -3 };
 	b = (RatInt){ 3, -2 };
-	sout | a | b;
+	sout | "a : " | a | "b : " | b;
 	a = (RatInt){ -2, 3 };
 	b = (RatInt){ 3, 2 };
-	sout | a | b;
+	sout | "a : " | a | "b : " | b;
+	sout | nl;
 
-	sout | "logical";
+	sout | "comparison";
 	a = (RatInt){ -2 };
 	b = (RatInt){ -3, 2 };
-	sout | a | b;
-//	sout | a == 1; // FIX ME
-	sout | a != b;
-	sout | a <  b;
-	sout | a <= b;
-	sout | a >  b;
-	sout | a >= b;
+	sout | "a : " | a | "b : " | b;
+	sout | "a == 0 : " | a == (Rational(int)){0}; // FIX ME
+	sout | "a == 1 : " | a == (Rational(int)){1}; // FIX ME
+	sout | "a != 0 : " | a != 0;
+	sout | "! a : " | ! a;
+	sout | "a != b : " | a != b;
+	sout | "a <  b : " | a <  b;
+	sout | "a <=  b : " | a <= b;
+	sout | "a >  b : " | a >  b;
+	sout | "a >=  b : " | a >= b;
+	sout | nl;
 
 	sout | "arithmetic";
-	sout | a | b;
-	sout | a + b;
-	sout | a - b;
-	sout | a * b;
-	sout | a / b;
-//	sout | a \ 2 | b \ 2; // FIX ME
-//	sout | a \ -2 | b \ -2;
+	sout | "a : " | a | "b : " | b;
+	sout | "a + b : " | a + b;
+	sout | "a += b : " | (a += b);
+	sout | "++a : " | ++a;
+	sout | "a++ : " | a++;
+	sout | "a : " | a;
+	sout | "a - b : " | a - b;
+	sout | "a -= b : " | (a -= b);
+	sout | "--a : " | --a;
+	sout | "a-- : " | a--;
+	sout | "a : " | a;
+	sout | "a * b : " | a * b;
+	sout | "a / b : " | a / b;
+	sout | "a \\ 2 : " | a \ 2u | "b \\ 2 : " | b \ 2u;
+	sout | "a \\ -2 : " | a \ -2 | "b \\ -2 : " | b \ -2;
+	sout | nl;
 
 	sout | "conversion";
@@ -68,9 +82,10 @@
 	sout | narrow( 0.14285714285714, 16 );
 	sout | narrow( 3.14159265358979, 256 );
+	sout | nl;
 
-	sout | "decompose";
-	int n, d;
-//	[n, d] = a;
-//	sout | a | n | d;
+	// sout | "decompose";
+	// int n, d;
+	// [n, d] = a;
+	// sout | a | n | d;
 
 	sout | "more tests";
