source: project/wiki/eggref/4/flsim @ 30971

Last change on this file since 30971 was 30971, checked in by Ivan Raikov, 6 years ago

flsim doc update

File size: 4.8 KB
Line 
1[[tags:egg]]
2
3== flsim
4
5Definition and code generators for a simple applicative language for numerical simulation.
6
7[[toc:]]
8
9== Usage
10
11(require-extension flsim)
12
13== Documentation
14
15The {{flsim}} library provides definitions for a simple applicative
16language capable of expressing finite state machines and code generators
17for Scheme and Standard ML.
18
19
20=== Data types
21
22{{(define-datatype value value? ...)}}
23
24Representation of values in the language. The value definitions are:
25
26; {{(V:C const)}} : Constant values. Currently supported are numeric and symbolic constants.
27; {{(V:Var name)}} : Variable name. {{NAME}} must be a symbol.
28; {{(V:Rec fields)}} : Record constructor. {{FIELDS}} is a list of elements of the form {{(NAME VALUE)}}.
29; {{(V:Sel field value)}} : Record field selector. {{FIELD}} is a field name (symbol), and {{VALUE}} must be a record value.
30; {{(V:Vec (value ...))}} : Vector constructor.
31; {{(V:Sub index value)}} : Vector element selector. {{INDEX}} must be a positive integer, {{VALUE}} must be a vector value.
32; {{(V:Fn args body)}} : Parametric expression. {{ARGS}} must be a list of symbols, {{BODY}} must be an expression (see below for definition).
33; {{(V:Prim name args)}} : Primitive procedure application. {{NAME}} must be a symbol, {{ARGS}} must be a list of values.
34; {{(V:Ifv test iftrue iffalse)}} : Conditional value.
35
36{{(define-datatype expr expr? ...)}}
37
38Representation of expressions in the language. The expression definitions are:
39
40; {{(E:Val name value)}} : Creates a binding that associates the given name with the given value
41; {{(E:Ife test iftrue iffalse)}} : Conditional expression.
42; {{(E:Let bindings body)}} : An expression with bindings.   
43; {{(E:Ret value)}} : Returns the given value.
44; {{(E:Noop)}} : Null expression.
45
46
47
48=== Language constants
49
50The language defined in this library assumes the presence in the host
51language of the standard ANSI C floating-point arithmetic and
52mathematical functions.
53
54
55=== Procedures
56
57==== Scheme code generator
58
59<procedure>name/scheme :: NAME -> NAME</procedure>
60
61Converts a given name (symbol) to a valid Scheme identifier.
62
63<procedure>prelude/scheme :: VOID -> FRAGMENTS</procedure>
64
65Returns a set of definitions needed by the Scheme code
66generator. {{FRAGMENTS}} is a list of strings, symbols, or fragments.
67
68<procedure>expr->scheme :: EXPRESSION -> FRAGMENTS </procedure>
69
70Generates a representation of the given expression in Scheme.
71
72<procedure>value->scheme :: VALUE -> FRAGMENTS </procedure>
73
74Generates a representation of the given value in Scheme.
75
76
77==== ML code generator
78
79<procedure>name/ML :: NAME -> NAME </procedure>
80
81Converts a given name (symbol) to a valid Standard ML identifier.
82
83<procedure>prelude/ML :: VOID -> FRAGMENTS</procedure>
84
85Returns a set of definitions needed by the Standard ML code
86generator. {{FRAGMENTS}} is a list of strings, symbols, or fragments.
87
88<procedure>expr->ML :: EXPRESSION -> FRAGMENTS  </procedure>
89
90Generates a representation of the given value in Standard ML.
91
92<procedure>value->ML :: VALUE -> FRAGMENTS  </procedure>
93
94Generates a representation of the given value in Standard ML.
95
96==== Octave code generator
97
98<procedure>name/Octave :: NAME -> NAME </procedure>
99
100Converts a given name (symbol) to a valid Octave identifier.
101
102<procedure>prelude/Octave :: VOID -> FRAGMENTS</procedure>
103
104Returns a set of definitions needed by the Octave code
105generator. {{FRAGMENTS}} is a list of strings, symbols, or fragments.
106
107<procedure>expr->Octave :: EXPRESSION -> FRAGMENTS  </procedure>
108
109Generates a representation of the given value in Octave.
110
111<procedure>value->Octave :: VALUE -> FRAGMENTS  </procedure>
112
113Generates a representation of the given value in Octave.
114
115
116== About this egg
117
118=== Author
119
120[[/users/ivan-raikov|Ivan Raikov]]
121
122=== Version history
123
124; 2.4 : Bug fixes in SUNDIALS support
125; 2.3 : Using make egg instead of setup-api for make macro
126; 2.1 : Better support for LSODE solver in Octave
127; 2.0 : Removed pointer operations (Ldv/Stv/Set) and Seq
128; 1.7 : Fixes and extensions to the Octave code generator
129; 1.6 : Changes in the integrator interface
130; 1.5 : Install RK library files in Chicken shared directory
131; 1.4 : Bug fixes in the Octave code generator
132; 1.1 : Initial code generator for Octave; some streamlining of the integrator interface
133; 1.0 : Initial release
134
135=== License
136
137
138 Copyright 2010-2012 Ivan Raikov.
139 
140 This program is free software: you can redistribute it and/or modify
141 it under the terms of the GNU General Public License as published by
142 the Free Software Foundation, either version 3 of the License, or
143 (at your option) any later version.
144 
145 This program is distributed in the hope that it will be useful, but
146 WITHOUT ANY WARRANTY; without even the implied warranty of
147 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
148 General Public License for more details.
149 
150 A full copy of the GPL license can be found at
151 <http://www.gnu.org/licenses/>.
152
Note: See TracBrowser for help on using the repository browser.