DSL file format

<< Click to Display Table of Contents >>

Navigation:  Building blocks of GeNIe > Saving and loading models in GeNIe >

DSL file format

For backward compatibility reason, we are also supporting an old format used by GeNIe in mind-1990s (we call it the DSL file format).

Here is an abbreviated BNF specification of the DSL file format:

<file> ::= <net>

<net> ::= net <id> { [<netstatement>;]* };

<netstatement> ::= <netfield> | <node>

<netfield> ::= HEADER = { [<headerstatement>;]* } |

CREATION = { [<creationstatement>;]* } |

NUMSAMPLES = <integer>

<node> ::= node <id> { [<nodestatement>;]* }

<nodestatement> ::= <nodefield>

<nodefield> ::= TYPE = <id> |

HEADER = { [<headerstatement>;]* } |

PARENTS = <identifierlist> |

DEFINITION = { [<definitionstatement>;]* }

<headerstatement> ::= ID = <id> |

NAME = <string> |

COMMENT = <string>

<creationstatement> ::= CREATOR = <string> |

CREATED = <string> |

MODIFIED = <string>

<definitionstatement> ::= NAMESTATES = <identifierlist> |

PROBABILITIES = <doublelist> |

NAMECHOICES = <identifierlist> |

RESULTINGSTATES = <identifierlist> |

UTILITIES = <doublelist> |

WEIGHTS = <doublelist>

<identifierlist> ::= ( [<id>] [,<id>]* )

<doublelist> ::= ( [<real>] [,<real>]* )

<integerlist> ::= ( [<integer>] [,<integer>]* )

<boolean> ::= TRUE | FALSE

Identifiers (<id>), strings (<string>), numbers (<real> and <integer>), and comments follow the syntax of C++. Identifiers, in particular, have to start with a letter followed by any sequence of letters, numbers, and the underscore character (_). Letters are a-z and A-Z but also all Unicode characters above codepoint 127, which allows using characters from other alphabets than the Latin alphabet. Control characters inside strings are preceded by the backslash character (\). Comments are of three types: (1) two characters // start a comment, which terminates at the and of the line on which they occur, (2) the characters /* start a non-nesting comment terminated with the characters */, and (3) the characters /# start a nesting comment terminated with the characters #/.

The content of matrices is written as a flat list of doubles (<doublelist>), listed in the order of columns, i.e., the fastest changing index is that of the current variable, then the last parent, then the one before last, etc. The first parent supplies the slowest changing index.