Friday, August 21, 2015

Perkun. Values. Keywords.

The values section of the Perkun (http://sourceforge.net/projects/perkun/) code contains the keyword "value" followed by the valid identifiers.

values
{
        value false, true;
        value move, do_nothing;
}

variables {}
payoff {}
model {}

The above code declares four new values: false, true, move and do_nothing. You might ask what a valid identifier is. It is any sequence of letters/digits beginning with a letter that is not a keyword. Below is the list of all Perkun keywords (version 0.0.7):
  • value
  • variable
  • hidden
  • input
  • output
  • visible
  • state
  • model
  • cout
  • variables
  • eol
  • values
  • actions
  • states
  • beliefs
  • payoff
  • set
  • loop
  • generator
  • xml
  • impossible
  • illegal
  • prolog
  • haskell 
The values are used to denote the possible values of the variables. The Perkun variables is a complex topic and will be discussed later. You can print out all the values with the command "cout << values << eol;". For example:

values
{
        value false, true;
        value move, do_nothing;
}

variables {}
payoff {}
model {}
cout << values << eol;
 
The above Perkun code will print out:
 # values
false
true
move
do_nothing



There are many other commands apart from "cout << values << eol;". They can all be placed directly after the model section.

One-line comments begin in Perkun with a hashtag "#".  

No comments:

Post a Comment