(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 8.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       157,          7]
NotebookDataLength[     16244,        593]
NotebookOptionsPosition[     12925,        475]
NotebookOutlinePosition[     13436,        495]
CellTagsIndexPosition[     13393,        492]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{

Cell[CellGroupData[{
Cell["PwM`Chap03Lists`", "Section",
 InitializationGroup->True],

Cell[TextData[{
 StyleBox["From",
  FontWeight->"Bold"],
 ": ",
 StyleBox[ButtonBox["Programming with Mathematica: An Introduction",
  BaseStyle->"Hyperlink",
  ButtonData->{
    URL["http://www.cambridge.org/wellin"], None},
  ButtonNote->"http://www.cambridge.org/wellin"],
  FontSlant->"Italic",
  FontVariations->{"Underline"->True}]
}], "Text",
 CellMargins->{{28, 10}, {7, 7}},
 FontSize->14],

Cell[CellGroupData[{

Cell["Metadata", "Subsection"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", 
   RowBox[{"Name", ":", " ", "PwM`Chap03Lists`"}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", 
   RowBox[{"Book", ":", " ", 
    RowBox[{"Programming", " ", "with", " ", 
     RowBox[{"Mathematica", ":", " ", 
      RowBox[{"An", " ", "Introduction"}]}]}]}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", 
   RowBox[{"Author", ":", " ", 
    RowBox[{"Paul", " ", "Wellin"}]}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{
   RowBox[{":", 
    RowBox[{"Summary", ":", " ", 
     RowBox[{
     "This", " ", "package", " ", "contains", " ", "the", " ", "functions", 
      " ", "defined", " ", "in", " ", "Chapter", " ", "3"}]}]}], ",", " ", 
   RowBox[{"Lists", "."}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", 
   RowBox[{"Context", ":", " ", "PwM`Chap03Lists`"}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", 
   RowBox[{"Package", " ", 
    RowBox[{"Version", ":", " ", "1.0"}]}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{
   RowBox[{":", 
    RowBox[{"Copyright", ":", " ", 
     RowBox[{"Copyright", " ", "2012"}]}]}], ",", " ", 
   RowBox[{"Cambridge", " ", "University", " ", "Press"}]}], " ", 
  "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{
   RowBox[{":", 
    RowBox[{"History", ":", " ", 
     RowBox[{
     "Version", " ", "1.0", " ", "by", " ", "Paul", " ", "Wellin"}]}]}], ",", 
   " ", 
   RowBox[{"Dec", " ", "2012"}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{
   RowBox[{":", 
    RowBox[{"Keywords", ":", " ", 
     RowBox[{"matrix", " ", "columns"}]}]}], ",", " ", "lattice", ",", " ", 
   "Ngram"}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", 
   RowBox[{"Source", ":", " ", 
    RowBox[{"Chap03Lists", ".", "nb"}]}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", 
   RowBox[{"Mathematica", " ", 
    RowBox[{"Version", ":", " ", 
     RowBox[{"8.0", ".4"}]}]}]}], " ", "*)"}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["BeginPackage", "Subsection"],

Cell[BoxData[
 RowBox[{"BeginPackage", "[", "\"\<PwM`Chap03Lists`\>\"", "]"}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["Usage messages for public functions", "Subsection"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"AddColumn", "::", "usage"}], "=", "\"\<AddColumn[\!\(\*
StyleBox[\"mat\", \"TI\"]\), \!\(\*
StyleBox[\"col\", \"TI\"]\), \!\(\*
StyleBox[\"pos\", \"TI\"]\)] inserts the column vector \!\(\*
StyleBox[\"col\", \"TI\"]\) to the matrix \!\(\*
StyleBox[\"mat\", \"TI\"]\) at position \!\(\*
StyleBox[\"pos\", \"TI\"]\).\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"Lattice", "::", "usage"}], "=", "\"\<Lattice[{{\!\(\*
StyleBox[\"xmin\", \"TI\"]\), \!\(\*
StyleBox[\"xmax\", \"TI\"]\)}, {\!\(\*
StyleBox[\"ymin\", \"TI\"]\), \!\(\*
StyleBox[\"ymax\", \"TI\"]\)}}] creates a two-dimensional rectangular lattice \
with bounds given by the integers \!\(\*
StyleBox[\"xmin\", \"TI\"]\), \!\(\*
StyleBox[\"xmax\", \"TI\"]\), etc.\>\""}], ";"}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"NGrams", "::", "usage"}], "=", "\"\<NGrams[\!\(\*
StyleBox[\"text\", \"TI\"]\), \!\(\*
StyleBox[\"n\", \"TI\"]\)] splits \!\(\*
StyleBox[\"text\", \"TI\"]\) into overlapping lists of \!\(\*
StyleBox[\"n\", \"TI\"]\) words.\>\""}], ";"}]], "Input"]
}, Closed]],

Cell["Options", "Subsection"],

Cell[CellGroupData[{

Cell["Private context", "Subsection"],

Cell[BoxData[
 RowBox[{"Begin", "[", "\"\<`Private`\>\"", "]"}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["Function definitions (public and private)", "Subsection"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"AddColumn", "[", 
    RowBox[{"mat_", ",", "col_", ",", "pos_"}], "]"}], "/;", 
   RowBox[{
    RowBox[{"Length", "[", "col", "]"}], "\[Equal]", 
    RowBox[{"Length", "[", "mat", "]"}]}]}], ":=", 
  RowBox[{"Transpose", "[", 
   RowBox[{"Insert", "[", 
    RowBox[{
     RowBox[{"Transpose", "[", "mat", "]"}], ",", "col", ",", "pos"}], "]"}], 
   "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"Lattice", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"xmin_Integer", ",", "xmax_Integer"}], "}"}], ",", 
    RowBox[{"{", 
     RowBox[{"ymin_Integer", ",", "ymax_Integer"}], "}"}]}], "]"}], ":=", 
  RowBox[{"Module", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"hlines", ",", "vlines", ",", "coords"}], "}"}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"hlines", "=", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"{", 
         RowBox[{
          RowBox[{"{", 
           RowBox[{"xmin", ",", "y"}], "}"}], ",", 
          RowBox[{"{", 
           RowBox[{"xmax", ",", "y"}], "}"}]}], "}"}], ",", 
        RowBox[{"{", 
         RowBox[{"y", ",", "ymin", ",", "ymax"}], "}"}]}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"vlines", "=", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{"{", 
         RowBox[{
          RowBox[{"{", 
           RowBox[{"x", ",", "ymin"}], "}"}], ",", 
          RowBox[{"{", 
           RowBox[{"x", ",", "ymax"}], "}"}]}], "}"}], ",", 
        RowBox[{"{", 
         RowBox[{"x", ",", "xmin", ",", "xmax"}], "}"}]}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"coords", "=", 
      RowBox[{"Flatten", "[", 
       RowBox[{
        RowBox[{"{", 
         RowBox[{"hlines", ",", "vlines"}], "}"}], ",", "1"}], "]"}]}], ";", 
     "\[IndentingNewLine]", 
     RowBox[{"Graphics", "[", 
      RowBox[{"Line", "[", "coords", "]"}], "]"}]}]}], "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"NGrams", "[", 
   RowBox[{"text_", ",", "n_"}], "]"}], ":=", 
  RowBox[{"Partition", "[", "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"StringSplit", "[", 
     RowBox[{"text", ",", 
      RowBox[{"RegularExpression", "[", "\"\<\\\\W+\>\"", "]"}]}], "]"}], ",",
     "n", ",", "1"}], "]"}]}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["End private context", "Subsection"],

Cell[BoxData[
 RowBox[{"End", "[", "]"}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["EndPackage", "Subsection"],

Cell[BoxData[
 RowBox[{"EndPackage", "[", "]"}]], "Input"]
}, Closed]]
}, Open  ]],

Cell[CellGroupData[{

Cell["Examples", "Section"],

Cell[CellGroupData[{

Cell["Load package", "Subsection"],

Cell["Quit current session:", "Text"],

Cell[BoxData["Quit"], "Input"],

Cell[TextData[{
 "Load package (do ",
 StyleBox["not",
  FontSlant->"Italic"],
 " say \[OpenCurlyDoubleQuote]Yes\[CloseCurlyDoubleQuote] to evaluate init \
cells dialog)."
}], "Text"],

Cell[BoxData[
 RowBox[{"<<", "PWM`Chap03Lists`"}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["Test usage messages", "Subsection"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"?", "AddColumn"}]], "Input"],

Cell[BoxData[
 StyleBox["\<\"AddColumn[\\!\\(\\*\\nStyleBox[\\\"mat\\\", \\\"TI\\\"]\\), \
\\!\\(\\*\\nStyleBox[\\\"col\\\", \\\"TI\\\"]\\), \
\\!\\(\\*\\nStyleBox[\\\"pos\\\", \\\"TI\\\"]\\)] inserts the column vector \
\\!\\(\\*\\nStyleBox[\\\"col\\\", \\\"TI\\\"]\\) to the matrix \
\\!\\(\\*\\nStyleBox[\\\"mat\\\", \\\"TI\\\"]\\) at position \
\\!\\(\\*\\nStyleBox[\\\"pos\\\", \\\"TI\\\"]\\).\"\>", "MSG"]], "Print", \
"PrintUsage"]
}, Closed]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"?", "Lattice"}]], "Input"],

Cell[BoxData[
 StyleBox["\<\"Lattice[{{\!\(\*\\nStyleBox[\\\"xmin\\\", \\\"TI\\\"]\), \
\!\(\*\\nStyleBox[\\\"xmax\\\", \\\"TI\\\"]\)}, {\!\(\*\\nStyleBox[\\\"ymin\\\
\", \\\"TI\\\"]\), \!\(\*\\nStyleBox[\\\"ymax\\\", \\\"TI\\\"]\)}}] creates a \
two-dimensional rectangular lattice with bounds given by the integers \
\!\(\*\\nStyleBox[\\\"xmin\\\", \\\"TI\\\"]\), \
\!\(\*\\nStyleBox[\\\"xmax\\\", \\\"TI\\\"]\), etc.\"\>", "MSG"]], "Print", \
"PrintUsage"]
}, Closed]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"?", "NGrams"}]], "Input"],

Cell[BoxData[
 StyleBox["\<\"NGrams[\!\(\*\\nStyleBox[\\\"text\\\", \\\"TI\\\"]\), \
\!\(\*\\nStyleBox[\\\"n\\\", \\\"TI\\\"]\)] splits \!\(\*\\nStyleBox[\\\"text\
\\\", \\\"TI\\\"]\) into overlapping lists of \!\(\*\\nStyleBox[\\\"n\\\", \\\
\"TI\\\"]\) words.\"\>", "MSG"]], "Print", "PrintUsage"]
}, Closed]]
}, Closed]],

Cell[CellGroupData[{

Cell["Exercise the functions and options", "Subsection"],

Cell[CellGroupData[{

Cell["AddColumn", "Subsubsection"],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"mat", "=", 
   RowBox[{"RandomInteger", "[", 
    RowBox[{"9", ",", 
     RowBox[{"{", 
      RowBox[{"4", ",", "4"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"MatrixForm", "[", "mat", "]"}]}], "Input"],

Cell[BoxData[
 TagBox[
  RowBox[{"(", "\[NoBreak]", GridBox[{
     {"2", "1", "5", "6"},
     {"4", "7", "0", "8"},
     {"0", "2", "6", "5"},
     {"7", "9", "7", "9"}
    },
    GridBoxAlignment->{
     "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, 
      "RowsIndexed" -> {}},
    GridBoxSpacings->{"Columns" -> {
        Offset[0.27999999999999997`], {
         Offset[0.7]}, 
        Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
        Offset[0.2], {
         Offset[0.4]}, 
        Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}],
  Function[BoxForm`e$, 
   MatrixForm[BoxForm`e$]]]], "Output"]
}, Closed]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"AddColumn", "[", 
   RowBox[{"mat", ",", 
    RowBox[{"{", 
     RowBox[{"a", ",", "b", ",", "c", ",", "d"}], "}"}], ",", "3"}], "]"}], "//",
   "MatrixForm"}]], "Input"],

Cell[BoxData[
 TagBox[
  RowBox[{"(", "\[NoBreak]", GridBox[{
     {"2", "1", "a", "5", "6"},
     {"4", "7", "b", "0", "8"},
     {"0", "2", "c", "6", "5"},
     {"7", "9", "d", "7", "9"}
    },
    GridBoxAlignment->{
     "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, 
      "RowsIndexed" -> {}},
    GridBoxSpacings->{"Columns" -> {
        Offset[0.27999999999999997`], {
         Offset[0.7]}, 
        Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
        Offset[0.2], {
         Offset[0.4]}, 
        Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}],
  Function[BoxForm`e$, 
   MatrixForm[BoxForm`e$]]]], "Output"]
}, Closed]]
}, Closed]],

Cell[CellGroupData[{

Cell["Lattice", "Subsubsection"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Lattice", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"-", "2"}], ",", "2"}], "}"}]}], "]"}]], "Input"],

Cell[BoxData[
 GraphicsBox[
  LineBox[{{{-3, -2}, {3, -2}}, {{-3, -1}, {3, -1}}, {{-3, 0}, {3, 0}}, {{-3, 
   1}, {3, 1}}, {{-3, 2}, {3, 2}}, {{-3, -2}, {-3, 2}}, {{-2, -2}, {-2, 
   2}}, {{-1, -2}, {-1, 2}}, {{0, -2}, {0, 2}}, {{1, -2}, {1, 2}}, {{2, -2}, {
   2, 2}}, {{3, -2}, {3, 2}}}],
  ImageSize->{220.7999999999999, Automatic}]], "Output"]
}, Closed]]
}, Closed]],

Cell[CellGroupData[{

Cell["NGrams", "Subsubsection"],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"sentence", "=", "\"\<Colorless green ideas sleep furiously.\>\""}],
   ";"}], "\[IndentingNewLine]", 
 RowBox[{"NGrams", "[", 
  RowBox[{"sentence", ",", "3"}], "]"}]}], "Input"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"\<\"Colorless\"\>", ",", "\<\"green\"\>", ",", "\<\"ideas\"\>"}],
     "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"\<\"green\"\>", ",", "\<\"ideas\"\>", ",", "\<\"sleep\"\>"}], 
    "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"\<\"ideas\"\>", ",", "\<\"sleep\"\>", ",", "\<\"furiously\"\>"}],
     "}"}]}], "}"}]], "Output"]
}, Closed]]
}, Closed]]
}, Open  ]]
}, Open  ]]
},
AutoGeneratedPackage->Automatic,
WindowSize->{844, 860},
WindowMargins->{{472, Automatic}, {Automatic, 15}},
ShowSelection->True,
Magnification:>FEPrivate`If[
  FEPrivate`Equal[FEPrivate`$VersionNumber, 6.], 1.25, 1.25 Inherited],
FrontEndVersion->"8.0 for Mac OS X x86 (32-bit, 64-bit Kernel) (October 5, \
2011)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[579, 22, 63, 1, 83, "Section",
 InitializationGroup->True],
Cell[645, 25, 398, 13, 34, "Text"],
Cell[CellGroupData[{
Cell[1068, 42, 30, 0, 42, "Subsection"],
Cell[1101, 44, 126, 3, 33, "Input"],
Cell[1230, 49, 239, 6, 33, "Input"],
Cell[1472, 57, 146, 4, 33, "Input"],
Cell[1621, 63, 315, 8, 53, "Input"],
Cell[1939, 73, 129, 3, 33, "Input"],
Cell[2071, 78, 147, 4, 33, "Input"],
Cell[2221, 84, 241, 7, 33, "Input"],
Cell[2465, 93, 256, 8, 33, "Input"],
Cell[2724, 103, 211, 6, 33, "Input"],
Cell[2938, 111, 149, 4, 33, "Input"],
Cell[3090, 117, 173, 5, 33, "Input"]
}, Closed]],
Cell[CellGroupData[{
Cell[3300, 127, 34, 0, 31, "Subsection"],
Cell[3337, 129, 88, 1, 51, "Input"]
}, Closed]],
Cell[CellGroupData[{
Cell[3462, 135, 57, 0, 31, "Subsection"],
Cell[3522, 137, 386, 9, 72, "Input"],
Cell[3911, 148, 431, 10, 72, "Input"],
Cell[4345, 160, 294, 7, 33, "Input"]
}, Closed]],
Cell[4654, 170, 29, 0, 31, "Subsection"],
Cell[CellGroupData[{
Cell[4708, 174, 37, 0, 31, "Subsection"],
Cell[4748, 176, 74, 1, 51, "Input"]
}, Closed]],
Cell[CellGroupData[{
Cell[4859, 182, 63, 0, 31, "Subsection"],
Cell[4925, 184, 414, 12, 82, "Input"],
Cell[5342, 198, 1513, 45, 201, "Input"],
Cell[6858, 245, 340, 9, 82, "Input"]
}, Closed]],
Cell[CellGroupData[{
Cell[7235, 259, 41, 0, 31, "Subsection"],
Cell[7279, 261, 51, 1, 51, "Input"]
}, Closed]],
Cell[CellGroupData[{
Cell[7367, 267, 32, 0, 31, "Subsection"],
Cell[7402, 269, 58, 1, 51, "Input"]
}, Closed]]
}, Open  ]],
Cell[CellGroupData[{
Cell[7509, 276, 27, 0, 83, "Section"],
Cell[CellGroupData[{
Cell[7561, 280, 34, 0, 42, "Subsection"],
Cell[7598, 282, 37, 0, 50, "Text"],
Cell[7638, 284, 30, 0, 51, "Input"],
Cell[7671, 286, 183, 6, 50, "Text"],
Cell[7857, 294, 60, 1, 51, "Input"]
}, Closed]],
Cell[CellGroupData[{
Cell[7954, 300, 41, 0, 31, "Subsection"],
Cell[CellGroupData[{
Cell[8020, 304, 52, 1, 51, "Input"],
Cell[8075, 307, 438, 7, 76, "Print"]
}, Closed]],
Cell[CellGroupData[{
Cell[8550, 319, 50, 1, 51, "Input"],
Cell[8603, 322, 459, 7, 108, "Print"]
}, Closed]],
Cell[CellGroupData[{
Cell[9099, 334, 49, 1, 51, "Input"],
Cell[9151, 337, 299, 4, 76, "Print"]
}, Closed]]
}, Closed]],
Cell[CellGroupData[{
Cell[9499, 347, 56, 0, 31, "Subsection"],
Cell[CellGroupData[{
Cell[9580, 351, 34, 0, 30, "Subsubsection"],
Cell[CellGroupData[{
Cell[9639, 355, 256, 7, 82, "Input"],
Cell[9898, 364, 659, 19, 141, "Output"]
}, Closed]],
Cell[CellGroupData[{
Cell[10594, 388, 205, 6, 51, "Input"],
Cell[10802, 396, 679, 19, 141, "Output"]
}, Closed]]
}, Closed]],
Cell[CellGroupData[{
Cell[11530, 421, 32, 0, 21, "Subsubsection"],
Cell[CellGroupData[{
Cell[11587, 425, 223, 8, 51, "Input"],
Cell[11813, 435, 347, 6, 321, "Output"]
}, Closed]]
}, Closed]],
Cell[CellGroupData[{
Cell[12209, 447, 31, 0, 21, "Subsubsection"],
Cell[CellGroupData[{
Cell[12265, 451, 214, 5, 82, "Input"],
Cell[12482, 458, 391, 11, 51, "Output"]
}, Closed]]
}, Closed]]
}, Open  ]]
}, Open  ]]
}
]
*)

(* End of internal cache information *)
