chickadee » flsim

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, code generators for Scheme and Standard ML, as well as a library implementing explicit Runge-Kutta solvers for ordinary differential equations.

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

name/scheme :: NAME -> NAME procedure

Converts a given name (symbol) to a valid Scheme identifier.

prelude/scheme :: VOID -> FRAGMENTS procedure

Returns a set of definitions needed by the Scheme code generator. FRAGMENTS is a list of strings, symbols, or fragments.

expr->scheme :: EXPRESSION -> FRAGMENTS procedure

Generates a representation of the given expression in Scheme.

value->scheme :: VALUE -> FRAGMENTS procedure

Generates a representation of the given value in Scheme.

ML code generator

name/ML :: NAME -> NAME procedure

Converts a given name (symbol) to a valid Standard ML identifier.

prelude/ML :: VOID -> FRAGMENTS procedure

Returns a set of definitions needed by the Standard ML code generator. FRAGMENTS is a list of strings, symbols, or fragments.

expr->ML :: EXPRESSION -> FRAGMENTS procedure

Generates a representation of the given value in Standard ML.

value->ML :: VALUE -> FRAGMENTS procedure

Generates a representation of the given value in Standard ML.

Octave code generator

name/Octave :: NAME -> NAME procedure

Converts a given name (symbol) to a valid Octave identifier.

prelude/Octave :: VOID -> FRAGMENTS procedure

Returns a set of definitions needed by the Octave code generator. FRAGMENTS is a list of strings, symbols, or fragments.

expr->Octave :: EXPRESSION -> FRAGMENTS procedure

Generates a representation of the given value in Octave.

value->Octave :: VALUE -> FRAGMENTS procedure

Generates a representation of the given value in Octave.

About this egg

Author

Ivan Raikov

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/>.

Contents »