Outdated egg!
This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for the CHICKEN 5 version of this egg, if it exists.
If it does not exist, there may be equivalent functionality provided by another egg; have a look at the egg index. Otherwise, please consider porting this egg to the current version of CHICKEN.
flsim
Definition and code generators for a simple applicative language for numerical simulation.
Usage
(require-extension flsim)
Documentation
The flsim library provides definitions for a simple applicative language capable of expressing finite state machines and code generators for Scheme and Standard ML.
Data types
(define-datatype value value? ...)
Representation of values in the language. The value definitions are:
- (V:C const)
- Constant values. Currently supported are numeric and symbolic constants.
- (V:Var name)
- Variable name. NAME must be a symbol.
- (V:Rec fields)
- Record constructor. FIELDS is a list of elements of the form (NAME VALUE).
- (V:Sel field value)
- Record field selector. FIELD is a field name (symbol), and VALUE must be a record value.
- (V:Vec (value ...))
- Vector constructor.
- (V:Sub index value)
- Vector element selector. INDEX must be a positive integer, VALUE must be a vector value.
- (V:Fn args body)
- Parametric expression. ARGS must be a list of symbols, BODY must be an expression (see below for definition).
- (V:Prim name args)
- Primitive procedure application. NAME must be a symbol, ARGS must be a list of values.
- (V:Ifv test iftrue iffalse)
- Conditional value.
(define-datatype expr expr? ...)
Representation of expressions in the language. The expression definitions are:
- (E:Val name value)
- Creates a binding that associates the given name with the given value
- (E:Ife test iftrue iffalse)
- Conditional expression.
- (E:Let bindings body)
- An expression with bindings.
- (E:Ret value)
- Returns the given value.
- (E:Noop)
- Null expression.
Language constants
The language defined in this library assumes the presence in the host language of the standard ANSI C floating-point arithmetic and mathematical functions.
Procedures
Scheme code generator
[procedure] name/scheme :: NAME -> NAMEConverts a given name (symbol) to a valid Scheme identifier.
[procedure] prelude/scheme :: VOID -> FRAGMENTSReturns a set of definitions needed by the Scheme code generator. FRAGMENTS is a list of strings, symbols, or fragments.
[procedure] expr->scheme :: EXPRESSION -> FRAGMENTSGenerates a representation of the given expression in Scheme.
[procedure] value->scheme :: VALUE -> FRAGMENTSGenerates a representation of the given value in Scheme.
ML code generator
[procedure] name/ML :: NAME -> NAMEConverts a given name (symbol) to a valid Standard ML identifier.
[procedure] prelude/ML :: VOID -> FRAGMENTSReturns a set of definitions needed by the Standard ML code generator. FRAGMENTS is a list of strings, symbols, or fragments.
[procedure] expr->ML :: EXPRESSION -> FRAGMENTSGenerates a representation of the given value in Standard ML.
[procedure] value->ML :: VALUE -> FRAGMENTSGenerates a representation of the given value in Standard ML.
Octave code generator
[procedure] name/Octave :: NAME -> NAMEConverts a given name (symbol) to a valid Octave identifier.
[procedure] prelude/Octave :: VOID -> FRAGMENTSReturns a set of definitions needed by the Octave code generator. FRAGMENTS is a list of strings, symbols, or fragments.
[procedure] expr->Octave :: EXPRESSION -> FRAGMENTSGenerates a representation of the given value in Octave.
[procedure] value->Octave :: VALUE -> FRAGMENTSGenerates a representation of the given value in Octave.
About this egg
Author
Version history
- 2.4
- Bug fixes in SUNDIALS support
- 2.3
- Using make egg instead of setup-api for make macro
- 2.1
- Better support for LSODE solver in Octave
- 2.0
- Removed pointer operations (Ldv/Stv/Set) and Seq
- 1.7
- Fixes and extensions to the Octave code generator
- 1.6
- Changes in the integrator interface
- 1.5
- Install RK library files in Chicken shared directory
- 1.4
- Bug fixes in the Octave code generator
- 1.1
- Initial code generator for Octave; some streamlining of the integrator interface
- 1.0
- Initial release
License
Copyright 2010-2012 Ivan Raikov. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. A full copy of the GPL license can be found at <http://www.gnu.org/licenses/>.