Parser can be run in a following ways:
When we initaite program it creates context that stores all declared params (values). A param can be a game, a player or a number. There is also mock context
param that allows us previewing all currently available params.
When we declare new param:
it is placed inside out context allowing us to perform a query on it:
We are also available to perform several queries at once:
If some of params will not have sought property defined information about it will be returned.
Context will be created when we run program and start reading either from standart input or file making all newly defined object go straight there. But if we'd like to read definitions from another file it is possible to do it in 2 ways:
LOAD identifier;
command will load all params from given file and place them in a current context, so they will still be available after the file is processed. If a param appears with same name as existing one old definition will be overriden by a new one,EXECUTE identifier;
command will create child context - it will have access to all of out current context's params as well as params defined just in it - of some param will be defined with the same name as one's in parental context, name will be just overshaded, and once file is processed old value will be availabe again.Values of a current context can be dumped into file with command STORE identifier;
.
When loading a file, make sure its name is placed inside double quotation marks:
To preview all available params call:
Identifiers that names params and their properties can be defined in a 2 ways:
_
charactes, but it cannot start with a digit,All params have defined at least 2 properties:
properties
- it list all known properties for a given param,type
- identifies type of a param.Some params will have additional ones e.g. Context will have values
that displays all params known to it.
2 of commonly used params are identifeirs and numbers:
Players are required to define games. Each player has its own name (do not mistake with name of param that contains it) and a set of strategies.
We can define it this way:
Player has some additional properties:
name
shows player's name,strategies
shows player's strategies,Once defined it can be used in games.
The easiest way to explain is to use an example:
We can see that strategic-form game can be deifined by payoffs of each of player's strategies combinations. We can group them by some choice
(p1=s1
meaning that its defined for player p1
choosing strategy s1
), or pass them by giveing all player's choices at once.
Extensive-form games are defined in a similar way:
main difference being that extensive form games form a tree and the definition represents it - as such it have to pass one choice at a time and cannot group them.
Games have following properties defined:
pure_equilibrium
- finds pure strategy Nash equilibria,mixed_equilibrium
- finds mixed strategy Nash equilibria,behavior_equilibrium
- finds behaviour strategy Nash equilibria (possibly it won't be implemented after all).examples/strategic_form_game.gtl
:
examples/extensive_form_game.gtl
:
examples/properties_querying.gtl
: