root/trunk/Library/Generator22D.fsi @ 3919

Revision 3919, 4.0 KB (checked in by emoken, 5 months ago)

GoGs? for 2D arrays (modified)

Line 
1(*******************************************************************************
2  Generator-of-Generators Library is copyrighted free software by Kento Emoto
3  <emoto[at]ipl.t.u-tokyo.ac.jp> developed under the collaborative
4  research on Fortress Programming Language between Sun Microsystems,
5  Inc. and the University of Tokyo. 
6 
7  You can redistribute it and/or modify it under the following
8  BSD-style license or the Sun Contributor Agreement that Kento Emoto signed.
9 
10 
11  Copyright (c) 2009 by Kento Emoto
12  All rights reserved.
13 
14  Redistribution and use in source and binary forms, with or without
15  modification, are permitted provided that the following conditions
16  are met:
17 
18      * Redistributions of source code must retain the above copyright
19        notice, this list of conditions and the following disclaimer.
20      * Redistributions in binary form must reproduce the above copyright
21        notice, this list of conditions and the following disclaimer
22        in the documentation and/or other materials provided with the
23        distribution.
24      * Neither the name of Kento Emoto nor the names of its
25        contributors may be used to endorse or promote products derived
26        from this software without specific prior written permission.
27 
28  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
30  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
31  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
32  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
33  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
34  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
35  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
36  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
37  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
38  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 
40 
41 ******************************************************************************)
42
43api Generator22D
44
45import List.{...}
46import Generator2.{...}
47
48(* Generator2 Rows *)
49object Rows[\ E, nat b0, nat s0, nat b1, nat s1 \](g : Array2[\E, b0, s0, b1, s1\]) extends Generator2[\ E \]
50  getter seed() : Generator[\ E \]
51  toString() : String
52
53  (* actual generation the nested data structure *)
54  generate[\ R \](r : Reduction[\ R \], body : Generator[\ E \] -> R) : R
55end
56
57rows[\ E, nat b0, nat s0, nat b1, nat s1 \](g : Array2[\E, b0, s0, b1, s1\]) : Rows[\E, b0, s0, b1, s1\]
58
59(* Generator2 Cols *)
60object Cols[\ E, nat b0, nat s0, nat b1, nat s1 \](g : Array2[\E, b0, s0, b1, s1\]) extends Generator2[\ E \]
61  getter seed() : Generator[\ E \]
62  toString() : String
63
64  (* actual generation the nested data structure *)
65  generate[\ R \](r : Reduction[\ R \], body : Generator[\ E \] -> R) : R
66end
67
68cols[\ E, nat b0, nat s0, nat b1, nat s1 \](g : Array2[\E, b0, s0, b1, s1\]) : Cols[\E, b0, s0, b1, s1\]
69
70(* Generator2 Rects *)
71object Rects[\ E, nat b0, nat s0, nat b1, nat s1 \](g : Array2[\E, b0, s0, b1, s1\]) extends Generator2[\ E \]
72  getter seed() : Generator[\ E \]
73  toString() : String
74
75  (* actual generation the nested data structure *)
76  generate[\ R \](r : Reduction[\ R \], body : Generator[\ E \] -> R) : R
77end
78
79rects[\ E, nat b0, nat s0, nat b1, nat s1 \](g : Array2[\E, b0, s0, b1, s1\]) : Rects[\E, b0, s0, b1, s1\]
80
81trait AbideWith[\T\] end
82
83trait SomeMSS2DTuple[\T\] end
84
85mssBody[\T\](v:T) : SomeMSS2DTuple[\T\]
86
87object MSS2DReductionAbove[\T\](op, ot) extends { AssociativeReduction[\SomeMSS2DTuple[\T\]\], AbideWith[\MSS2DReductionBeside[\T\]\] }
88  getter asString(): String
89  simpleJoin(x: SomeMSS2DTuple[\T\], y: SomeMSS2DTuple[\T\]): SomeMSS2DTuple[\T\]
90end
91
92object MSS2DReductionBeside[\T\](op, ot) extends { AssociativeReduction[\SomeMSS2DTuple[\T\]\], AbideWith[\MSS2DReductionAbove[\T\]\] }
93    getter asString(): String
94    simpleJoin(x: SomeMSS2DTuple[\T\], y: SomeMSS2DTuple[\T\]): SomeMSS2DTuple[\T\]
95end
96
97end
Note: See TracBrowser for help on using the browser.