git @ Cat's Eye Technologies Arboretuum / master
Arrange licensing info in accordance with REUSE 3.2 convention. Chris Pressey 1 year, 11 months ago
12 changed file(s) with 130 addition(s) and 131 deletion(s). Raw diff Collapse all Expand all
+0
-3
.hgtags less more
0 5e36f094cdb6abded8388bff1c062ce0e6936105 rel_1_0_2008_0304
1 c306a814bb485bebf76f94fa2980fbbac6f987e6 rel_1_0_2011_1214
2 c0156e33f293821018b5dcc9b33335d3b820b019 rel_1_0_2014_0819
0 This is free and unencumbered software released into the public domain.
1
2 Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
3
4 In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and
5 successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.
6
7 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8
9 For more information, please refer to <http://unlicense.org/>
+0
-92
README.markdown less more
0 The Arboretuum Programming Language
1 ===================================
2
3 March 2008, Chris Pressey, Cat's Eye Technologies.
4
5 Description
6 -----------
7
8 Arboretuum is a language based on an experimental variant of
9 tree-rewriting which we call forest-rewriting. Appropriate to its name,
10 during forest-rewriting, multiple trees (specifically, a finite set) are
11 rewritten. Each tree is labelled with a name; a rewriting pattern can
12 refer to multiple trees, and must match all of them simultaneously in
13 order for a replacement to occur.
14
15 As an experiment, Arboretuum was not entirely a success.
16 Forest-rewriting unfortunately turned out to be insufficient for what I
17 wanted to apply it to, namely compiler specification. The idea was to
18 have each tree associated with some data structure used in the
19 compilation process (AST, symbol table, output buffer, etc.) However, it
20 became apparent that, by itself, forest-rewriting could not synchronize
21 the data across the trees the way it would need to be synchronized in a
22 real compiler. I plan to tackle the problem again, with a different
23 variation on rewriting, in a future project.
24
25 Regardless, Arboretuum is Turing-complete, as tree-rewriting is simply a
26 special case of forest-rewriting: just have one tree in the forest.
27
28 Implementation
29 --------------
30
31 I will refer you to the reference implementation of Arboretuum for
32 details on the semantics of the language. Ordinarily I frown upon this
33 sort of practice — normatively defining a language by an implementation
34 rather than by a specification — but the interests of brevity, the
35 experimental tack of the project, the unsuccessful outcome of the
36 experiment, and the relative well-definedness of the implementation
37 language (the purely functional subset of R5RS Scheme) conspire to
38 make the consequences of this choice less painful than usual.
39
40 The reference implementation comprises the following files:
41
42 - `preprocess.scm`
43
44 Pre-processes the input program into an internal format suitable for
45 forest-rewriting.
46
47 - `unify.scm`
48
49 Implementation of the unification algorithm which is used to match
50 the pattern part of rewriting rules to the forest.
51
52 - `forest-rewrite.scm`
53
54 Implements the forest-rewriting process proper.
55
56 - `utils.scm`
57
58 Miscellanous support procedures, including `mergesort`,
59 `vector-store` (a side-effect-free alternative to `vector-set!`),
60 `print` and `test`.
61
62 In addition, the following supplementary files which are not definitive
63 w.r.t. the Arboretuum language are included in the project:
64
65 - `tests.scm`
66
67 Gives a set of unit tests to confirm the absence of certain
68 erroneous behaviours. (Obviously, no number of unit tests could
69 confirm the absence of *errors*...)
70
71 - `tree-rewrite.scm`
72
73 Some basic tree-rewriting code, to provide contrast between it's
74 complexity and that of forest rewriting.
75
76 Note that the Scheme implementation of algorithms in the above files are
77 to be taken as *pedantic* rather than *efficient*. They are meant to be
78 read (perhaps even enjoyed?) and only incidentally to be executed.
79
80 History
81 -------
82
83 This project was begun in January 2006. I'd been meaning to release it
84 for a while before actually doing so in March of 2008.
85
86 Happy forest-rewriting!
87
88 -Chris Pressey
89 Cat's Eye Technologies
90 March 4, 2008
91 Chicago, Illinois, USA
0 The Arboretuum Programming Language
1 ===================================
2
3 <!--
4 SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
5 For more information, please refer to <https://unlicense.org/>
6 SPDX-License-Identifier: Unlicense
7 -->
8
9 March 2008, Chris Pressey, Cat's Eye Technologies.
10
11 Description
12 -----------
13
14 Arboretuum is a language based on an experimental variant of
15 tree-rewriting which we call forest-rewriting. Appropriate to its name,
16 during forest-rewriting, multiple trees (specifically, a finite set) are
17 rewritten. Each tree is labelled with a name; a rewriting pattern can
18 refer to multiple trees, and must match all of them simultaneously in
19 order for a replacement to occur.
20
21 As an experiment, Arboretuum was not entirely a success.
22 Forest-rewriting unfortunately turned out to be insufficient for what I
23 wanted to apply it to, namely compiler specification. The idea was to
24 have each tree associated with some data structure used in the
25 compilation process (AST, symbol table, output buffer, etc.) However, it
26 became apparent that, by itself, forest-rewriting could not synchronize
27 the data across the trees the way it would need to be synchronized in a
28 real compiler. I plan to tackle the problem again, with a different
29 variation on rewriting, in a future project.
30
31 Regardless, Arboretuum is Turing-complete, as tree-rewriting is simply a
32 special case of forest-rewriting: just have one tree in the forest.
33
34 Implementation
35 --------------
36
37 I will refer you to the reference implementation of Arboretuum for
38 details on the semantics of the language. Ordinarily I frown upon this
39 sort of practice — normatively defining a language by an implementation
40 rather than by a specification — but the interests of brevity, the
41 experimental tack of the project, the unsuccessful outcome of the
42 experiment, and the relative well-definedness of the implementation
43 language (the purely functional subset of R5RS Scheme) conspire to
44 make the consequences of this choice less painful than usual.
45
46 The reference implementation comprises the following files:
47
48 - `preprocess.scm`
49
50 Pre-processes the input program into an internal format suitable for
51 forest-rewriting.
52
53 - `unify.scm`
54
55 Implementation of the unification algorithm which is used to match
56 the pattern part of rewriting rules to the forest.
57
58 - `forest-rewrite.scm`
59
60 Implements the forest-rewriting process proper.
61
62 - `utils.scm`
63
64 Miscellanous support procedures, including `mergesort`,
65 `vector-store` (a side-effect-free alternative to `vector-set!`),
66 `print` and `test`.
67
68 In addition, the following supplementary files which are not definitive
69 w.r.t. the Arboretuum language are included in the project:
70
71 - `tests.scm`
72
73 Gives a set of unit tests to confirm the absence of certain
74 erroneous behaviours. (Obviously, no number of unit tests could
75 confirm the absence of *errors*...)
76
77 - `tree-rewrite.scm`
78
79 Some basic tree-rewriting code, to provide contrast between it's
80 complexity and that of forest rewriting.
81
82 Note that the Scheme implementation of algorithms in the above files are
83 to be taken as *pedantic* rather than *efficient*. They are meant to be
84 read (perhaps even enjoyed?) and only incidentally to be executed.
85
86 History
87 -------
88
89 This project was begun in January 2006. I'd been meaning to release it
90 for a while before actually doing so in March of 2008.
91
92 Happy forest-rewriting!
93
94 -Chris Pressey
95 Cat's Eye Technologies
96 March 4, 2008
97 Chicago, Illinois, USA
+0
-24
UNLICENSE less more
0 This is free and unencumbered software released into the public domain.
1
2 Anyone is free to copy, modify, publish, use, compile, sell, or
3 distribute this software, either in source code form or as a compiled
4 binary, for any purpose, commercial or non-commercial, and by any
5 means.
6
7 In jurisdictions that recognize copyright laws, the author or authors
8 of this software dedicate any and all copyright interest in the
9 software to the public domain. We make this dedication for the benefit
10 of the public at large and to the detriment of our heirs and
11 successors. We intend this dedication to be an overt act of
12 relinquishment in perpetuity of all present and future rights to this
13 software under copyright law.
14
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21 OTHER DEALINGS IN THE SOFTWARE.
22
23 For more information, please refer to <http://unlicense.org/>
11 ; Forest Rewriting
22 ; Chris Pressey, late January 2006
33 ;
4 ; This work is in the public domain. See the file UNLICENSE for more
5 ; information.
4 ; SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
5 ; For more information, please refer to <https://unlicense.org/>
6 ; SPDX-License-Identifier: Unlicense
67 ;
78
89 ;
11 ; Preprocessor for Forest Rewriter
22 ; Chris Pressey, sometime late January 2006
33 ;
4 ; This work is in the public domain. See the file UNLICENSE for more
5 ; information.
4 ; SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
5 ; For more information, please refer to <https://unlicense.org/>
6 ; SPDX-License-Identifier: Unlicense
67 ;
78
89 ;
11 ; Test suite for forest-rewriting project
22 ; Chris Pressey, sometime late January 2006
33 ;
4 ; This work is in the public domain. See the file UNLICENSE for more
5 ; information.
4 ; SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
5 ; For more information, please refer to <https://unlicense.org/>
6 ; SPDX-License-Identifier: Unlicense
67 ;
78
89
11 ; Bottom-Up Tree-Rewriting (Term-Rewriting)
22 ; Chris Pressey, sometime late January 2006
33 ;
4 ; This work is in the public domain. See the file UNLICENSE for more
5 ; information.
4 ; SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
5 ; For more information, please refer to <https://unlicense.org/>
6 ; SPDX-License-Identifier: Unlicense
67 ;
78
89 ;
11 ; Simple support for unification & pattern matching
22 ; Chris Pressey, late January 2006
33 ;
4 ; This work is in the public domain. See the file UNLICENSE for more
5 ; information.
4 ; SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
5 ; For more information, please refer to <https://unlicense.org/>
6 ; SPDX-License-Identifier: Unlicense
67 ;
78
89 ;
11 ; Utility functions used by forest-rewriting project
22 ; Chris Pressey, late January 2006
33 ;
4 ; This work is in the public domain. See the file UNLICENSE for more
5 ; information.
4 ; SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
5 ; For more information, please refer to <https://unlicense.org/>
6 ; SPDX-License-Identifier: Unlicense
67 ;
78
89 ;
00 #!/bin/sh
1
2 # SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
3 # For more information, please refer to <https://unlicense.org/>
4 # SPDX-License-Identifier: Unlicense
15
26 cd src
37 csi -q -b tests.scm > test-output.txt || exit 1