1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML
><HEAD
><TITLE
>Basic concepts</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.59"><LINK
REL="HOME"
TITLE="Gambit"
HREF="gambit.html"><LINK
REL="UP"
TITLE="The Gambit Command Language"
HREF="c524.html"><LINK
REL="PREVIOUS"
TITLE="The Gambit Command Language"
HREF="c524.html"><LINK
REL="NEXT"
TITLE="Data types"
HREF="x559.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Gambit: Software Tools for Game Theory</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="c524.html"
><<< Previous</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>The Gambit Command Language</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x559.html"
>Next >>></A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN545"
>Basic concepts</A
></H1
><P
>The design motifs for GCL come from two principal families of
programming languages. The first is traditional imperative
programming languages such as Pascal, C, and Modula-3. In particular,
the GCL's concept of types draws heavily from these languages,
although the number of predefined types in GCL is much larger due to
the specialized nature of the language. The second is more
specialized programming languages such as Mathematica, from which the
GCL's grammar is partially drawn. Users with experience using any of
these languages should find the GCL easy to learn; however, no
programming experience is necessary to begin using the language
effectively.</P
><P
>The GCL is a language designed primarily for building, solving and
doing econometric analysis of non-cooperative games. Because the GCL is a
specialized language, it has several features that are designed to
make computing as easy and flexible as possible in this kind of
environment. Some of the main features of the GCL are:
<P
></P
><UL
><LI
><P
>Specialized built-in data types with implicit typing:
The GCL has a number of specialized built-in data types to represent
various parts of games. For example for extensive form games, there
are built in data types to represent players, strategies, nodes in an
extensive form game tree, information sets, actions, outcomes,
behavior strategy profiles, and an entire extensive form game.
These data types are used internally by the GCL to organize
computation, and keep track of important features of the objects that
these data types represent.</P
><P
>Despite the large number of specialized data types, the GCL uses {\it
implicit typing}. Implicit typing means that you never have to
explicitly declare what the data type of a variable is before you use
it. Variables can thus be easily created in an interactive mode to
refer to any object that is a valid data type, and to save
intermediate steps of computations on these data structures.</P
></LI
><LI
><P
>Everything is a function:
Almost every statement in the GCL is built up from function calls.
Briefly, a function in the GCL is a procedure that takes objects of
specified data types, and uses them to construct and return an object
of a (possibly different) specified data type. The GCL provides a set
of Built-In Functions (BIFs), which are documented in the
function reference section of this manual. </P
><P
>The GCL provides functions that construct simple objects of any given
data type, and other functions that operate on objects of given data
types to modify them or create a new object that is guaranteed to be a
valid object of the given data type. A GCL program typically consists
of using output from one function as input to a second, whose output
is then used as input to the next, and so on. In this way, very
complicated objects, such as extensive form games, can be built, all
the while guaranteeing their internal consistency. In this fashion,
one can construct any valid extensive form game, and (barring bugs) it
is impossible in the GCL to construct an invalid extensive form game.</P
><P
>In addition to the built-in functions, the GCL also allows you to
construct your own functions, which have exactly the same behavior as
any built-in function (listablity, recursion, optional arguments,
and accessible via online help)</P
></LI
><LI
><P
>Listability:
Many objects of interest in game theory are {\it sets} (the set of
players, of information sets for a player, of actions for an
information set, etc.) All objects in the GCL (including lists) can
be put in lists. Further, when a GCL function (with a few exceptions
noted in the Function reference section) is called with a list for
one of its arguments, the function is run ``listably''. This means
that the function is executed for each element of the list and
generates a list (or nested list) of the corresponding dimension as
output. This makes it quite easy to generate objects of game
theoretic interest. It also makes it easy to perform certain
repetitive operations usually performed by flow control statements.</P
></LI
></UL
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="c524.html"
><<< Previous</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="gambit.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x559.html"
>Next >>></A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>The Gambit Command Language</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="c524.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Data types</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>
|