| [eaa5043] | 1 | // The contents of this file are covered under the licence agreement in the
 | 
|---|
 | 2 | // file "LICENCE" distributed with Cforall.
 | 
|---|
 | 3 | //
 | 
|---|
 | 4 | // pair.c --
 | 
|---|
 | 5 | //
 | 
|---|
 | 6 | // Author           : Aaron Moss
 | 
|---|
 | 7 | // Created On       : Wed Apr 12 15:32:00 2017
 | 
|---|
 | 8 | // Last Modified By : Aaron Moss
 | 
|---|
 | 9 | // Last Modified On : Wed Apr 12 15:32:00 2017
 | 
|---|
 | 10 | // Update Count     : 1
 | 
|---|
 | 11 | //
 | 
|---|
 | 12 | 
 | 
|---|
| [58b6d1b] | 13 | #include <containers/pair.hfa>
 | 
|---|
| [eaa5043] | 14 | 
 | 
|---|
| [fd54fef] | 15 | forall(R, S
 | 
|---|
| [eaa5043] | 16 |         | { int ?==?(R, R); int ?<?(R, R); int ?<?(S, S); })
 | 
|---|
 | 17 | int ?<?(pair(R, S) p, pair(R, S) q) {
 | 
|---|
 | 18 |         return p.first < q.first || ( p.first == q.first && p.second < q.second );
 | 
|---|
 | 19 | }
 | 
|---|
 | 20 | 
 | 
|---|
| [fd54fef] | 21 | forall(R, S
 | 
|---|
| [eaa5043] | 22 |         | { int ?==?(R, R); int ?<?(R, R); int ?<=?(S, S); })
 | 
|---|
 | 23 | int ?<=?(pair(R, S) p, pair(R, S) q) {
 | 
|---|
 | 24 |         return p.first < q.first || ( p.first == q.first && p.second <= q.second );
 | 
|---|
 | 25 | }
 | 
|---|
 | 26 | 
 | 
|---|
| [fd54fef] | 27 | forall(R, S | { int ?==?(R, R); int ?==?(S, S); })
 | 
|---|
| [eaa5043] | 28 | int ?==?(pair(R, S) p, pair(R, S) q) {
 | 
|---|
 | 29 |         return p.first == q.first && p.second == q.second;
 | 
|---|
 | 30 | }
 | 
|---|
 | 31 | 
 | 
|---|
| [fd54fef] | 32 | forall(R, S | { int ?!=?(R, R); int ?!=?(S, S); })
 | 
|---|
| [eaa5043] | 33 | int ?!=?(pair(R, S) p, pair(R, S) q) {
 | 
|---|
 | 34 |         return p.first != q.first || p.second != q.second;
 | 
|---|
 | 35 | }
 | 
|---|
 | 36 | 
 | 
|---|
| [fd54fef] | 37 | forall(R, S
 | 
|---|
| [eaa5043] | 38 |         | { int ?==?(R, R); int ?>?(R, R); int ?>?(S, S); })
 | 
|---|
 | 39 | int ?>?(pair(R, S) p, pair(R, S) q) {
 | 
|---|
 | 40 |         return p.first > q.first || ( p.first == q.first && p.second > q.second );
 | 
|---|
 | 41 | }
 | 
|---|
 | 42 | 
 | 
|---|
| [fd54fef] | 43 | forall(R, S
 | 
|---|
| [eaa5043] | 44 |         | { int ?==?(R, R); int ?>?(R, R); int ?>=?(S, S); })
 | 
|---|
 | 45 | int ?>=?(pair(R, S) p, pair(R, S) q) {
 | 
|---|
 | 46 |         return p.first > q.first || ( p.first == q.first && p.second >= q.second );
 | 
|---|
 | 47 | }
 | 
|---|