# NEST Quick Reference

## Introduction

SLI is the simulation language of the NEST simulation system. SLI is a stack oriented language, i.e. each command expects to find its arguments on the stack.
When a SLI command is executed, it usually removes all arguments from the stack and pushes one or more results back on the stack.

This document presents a directory of the most important SLI operators, grouped into sections. Since this document is not automatically generated from the help pages, it might not contain the latest additions to SLI.

↑ Table of contents ↑

## The on-line help system

### Layout of help pages

For most SLI commands, there exists help information which can be viewed either as plain ASCII text or in HTML-format. The structure of a help entry resembles that of a UNIX mamual page. It consists of several sections which are explained below:

Name: | [namespace::]Command - Short description. The commandname, followed by a dash, followed by a short description of the command. The short description should not be longer than 60 characters. However, the description should be as descriptive as possible, since it is used for the help-index. If the command is available in a special namespace dictionary only, this shall be indicated by specifying the dictionary name as a prefix, in a C++-like manner. (See also "Availability" and "Options" below.)
Synopsis: | arg1 ... argn Command -> res1 ... resn This entry summarises how the command is to be called. arg1 through argn denote the arguments of the command in the order as they are entered. Thus, argn is at the top of the stack. On the right side of the stylised arrow ->, the output of the command is shown, again, in the order that the results are pushed on the stack. Thus, resn will be at the top of the stack.
Parameters: | A detailed description of the types and semantics of the parameters. Note, that this entry is not allways present. Sometimes, the types of the arguments are already indicated in the Synopsis entry, by using appropriate names and syntactic markup. For example [result] indicates that the result is an array.
Description: | A detailed description of the command.
Options: | Any options that can be set for this routine, using the SetOptions command. This entry shall apear if there are any options that can be set for this routine. When creating a new command, note that the options shall be registered using the same name that is specified in the "Name" section of the documentation, including any namespace:: prefix.
Examples: | Illustrative examples, showing how the command works. This entry should appear. Examples should cover typical usage as well as special cases (e.g. passing 0, empty arrays, strings of length 0, ...). It is recommended that examples are suited for testing the correct operation of the routine.
Variants: | Any variants of the routine that operate on special parameter types (see SLI operator naming conventions). This entry is optional but should appear if existing variants are more efficient than root routine.
Bugs: | Any information on known bugs and misbehaviour of the routine. This entry shall document all known bugs.
Diagnostics: | A list of errors which may be raised. More elaborate versions may also describe in more detail in which situations the errors might occur. This entry is optional.
Author: | Author(s) of the command and/or documentation. This entry is optional.
FirstVersion: | Date at which the routine was created. This entry is optional.
Remarks: | Any remarks on the routine, its operation or implementation, or any related information. This entry is optional.
Availability: | SLI module or "namespace" dictionary that needs to be loaded or opened in order to make the command available. This entry shall appear if the scope of the routine name is limited to a module or dictionary.
References: | References to important articles, books, or other reference material which is related to this command or help-entry. This entry is optional, but recommended, if such references exist.
SeeAlso: | A list of links to related help-pages. This entry is optional, but recommended.
Source: | The name of the source-file from which the help-page was generated.

### Accessing the on-line help

The following commands are available to access NEST's on-line help facilities.

help | Display help for a given symbol.
helpdesk | Open the on-line help main page in an HTML browser.
helpindex | Display a list of all documented commands.
page | The pager program to use for help output.
apropos | Search the command index for a regular expression.

↑ Table of contents ↑

## Simulation kernel

### Controlling the simulation

Simulate | Simulate n milliseconds.
ResumeSimulation | Resume an interrupted simulation.
ResetKernel | Put the simulation kernel back to its initial state.
ResetNetwork | Reset the dynamic state of the network.
reset | Reset dictionary stack and clear the userdict.

### Setting and retrieving kernel parameters

Most kernel parameters are accessed via the root node's status dictionary. The id of the root node is 0. It can be inspected and modified like all other network nodes.

kernel | Global properties of the simulation kernel.
SetStatus | Modify status of an element.
GetStatus | Return the status dictionary of an element.
ShowStatus | Show the status dictionary of a network node.

### Memory consumption

MemoryInfo | Report the current memory usage.
memory_thisjob | Report virtual memory size for current NEST process.

↑ Table of contents ↑

## Models and network nodes

All nodes in NEST (i.e. neurons, devices, and subnetworks) are derived from a common base class. Therefore they share some general properties.

Node | General properties of all nodes.
modeldict | Dictionary with NEST model objects.

### Constructing nodes

Create | Create network elements in the current subnet.
LayoutNetwork | Create a nested multi-dimensional network structure in the current subnet.

### Neuron Models

iaf_neuron, iaf_psc_alpha | Leaky integrate-and-fire neuron model.
iaf_psc_delta | Leaky integrate-and-fire neuron model.
iaf_psc_exp | Leaky integrate-and-fire neuron model with exponential PSCs
iaf_cond_alpha | Simple conductance based leaky integrate-and-fire neuron model.
iaf_cond_exp | Simple conductance based leaky integrate-and-fire neuron model.
iaf_cond_alpha_mc | Multi-compartment conductance-based leaky integrate-and-fire neuron model.
iaf_tum_2000 | Leaky integrate-and-fire neuron model with exponential PSCs.
hh_psc_alpha | Hodgkin Huxley neuron model.
hh_psc_alpha_gap | Hodgkin Huxley neuron model with gap-junction support.
hh_cond_exp_traub | Hodgin Huxley based model, Traub modified.

### Device Models

Device | General properties of devices.
RecordingDevice | Common properties of all recording devices.
StimulatingDevice | General properties of stimulating devices.

#### Spike input devices

The following devices generate sequences of spikes which can be send to a neuron. These devices act like populations of neurons and connected to their targets like a neuron.

pulsepacket_generator | Device to produce Gaussian spike-trains.
poisson_generator | Generate Poisson spike trains.
spike_generator | Generates spike-events from an array.

#### Analog input devices

dc_generator | Generate a DC current.
ac_generator | Generate a sinusoidal alternating current.
noise_generator | Generate a Gaussian noise current.
layerdc_generator | Generate a DC current for a neuron layer.
step_current_generator | Provides a piecewise constant DC input current.

#### Recording devices

spike_detector | Device to record spiking activity from one or more nodes.
correlation_detector | Device for evaluating cross correlation between two spike sources.
multimeter | Device to record analog data from neurons.
voltmeter | Device to observe membrane potentials.
conductancemeter | Device to observe synaptic conductances.

↑ Table of contents ↑

## Connecting nodes

synapsedict | Dictionary containing all synapse models.
Connect | Connect two network nodes.
DataConnect | Build connections from explicit specifications.

### Topological connections

topology::CreateLayer | Creates topological node layer.
topology::ConnectLayers | Connect two layers.
topology::GetElement | Return node GID at specified layer position.
topology::GetPosition | Retrieve position of input node.
topology::GetRelativeDistance | Retrieve a vector of distance between two nodes.
topology::LayerGidPositionMap | Prints layer node positions to file.
topology::PrintLayerConnections | Prints a list of the connections of the nodes in the layer to file.

↑ Table of contents ↑

## Looking at node, networks, and connectivity

### Navigating the network

CurrentSubnet | Return the GID of the current network node.
ChangeSubnet | Change the curent working subnet to a specified position.
PrintNetwork | Print network tree in readable form.
NetworkDimensions | Returns an array with the dimensions of a structured subnet.
GetGlobalNodes | Return IDs of all nodes of a subnet.
GetGlobalLeaves | Return IDs of all leaves of a subnet.
GetGlobalChildren | Return IDs of all immediate child nodes of a subnet.
GetLocalNodes | Return IDs of all nodes of a subnet local to the MPI process executing the command.
GetLocalLeaves | Return IDs of all leaves of a subnet local to the MPI process executing the command.
GetLocalChildren | Return IDs of all immediate child nodes of a subnet local to the MPI process executing the command.

### Investigating connectivity

GetConnections | Find connections that fulfil the given criteria.
SetStatus | Modify status of an element.
GetStatus | Return the status dictionary of an element.

### Setting and retrieving parameters of network elements

SetStatus | Modify status of an element.
GetStatus | Return the status dictionary of an element.
ShowStatus | Show the status dictionary of a network node.
type | Return the type of an element.
ResetKernel | Put the simulation kernel back to its initial state.
ResetNetwork | Reset the dynamic state of the network.
reset | Reset dictionary stack and clear the userdict.

↑ Table of contents ↑

## Stacks

### Operand stack

#### Stack contents

stack | Display stack contents.
pstack | Display stack contents in syntax form.
inspect | Inspect an object.
typestack | Display type information of the stack.
operandstack | Store the contents of the stack in an array.
restoreostack | Restore the stack from an array.

#### Counting stack levels

count | Count the number of objects on the stack.
counttomark | Count number of objects on the stack from top to marker.
mark | Push a mark-object on the stack.

#### Copying stack elements

dup | Duplicate the object which is on top of the stack.
over | Copy stack object at level 1.
copy | Copy the first n stack levels.
pick | Copy object from stack level n.
index | Copy object from stack level n.

#### Removing stack elements

pop | Pop the top object off the stack.
npop | Pop n object off the stack.
clear | Clear the entire stack.

#### Rearranging stack elements

exch | Exchange the order of the first two stack objects.
roll | Roll a portion n stack levels k times.
rolld | Roll the three top stack elements downwards.
rollu | Roll the three top stack elements upwards.
rot | Rotate entire stack contents.

### Execution-stack access

execstack | Return the contents of the execution stack as array.
restoreestack | Restore the execution stack from an array.

↑ Table of contents ↑

## Arithmetic functions

abs | Absolute value of a number.
add | Add two numbers or vectors.
sub | Subtract two numbers or vectors.
mul | Multiply two numbers or vectors (point-wise).
div | Divide two numbers or vectors (point-wise).
inv | Compute 1/x.
mod | Compute the modulo of two integer numbers.
neg | Reverse sign of a number.
ceil | Return nearest integer larger than the argument.
round | Round double to the nearest integer.
trunc | Truncate decimals of a double.
floor | Return nearest integer smaller than the argument.
pow | Raise a number to a power.
sqr | Compute the square of a number.
sqrt | Compute the square root of a non-negative number.
exp | Calculate the exponential of double number.
ln | Calculate natural logarithm of double number.
log | Calculate decadic logarithm of double number.
frexp | Decomposes its argument into an exponent of 2 and a factor.
modf | Decomposes its argument into fractional and integral part.
cos | Calculate the cosine of double number.
sin | Calculate the sine of double number.
max | Return the greater of two values.
min | Return the smaller of two values.

↑ Table of contents ↑

## Boolean functions

### Comparison functions

eq | Test two objects for equality.
gt | Test if one object is greater than another object.
geq | Test if one object is greater or equal than another object.
lt | Test if one object is less than another object.
leq | Test if one object is less or equal than another object.
neq | Test two objects for inequality.
Min | Returns the smallest element of an array.
Max | Returns the largest element of an array.

### Boolean operators

and | Logical and operator.
or | Logical or operator.
not | Logical not operator.
xor | Logical xor operator.

↑ Table of contents ↑

## Special mathematical functions

Erf | Error function.
Erfc | Complementary error function.
Gammainc | Incomplete Gamma function.
GaussDiskConv | Convolution of an excentric Gaussian with a disk.
CyclicValue | Project a cyclic value onto it's norm interval (e.g. angle on [0,360)).
FractionalPart | Return fractional part of the argument.
IntegerPart | Return integer part of the argument.
UnitStep | The unit step function (aka Heavyside function).
LambertW | Simple iteration implementing the Lambert-W function.

### Mathematical constants

E | Euler constant.
Pi | Pi constant.

↑ Table of contents ↑

## Random number generation

seed | Set the seed of a random number generator.
irand | Generate a random integer number.
drand | Generate a random double number.
rngdict | Dictionary of random generator types.
rdevdict | Dictionary of random deviate types.
CreateRNG | Create a random number generator.
CreateRDV | Create a random deviate.
Random | Returns a random number.
RandomArray | Returns array with random numbers.
RandomSubset | Random subset of an arry without repetitions.
GetStatus | Return the property dictionary of a random deviate generator.
SetStatus | Modify the properties of a random deviate generator.

### Random deviate generator types

binomial | Binomial random deviate generator.
exponential | Exponential random deviate generator.
gamma | Gamma random deviate generator.
normal | Normal random deviate generator.
normal_clipped | Clipped normal random deviate generator.
normal_clipped_left | Left clipped normal random deviate generator.
normal_clipped_right | Right clipped normal random deviate generator.
poisson | Poisson random deviate generator.
uniform_int | Uniform integer random deviate generator.

↑ Table of contents ↑

## Statistics

Min | Returns the smallest element of an array.
Max | Returns the largest element of an array.
Total | Returns the sum of the elements of an array.
Mean | Returns the mean of the elements of an array.
| Variance | Returns the unbiased variance of the elements of an array.
StandardDeviation | Returns the standard deviation of the element of an array.

↑ Table of contents ↑

## Arrays, vectors, and matrices

### Construction

array | Construct array with n zeros (PS).
arraystore | Pops the first n elements of the stack into an array.
LayoutArray | Create a multi-dimensional array.
Range | Generate array with range of numbers.
Table | Generate an array according to a given function.
ReadList | Read a list of specified format from a stream.
GaborPatch | Create a two-dimensional array filled with values from the Gabor function.
GaussPatch | Create a two-dimensional array filled with values from the Gauss function.

### Conversions

cva | Convert dictionary/trie to array.
cst | Convert string to array of tokens.
cvlit | Convert name/string/procedure to literal/array.
cvx | Convert array/string to procedure.
cv1d | Convert 2-dimensional coordinates to 1-dim index.
cv2d | Convert 1-dimensional index to 2-dim coordinate.
Export | Save in a foreign file format.
MathematicaToSliIndex | Convert Mathematica-like indices to SLI indices.
SliToMathematicaIndex | Convert SLI indices to Mathematica-like indices.

### Insertion

put | Put indexed object into container.
insert | Insert an object in a container at a specific position.
insertelement | Insert an element to a container at a specific position.
join | Join two containers of the same type.
JoinTo | Join with container referenced by l-value.
append | Append object to container.
AppendTo | Append to container referenced by l-value.
prepend | Attach an object to the front of a container.

### Inspecting an array or matrix

empty | Tests if a string or array is empty.
length | Counts elements of an object.
size | Returns the size of an array/string.
GetMin | Get minimal element.
GetMax | Get maximal element.
ArrayQ | Returns true if top object is an array.
MatrixQ | Test if a SLI array is a (hyper-rectengular) matrix.
Dimensions | Determine dimenstions of a (hyper-rectangular) SLI array.
TensorRank | Estimate the rank of a tensor.

### Retrieving elements from an array

get | Retrieve indexed Object from a container.
Part | Returns parts of an array.
Take | Extract sequences from an array.
getinterval | Return a subsequence of a container.
erase | Deletes a subsequece of a container.
First | Return the first element of an array.
Last | Return the last element of an array.
Rest | Remove the first element of an array and return the rest.
Select | Reduces an array to elements which fulfill a criterion.
Sort | Sorts a homogeneous array of doubles.
arrayload | Pushes array elements followed by number of elements.
area | Return array of indices defining a 2d subarea of a 2d array.
area2 | Return array of indices defining a 2d subarea of a 2d array.

#### Removing and replacing elements

putinterval | Replace sections of an array/string (PS).
erase | Deletes a subsequece of a container.
replace | Replace a section of a container by a new sequence.
ReplaceOccurrences | Replace the occurences of a key in a container.
breakup | Break a string or an array at given Substrings or SubArrays.
trim | Delete leading/trailing elements in a container.

#### Operations on lists and arrays

Partition | Partition list into n element pieces.
Flatten | Flatten out a nested list.
Reform | Reform the dimensions of a hyperrectengular array.
Select | Reduces an array to elements which fulfill a criterion.
Split | Splits array into subarrays of sequences of identical elements.
MergeLists | Merges sorted lists.
MemberQ | Checks if array contains a specific element.
HasDifferentMemberQ | Checks if array contains an element different from given value.

### Functional operations on lists and arrays

Map | Apply a procedure to each element of a list or string.
MapAt | Apply a procedure to some elements of a list or string.
MapIndexed | Apply a function to each element of a list/string.
MapThread | Apply a procedure to to corresponding elements of n arrays.
FixedPoint | Apply a procedure repeatedly until the result is an invariant.
NestList | Gives a list of the results of applying f to x 0 through n times.
Nest | Apply a function n times.
FoldList | Gives a list of the results of repeatedly applying a function with two parameters.
Fold | Result of repeatedly applying a function with two arguments.
ScanThread | Apply a procedure to corresponding elements of n arrays, not returing results.
forall | Call a procedure for each element of a list/string.
forallindexed | Call a procedure for each element of a list/string.
EdgeClip | Clip 2-d array indices at array edges.
EdgeTruncate | Truncate 2-d array indices at array edges.
EdgeWrap | Wrap 2-d array indices around edges (toriodal).
IndexWrap | Project a cyclic index value onto interval [0,N).

### Arrays as vectors and matrices

#### Dimensions and rank

MatrixQ | Test whether a nested array is a matrix.
Dimensions | Determine dimensions of an array.
TensorRank | Determine the level to which an array is a full vector.

#### Operations on vectors and matrices

add | Add two numbers or vectors.
sub | Subtract two numbers or vectors.
mul | Multiply two numbers or vectors (point-wise).
div | Divide two numbers or vectors (point-wise).
Dot | Product of vectors, matrices, and tensors.
Plus | Sum of all vector components.
Times | Product of all vector components.
Transpose | Transposes the first two levels of its argument.
reverse | Reverse a string or array.
rotate | Rotate an array.
OuterProduct | Outer product.

### Memory management

capacity | Returns the capacity of an array.
reserve | Bring an array to a certain capacity.
resize | Change the internal size of an array.
shrink | Reduce the capacity of an array to its minimum.

↑ Table of contents ↑

## Strings

### Construction

= | Display top operand stack object.
== | Display top operand stack object.
==only | Display top operand stack object without linefeed.
=only | Display top operand stack object without linefeed.
getline | Read an entire line from an input stream.
gets | Read white space terminated string from stream.
Read | Read an object of a certain type from a stream.
ReadWord | Read white space terminated string from stream.

### Conversion

cvs | Convert object to string.
cst | Convert string to array of tokens.
cvd_s | Convert string to double.
token_s | Read a token from a string.

### Insertion

length | Counts elements of an object.
put | Put indexed object into container.
putinterval | Replace sections of an array/string (PS).
insert | Insert an object in a container at a specific position.
insertelement | Insert an element to a container at a specific position.
prepend | Attach an object to the front of a container.
append. | Append object to container.
join | Join two containers of the same type.

### Retrieving characters and substrings

empty | Tests if a string or array is empty.
get | Lookup indexed Object of a container.
getinterval | Return a subsequence of a container.
erase | Deletes a subsequece of a container.
First | Return the first element of an array/string.
Last | Return the last element of an array/string.
Rest | Remove the first element of an array/string and return the rest.
search | Search for a sequence in an array or string.
searchif | Check wether a substring is contained within a string.

### Removing and replacing

erase | Deletes a subsequece of a container.
replace | Replace a section of a container by a new sequence.
ReplaceOccurrences | replace the occurences of a key in a container.
breakup | Break a string or an array at given sub-strings or sub-arrays.
trim | Delete leading/trailing elements in a container.

### Operations on strings

empty | Tests if a string or array is empty.
length | Counts elements of an object.
size | Returns the size of an array/string.
forall | Call a procedure for each element of a list/string.
forallindexed | Call a procedure for each element of a list/string.
Map | Apply a procedure to each element of a list or string.
MapIndexed | Apply a function to each element of a list/string.
reverse | Reverse a string or array.
ToUppercase | Convert a string to upper case.
ToLowercase | Convert a string to lower case.

### Regular expressions

regcomp | Create a regular expression.
regex_find | Check if a regex is included in a string or stream.
regex_find_r | Check if a regex is included in a string.
regex_find_rf | Check if a regex is included in a stream.
regex_find_s | Check if a regex is included in a string.
regex_find_sf | Check if a regex is included in a stream.
regex_replace | Replace all occurences of a regex.
regexec | Compare string and regular expression.

↑ Table of contents ↑

## Dictionaries

### Construction

<<>> | construct a dictionary.
dict | Create new, empty dictionary.
clonedict | Create a copy of a dictionary.
SaveDictionary | Save contents of a dictionary to a file.
RestoreDictionary | Read a dictionary definition from a file.
MergeDictionary | Merge all definitions of a dictionary with the current dicitonary.

### Conversion

cva | Convert dictionary/trie to array.

### Insertion and lookup

using | Add a namespace (or dictionary) to the local scope, keeping the current dictionary.
endusing | Close the scope of a 'using' context.
get | Lookup indexed Object of a container.
call | Execute object from a dictionary (or namespace, see below).
put | Put indexed object into container.
put_d | Add an entry to a dictionary.
known | Check whether a name is defined in a dictionary.
info | Display the contents of a dictionary.
info_ds | Print contents of all dictionaries on the dicitonary stack to stream.
topinfo_d | Print contents of top dictionary to stream.
length | Counts elements of a container object.
SubsetQ | Test if one dictionary is a subset of another.

### Key removal

undef | Remove a key from a dictionary.
cleardict | Clears the contents of a dictionary.

### Special dictionaries

errordict | Pushes error dictionary on operand stack.
modeldict | Dictionary with neural model objects.
synapsedict | Dictionary containing all synapse models.
statusdict | Dictionary with platform dependent status.
signaldict | Dictionary containing the machine-dependent signal codes.
libdict | Dictionary of provided libraries and their components.
elementstates | Dictionary with symbolic element state tag.
ReadModes | Dictionary with type specifiers for read functions.
OptionsDictionary | Dictionary for global options.

### Dictionary Stack

dictstack | Return current dictionary stack as array.
begin | Open a dictionary.
end | Closes the current dictionary.
currentdict | Return topmost dictionary of the dictionary stack.
lookup | Search for a key in each dictionay on the dictionary stack.
who | List contents of the top-level dicitonary.
whos | List contents of all dictionaries on the dicitonary stack.
countdictstack | Return number of dictionaries on the dictionary stack.
cleardictstack | Pop all non-standard dictionaries of the stack.

### Namespaces

Dictionaries can be used to limit names to a certain scope. This is useful for logical grouping, and to prevent name conflicts, very much like the use of namespaces in C++. Furthermore, it keeps the system dictionary from being littered.

When refering to a variable or routine of limited scope, its scope shall be indicated by the notation `namespace::name` (e.g. `arr::Reform`). If no namespace is specified, `systemdict::` is implicitely assumed, meaning unlimited scope.

Note: Please note that the notation `namespace::name` is not yet supported in program code. Use the command `call` instead.

namespace | Open or create a namespace dictionary.
call | Execute object from a namespace (or dictionary, see above).
:: | Execute a symbol from a nested namespace.

↑ Table of contents ↑

## Names, functions, and variabes

### Defining variables and functions

def | Define a variable or function.
Set | Same as `def` with reversed arguments.
undef | Remove a key from a dictionary.
SLIFunctionWrapper | Define a SLI function with lots of comfort.

### Show defined variables and functions

who | List contents of the top-level dicitonary.
whos | List contents of all dictionaries on the dicitonary stack.
lookup | Search for a key in each dictionay on the dictionary stack.
known | Check whether a name is defined in a dictionary.

### Names and scoping

begin | Open a dictionary.
end | Closes the current dictionary.
lookup | Search for a key in each dictionay on the dictionary stack.
load | Search for a key in each dictionay on the dictionary stack.

↑ Table of contents ↑

## Loops

### Infinite loops

loop | Repeatedly execute a procedure.
exit | Exit a loop construct.

### Loops with counters

for | Execute a procedure for a sequence of numbers.
repeat | Execute a procedure n times.
FindRoot | Numerically find a root in an interval.
exit | Exit a loop construct.

### Loops over containers

forall | Call a procedure for each element of a list/string.
forallindexed | Call a procedure for each element of a list/string.
Map | Apply a procedure to each element of a list or string.
MapIndexed | Apply a function to each element of a list/string.
MapThread | Apply a procedure to corresponding elements of n arrays, returning the result.
ScanThread | Apply a procedure to corresponding elements of n arrays, not returing results.
NestList | Gives a list of the results of applying f to x 0 through n times.
FoldList | Repeatedly apply a function with two parameters.
exit | Exit a loop construct.

↑ Table of contents ↑

## Control structures

if | Conditionaly execute a procedure.
ifelse | Conditionaly execute a procedure.
case | Like `if`, but test a series of conditions.
switch | Finish a `case ... switch` structure.
switchdefault | Finish a `case ... switchdefault` structure.
stop | Raise a stop signal.
stopped | Returns true if execution was stopped by stop.

↑ Table of contents ↑

## Functions and procedures

### Object oriented techniques

call | Execute object from a dictionary.

### Type checking

#### Accessing type information

type | Return the type of an object.
typeinfo | Return the type of an object.
LiteralQ | Returns true if top object is a literal.
NumberQ | Returns true if top object is a number (int or double).
StringQ | Returns true if top object is a string.

#### Type tries

A type-trie is a lookup structure which can be used to implement automatic type checking as well as operator overloading.

def | Define a variable or function.
SLIFunctionWrapper | Define a SLI function with lots of comfort.
trie | Create a new type-trie object.
addtotrie | Add a function variant to a trie-object.
cva | Convert dictionary/trie to array.
cva_t | Converts a type trie to an equivalent array.
cvt_a | Converts an array to the equivalent type trie.

### Type Conversions

cva | Convert dictionary/trie to array.
cst | Convert string to array of tokens.
cvi | Convert double/string to integer.
cvd | Convert integer/string to double.
cvlit | Convert name/string/procedure to literal/array.
cvn | Convert literal/string to name.
cvx | Convert array/string to procedure.

### Options

Options | Define a new set of options for a given name.
GetOption | Get the value of a procedure option.
GetOptions | Get all options for a given name.
SetOptions | Set options for a given name.
SaveOptions | Temporarily save options of a command
ResetOptions | Reset all options of a command to their default values.
RestoreOptions | Restore the temporarily saved options of a command.
ShowOptions | Display all options for a given name.
OptionsDictionary | Dictionary for global options.

### Optimization

bind | Recursively replaces executable operator names by their values.

↑ Table of contents ↑

## Error handling and debugging

If an error occurs, execution is usually interrupted and a diagnostic message is printed. In most cases, the stack is restored to the state where it was immediately before the command that raised the error was called.

If the error was raised from within a procedure, the stack might not be restored to the state before the procedure was called.

handleerror | Default error handler.
stop | Raise a stop signal.
stopped | Returns true if execution was stopped by `stop`.
raiseerror | Raise an error to the system.
raiseagain | Re-raise the last error.
resume | Resume interrupted SLI program after a system signal.
setguard | Limit the number of interpreter cycles.
break | Interrupt the execution of a procedure for inspection.
continue | Continue an interrupted procedure.
assert | Assert that procedure returns true.
currentname | Returns the most recently resolved name.
debug.sli | Debugging support for SLI.

↑ Table of contents ↑

## Files and Streams

### Standard input and output

cin | Standard input stream.
cout | Standard output stream.
cerr | Standard error output stream.
setprecision | Set precision for decimal place of a stream.
inspect | Inspect an object.

= | Display top operand stack object.
== | Display top operand stack object.
==only | Display top operand stack object without linefeed.
=only | Display top operand stack object without linefeed.
print | Print object to a stream.
pprint | Pretty print object to a stream.

### Opening and Closing

file | Opens file for reading or writing.
ifstream | Open file stream for reading.
xifstream | Create an executable input-stream.
searchfile | Tries to open a file for reading using the search-path.
searchifstream | Searches SLI's search path for a file.
ofstream | Open a file stream for writing.
ofsopen | Open an existing file for appending or writing.
osstream | Create a string-stream object.
pipe | Open up a pipe.
mkfifo | Create a FIFO special file (named pipe).
close | Close a stream.
tmpnam | Return valid nonexisting file name.
dup2 | Duplicate a filestream's file descriptor onto another's.
isatty | Determine if a stream is connected to a terminal.

### Reading from streams

#### Checking for data

setNONBLOCK | Switch between blocking and non-blocking I/O.
in_avail | Check for available data in an input stream's buffer.
available | Check if data is available from an istream.
ignore | Ignore any waiting data on an istream.

#### Unformatted string input

getc | Read single character from input stream.
gets | Read white space terminated string from stream.
getline | Read a newline terminated string from an input stream.
readline | Read and edit a line from standard input.
GNUreadline | Read and edit a line from standard input.
GNUaddhistory | Add a string to the readline-history.
oldgetline | "Old", ignorant version of `getline`.

#### Formatted input

str | Retrieve a string from a string-stream.
token | Read a token from a stream or string.
token_is | Read a token from an input stream.
token_s | Read a token from a string.
Read | Read an object of a certain type from a stream.
ReadDouble | Read a double from a stream.
ReadInt | Read an integer from a stream.
ReadList | Read a list of specified format from a stream.
ReadWord | Read white space terminated string from stream.
ReadModes | Dictionary with type specifiers for read functions.

#### Formatted Output

Export | Save in a foreign file format.

### Writing to streams

print | Print object to a stream.
pprint | Pretty print object to a stream.
endl | Line break.
flush | Force the buffer of a stream to be flushed.
setprecision | Set precision for decimal place of a stream.

### Handling flags of streams

iclear | Clear the state-flags of input stream.
oclear | Clear the state-flags of output stream.
ifail | Check the "fail"-flag of an input stream.
ieof | Check the "eof"-flag of an input stream.
oeof | Check the "eof"-flag of an output stream.
eof | Check eof status of a stream.
igood | Check the "good"-flag of a stream.
ogood | Check the "good"-flag of an output stream.
good | Check good status of a stream.

### Handling Image Files

readPGM | Read in grey-level image in PGM Format.
writePGM | Erite out a grey-level image in PGM format.

### Editing Files

edit | .Edit a file.

↑ Table of contents ↑

## Executing SLI programs

run | Execute a .sli file.
spoon | Execute a parallel SLI-process.
setpath | Set the SLI search path.
addpath | Append a path to SLISearchPath.
path | Return current search path as array.

↑ Table of contents ↑

## Interfacing the hosts file-system

Directory | Return current working directory.
cd | Change working directory.
SetDirectory | Change working directory.
ls | Print contents of current working directory.
FileNames | Return contents of current working directory.
DeleteFile | Delete a file.
mkfifo | Create a FIFO special file (named pipe).
MoveFile | Rename a file.
LocateFileNames | Look up complete pathnames of given file in given.
tmpnam | Return valid nonexisting file name.
MakeDirectory | Create a new directory.
MoveDirectory | Rename a directory.
RemoveDirectory | Delete a directory.
CompareFiles | Compare two files for equality.

↑ Table of contents ↑

## Process control

### Executing UNIX commands and external programs

system | Execute a UNIX command in a parallel process.
spawn | Spawn a UNIX process and redirect stdin and stdout.
shpawn | Spawn a UNIX process using a shell and redirect stdin and stdout.
sysexec | Transfer control to a UNIX-command.
kill | Send a signal to another process.

### Low-level process control

exec | Execute an object.
ctermid | Return the path to the controlling terminal of the process.
fork | Create a child process of SLI.
spawn | Spawn a UNIX process and redirect stdin and stdout.
shpawn | Spawn a UNIX process using a shell and redirect stdin and stdout.
spoon | Execute a parallel SLI-process.
kill | Send a signal to another process.
wait | Wait for any child process to terminate.
waitPID | Wait or check for a child process to terminate.
getPGRP | Get process group ID of the current process.
getPID | Get ID of the current process.

### Accessing the process environment

environment | Return the environment of the current SLI process.
setenvironment | Set the environment of the current SLI process.
getenv | Evaluates if a string is an evironment variable.

### Unit Conversion

unit_conversion | Conversion factors for SI units.
Hz | Specification in Hz (for readability).
ms | Specification in ms (for readability).
pA | Specification in pA (for readability).
mV | Specification in mV (for readability).
spikes | Specification in spikes (for readability).

↑ Table of contents ↑

## SLI Interpreter control

### Startup and initialization

nestrc | Personal interpreter initialization file.
start | Interpreter start symbol.
executive | Start interactive interpreter session.
quit | Leave the SLI interpreter.
welcome | Print SLI welcome message.

### Controlling the running interpreter

cycles | Return the number of elapsed interpreter cycles.
clic | Start measuring interpreter cycles.
cloc | Return elapsed interpreter cycles since clic was called.
setguard | Limit the number of interpreter cycles.
removeguard | Removes the limit on the number of interpreter cycles.
allocations | Return the number of array reallocations.
setcallback | Install a callback object in the interpreter cycle.
clearcallback | Clear the installed callback.
parsestdin | Read and execute tokens from standard input.
pgetrusage | Get resource consumption information.
exithook | Procedure executed if the executive mode is left.
noop | No operation function.

### Interpreter messages

message | Display an information message.
verbosity | Return the current verbosity level for interpreter messages.
setverbosity | Set verbosity level for message.
endl | Line break.

### Measuring time

clock | Returns realtime.
time | Return wall clock time in s since 1.1.1970 00:00.
tic | Start measuring usertime of a command.
toc | Return usertime since tic was called.
usertime | Return clock time in ms
realtime | Returns realtime.
sleep | Pauses current process.
systemtime | Returns system time for current process.
ms2hms | Convert milliseconds to an array [h min sec].
pclocks | Returns POSIX clocks for real, user, system time.
pclockspersec | POSIX clock ticks per second.
ptimes | Returns real, user, and system time.

↑ Table of contents ↑

## Parallel computing

Rank | Return the MPI rank (MPI_Comm_rank) of the process.
SyncProcesses | Synchronize all MPI processes.
MPIProcessorName | Return an unique specifier for the compute node (MPI_Get_processor_name).
NumProcesses | Return the number of MPI processes (MPI_Comm_size).

↑ Table of contents ↑

↑ Back to the Helpdesk ↑

© 2004 The NEST Initiative