// // 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 Jun 6 07:59:17 2023 // Update Count : 24 // #pragma once forall( U ) trait not { void ?{}( U &, zero_t ); int !?( U ); }; // not forall( T | not( T ) ) trait equality { int ?==?( T, T ); int ?!=?( T, T ); }; // equality forall( U | equality( U ) ) trait relational { int ??( U, U ); int ?>=?( U, U ); }; // relational forall ( T ) trait Signed { // must be capitalized, conflict with keyword signed T +?( T ); T -?( T ); T abs( T ); }; // Signed forall( U | Signed( U ) ) trait additive { U ?+?( U, U ); U ?-?( U, U ); U ?+=?( U &, U ); U ?-=?( U &, U ); }; // additive forall( T | additive( T ) ) trait inc_dec { void ?{}( T &, one_t ); // T ?++( T & ); // T ++?( T & ); // T ?--( T & ); // T --?( T & ); }; // inc_dec forall( U | inc_dec( U ) ) trait multiplicative { U ?*?( U, U ); U ?/?( U, U ); U ?%?( U, U ); U ?/=?( U &, U ); }; // multiplicative forall( T | relational( T ) | multiplicative( T ) ) trait arithmetic { }; // arithmetic // Local Variables: // // mode: c // // tab-width: 4 // // End: //