(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 6.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 91565, 2668] NotebookOptionsPosition[ 79145, 2263] NotebookOutlinePosition[ 80143, 2298] CellTagsIndexPosition[ 79931, 2290] WindowFrame->Normal ContainsDynamic->True *) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[{ "Investigating inter-context and inter-package symbol dependencies and \ symbols shadowing with\n \t", StyleBox["PackageSymbolsDependencies`", FontWeight->"Bold", FontSlant->"Italic"], " " }], "Subtitle", CellChangeTimes->{{3.441615231458573*^9, 3.4416152651069565`*^9}, { 3.4416153789406414`*^9, 3.441615402594654*^9}, {3.441900027974229*^9, 3.4419000955213566`*^9}, {3.4419002706932416`*^9, 3.441900272986539*^9}}], Cell[CellGroupData[{ Cell["\<\ Author: \t\t\tLeonid B. Shifrin \t\t\t \t\t\tleonid@mathprogramming-intro.org, \t\t\tshifrinl@hotmail.com\ \>", "Subsection", CellChangeTimes->{{3.4416153043333616`*^9, 3.441615358240877*^9}, { 3.4416175573931026`*^9, 3.441617572254472*^9}}, FontWeight->"Plain"], Cell["Package version 1.0 - January 2009", "Subsubsection", CellChangeTimes->{{3.441703718150744*^9, 3.441703747372763*^9}}, FontWeight->"Plain"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " version 5.1+ (untested for earlier versions. Option - checking part \ v.5.0+) " }], "Subsubsection", CellChangeTimes->{{3.4417037513885374`*^9, 3.4417037599107924`*^9}, { 3.441703818074427*^9, 3.4417038219600143`*^9}, 3.4418064057502337`*^9, { 3.4419001043340287`*^9, 3.4419001324043922`*^9}}, FontWeight->"Plain"] }, Open ]], Cell[CellGroupData[{ Cell["Introduction", "Section", CellChangeTimes->{{3.4419001464946527`*^9, 3.441900150310139*^9}}, FontWeight->"Plain"], Cell["\<\ This package is intended to be an inspection/debugging tool for programs \ involving a (possibly large) number of (possibly inter - related) packages. It allows to track which symbols of a \ given package/context depend on symbols in other packages/contexts (in the sense that the symbol' s global \ definitions/properties reference other context' s symbols). In addition to debugging purposes, the package can be used to monitor \ modifications introduced by some package to global properties/definitions of symbols in other contexts/packages, \ including possible overloading of System symbols. Finally, one can use it to monitor shadowing and test symbols for being \ shadowed.\ \>", "Text", CellChangeTimes->{{3.4419001554575405`*^9, 3.441900236484051*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ "Illustration/tests for the ", StyleBox["PackageSymbolsDependencies`", FontWeight->"Bold", FontSlant->"Italic"], " package" }], "Section", CellChangeTimes->{{3.4404418003726096`*^9, 3.440441838637632*^9}}, FontWeight->"Plain"], Cell[CellGroupData[{ Cell["Preliminaries", "Subsection", CellChangeTimes->{{3.440354639612563*^9, 3.440354639933024*^9}, { 3.4404401475159187`*^9, 3.4404401524029455`*^9}}, FontWeight->"Plain"], Cell["\<\ Unless you have already done so, you have to let Mathematica know where to \ look for the package. Assuming that you place it in a directory \ \"C:\\\\MyDirectory\" (use your specific directory instead), this is done \ most easily by executing: AppendTo[$Path, \"C:\\\\MyDirectory\"]. This is a \ particular case with my machine :\ \>", "Text", CellChangeTimes->{{3.4404401775090466`*^9, 3.4404403218666224`*^9}, { 3.4404418893505535`*^9, 3.4404418908527136`*^9}, {3.4419002881683693`*^9, 3.441900291813611*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"AppendTo", "[", RowBox[{ "$Path", ",", "\"\\""}], "]"}], ";"}]], "Input", CellChangeTimes->{{3.4306365337101617`*^9, 3.4306365531481123`*^9}, { 3.4418683792355776`*^9, 3.441868380687666*^9}}, FontWeight->"Plain"], Cell["Next, we load the package :", "Text", CellChangeTimes->{{3.4404403355663214`*^9, 3.4404403420556526`*^9}}], Cell[BoxData[ RowBox[{"Needs", "[", "\"\\"", "]"}]], "Input",\ CellChangeTimes->{{3.440440343788144*^9, 3.440440356856936*^9}, { 3.440946212387064*^9, 3.440946227578909*^9}}], Cell["Here are the symbols available to the user :", "Text", CellChangeTimes->{{3.4404403625851727`*^9, 3.440440385067501*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"?", "PackageSymbolsDependencies`*"}]], "Input", CellChangeTimes->{{3.4403478803532257`*^9, 3.440347885841117*^9}}], Cell[BoxData[ DynamicModuleBox[{Typeset`open$$ = True}, PaneSelectorBox[{False-> RowBox[{ OpenerBox[Dynamic[Typeset`open$$], ImageSize->Small], StyleBox["PackageSymbolsDependencies`", "InfoHeading"]}], True->GridBox[{ { RowBox[{ OpenerBox[Dynamic[Typeset`open$$], ImageSize->Small], StyleBox["PackageSymbolsDependencies`", "InfoHeading"]}]}, {GridBox[{ { ButtonBox["AllContexts", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934110-4700288", "PackageSymbolsDependencies`AllContexts"}, ButtonNote->"PackageSymbolsDependencies`"], ButtonBox["globalProps", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934110-4700288", "PackageSymbolsDependencies`globalProps"}, ButtonNote->"PackageSymbolsDependencies`"]}, { ButtonBox["CheckContexts", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934110-4700288", "PackageSymbolsDependencies`CheckContexts"}, ButtonNote->"PackageSymbolsDependencies`"], ButtonBox["IncludeOnlyContexts", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934110-4700288", "PackageSymbolsDependencies`IncludeOnlyContexts"}, ButtonNote->"PackageSymbolsDependencies`"]}, { ButtonBox["ContextsOnly", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934110-4700288", "PackageSymbolsDependencies`ContextsOnly"}, ButtonNote->"PackageSymbolsDependencies`"], ButtonBox["PackageSymbolsDependenciesOptionChecks", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934110-4700288", "PackageSymbolsDependencies`\ PackageSymbolsDependenciesOptionChecks"}, ButtonNote->"PackageSymbolsDependencies`"]}, { ButtonBox["DependencyCheck", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934110-4700288", "PackageSymbolsDependencies`DependencyCheck"}, ButtonNote->"PackageSymbolsDependencies`"], ButtonBox["PropertiesToCheck", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934110-4700288", "PackageSymbolsDependencies`PropertiesToCheck"}, ButtonNote->"PackageSymbolsDependencies`"]}, { ButtonBox["DependentSymbols", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934110-4700288", "PackageSymbolsDependencies`DependentSymbols"}, ButtonNote->"PackageSymbolsDependencies`"], ButtonBox["SearchedContexts", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934110-4700288", "PackageSymbolsDependencies`SearchedContexts"}, ButtonNote->"PackageSymbolsDependencies`"]}, { ButtonBox["DependentSymbolsExistQ", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934110-4700288", "PackageSymbolsDependencies`DependentSymbolsExistQ"}, ButtonNote->"PackageSymbolsDependencies`"], ButtonBox["ShadowedQ", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934110-4700288", "PackageSymbolsDependencies`ShadowedQ"}, ButtonNote->"PackageSymbolsDependencies`"]}, { ButtonBox["DependentSymbolsInDefinitions", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934110-4700288", "PackageSymbolsDependencies`DependentSymbolsInDefinitions"}, ButtonNote->"PackageSymbolsDependencies`"], ButtonBox["SymbolsContexts", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934110-4700288", "PackageSymbolsDependencies`SymbolsContexts"}, ButtonNote->"PackageSymbolsDependencies`"]}, { ButtonBox["ExcludeContexts", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934110-4700288", "PackageSymbolsDependencies`ExcludeContexts"}, ButtonNote->"PackageSymbolsDependencies`"], ButtonBox["SymbolsOnly", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934110-4700288", "PackageSymbolsDependencies`SymbolsOnly"}, ButtonNote->"PackageSymbolsDependencies`"]}, { ButtonBox["ExcludeSystem", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934110-4700288", "PackageSymbolsDependencies`ExcludeSystem"}, ButtonNote->"PackageSymbolsDependencies`"], ButtonBox["SymbolsToCheck", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934110-4700288", "PackageSymbolsDependencies`SymbolsToCheck"}, ButtonNote->"PackageSymbolsDependencies`"]} }, DefaultBaseStyle->"InfoGrid", GridBoxItemSize->{"Columns" -> {{ Scaled[0.475]}}}]} }, GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}]}, Dynamic[Typeset`open$$], ImageSize->Automatic]]], "Print", "InfoCell", CellChangeTimes->{3.4419629105398736`*^9}] }, Open ]], Cell[BoxData["\[IndentingNewLine]"], "Input", CellChangeTimes->{3.4407544688070755`*^9}], Cell["The following names refer to functions :", "Text", CellChangeTimes->{{3.4404403950218143`*^9, 3.4404404122766256`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"{", RowBox[{ "AllContexts", ",", "DependentSymbols", ",", "DependentSymbolsExistQ", ",", "DependentSymbolsInDefinitions", ",", "SearchedContexts", ",", "ShadowedQ", ",", "SymbolsContexts"}], "}"}]], "Input", CellChangeTimes->{{3.440440413488368*^9, 3.4404405018053617`*^9}, 3.441871485862688*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{ "AllContexts", ",", "DependentSymbols", ",", "DependentSymbolsExistQ", ",", "DependentSymbolsInDefinitions", ",", "SearchedContexts", ",", "ShadowedQ", ",", "SymbolsContexts"}], "}"}]], "Output", CellChangeTimes->{3.44190179850012*^9, 3.4419629509780207`*^9}] }, Open ]], Cell["\<\ The other names refer to options. You can get brief description of \ functionality of each symbol by using ? (Information):\ \>", "Text", CellChangeTimes->{{3.440440503958458*^9, 3.440440511309027*^9}, { 3.4404405649661827`*^9, 3.440440601658944*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"?", "DependentSymbolsInDefinitions"}]], "Input", CellChangeTimes->{{3.440440603181133*^9, 3.4404406189938707`*^9}}], Cell[BoxData[ StyleBox["\<\"DependentSymbolsInDefinitions[property_Symbol,context_String,\\\ nsymbols:{___String}] produces a list of sublists containing dependent \ symbols together with their contexts. The symbol is dependent wrt the \ property if the code for property[symbol] contains symbols in the \ context \\n\"\>", "MSG"]], "Print", "PrintUsage", CellChangeTimes->{3.4419629531010733`*^9}, CellTags->"Info3441934152-3443651"] }, Open ]], Cell["\<\ This shows what is a current list of contexts that are searched by < \ DependentSymbols >, < DependentSymbolsExistQ > when the option \ DependencyCheck is set to Normal\ \>", "Text", CellChangeTimes->{{3.440356004475139*^9, 3.440356068937832*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"SearchedContexts", "[", "]"}], "//", RowBox[{ RowBox[{"Short", "[", RowBox[{"#", ",", "7"}], "]"}], "&"}]}]], "Input", CellChangeTimes->{{3.440348867392518*^9, 3.4403488674926624`*^9}, { 3.440356092752075*^9, 3.4403561021355677`*^9}, 3.4418714871345167`*^9}], Cell[BoxData[ TagBox[ RowBox[{"{", RowBox[{"\<\"CheckOptions`\"\>", ",", "\<\"CheckOptions`Private`\"\>", ",", "\<\"Global`\"\>", ",", "\<\"Global`Private`\"\>", ",", "\<\"PackageOptionChecks`\"\>", ",", "\<\"PackageOptionChecks`Private`\"\>", ",", "\<\"PackageSymbolsDependencies`\"\>", ",", "\<\"PackageSymbolsDependencies`Private`\"\>", ",", "\<\"System`\"\>"}], "}"}], Short[#, 7]& ]], "Output", CellChangeTimes->{3.4419629551239824`*^9}] }, Open ]], Cell["\<\ Despite the name of the function, the \"System`\" context is included by \ default. One can use ExcludeSystem -> True option to exclude it :\ \>", "Text", CellChangeTimes->{{3.4404407321866336`*^9, 3.4404407949268494`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"SearchedContexts", "[", RowBox[{"ExcludeSystem", "\[Rule]", " ", "True"}], "]"}], "//", RowBox[{ RowBox[{"Short", "[", RowBox[{"#", ",", "7"}], "]"}], "&"}]}]], "Input", CellChangeTimes->{{3.4404408005248995`*^9, 3.4404408080457134`*^9}, 3.441871487975726*^9}], Cell[BoxData[ TagBox[ RowBox[{"{", RowBox[{"\<\"CheckOptions`\"\>", ",", "\<\"CheckOptions`Private`\"\>", ",", "\<\"Global`\"\>", ",", "\<\"Global`Private`\"\>", ",", "\<\"PackageOptionChecks`\"\>", ",", "\<\"PackageOptionChecks`Private`\"\>", ",", "\<\"PackageSymbolsDependencies`\"\>", ",", "\<\"PackageSymbolsDependencies`Private`\"\>"}], "}"}], Short[#, 7]& ]], "Output", CellChangeTimes->{3.4419629566862288`*^9}] }, Open ]], Cell["\<\ We can enforce checking of only specific contexts from the list that we \ provide :\ \>", "Text", CellChangeTimes->{{3.4404409719113407`*^9, 3.440440999521042*^9}, { 3.4404410547704864`*^9, 3.4404410560022573`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"SearchedContexts", "[", RowBox[{"IncludeOnlyContexts", "\[Rule]", " ", RowBox[{"{", "\"\\"", "}"}]}], "]"}], "//", RowBox[{ RowBox[{"Short", "[", RowBox[{"#", ",", "7"}], "]"}], "&"}]}]], "Input", CellChangeTimes->{{3.440441011067645*^9, 3.4404410359334*^9}, 3.441871488746835*^9}], Cell[BoxData[ TagBox[ RowBox[{"{", "\<\"Global`\"\>", "}"}], Short[#, 7]& ]], "Output", CellChangeTimes->{3.4419629589594975`*^9}] }, Open ]], Cell["\<\ The role of < SearchedContexts > function is to give the user a hint \ regarding which contexts are searched by functions such as < DependentSymbols \ > (which accept the same options plus some others).\ \>", "Text", CellChangeTimes->{{3.4404408758932734`*^9, 3.4404409647009726`*^9}, 3.4418714897482753`*^9}] }, Closed]], Cell[CellGroupData[{ Cell["A digression: the option - checking functionality", "Subsection", CellChangeTimes->{{3.441039986221795*^9, 3.4410400005724306`*^9}, { 3.4410477622631936`*^9, 3.4410477631845183`*^9}}, FontWeight->"Plain"], Cell["\<\ In case if the package PackageOptionChecks` is available at the moment when \ PackageSymbolsDependencies` is loaded, the functionality of the former is \ used by the latter to further protect functions from wrong inputs, \ particularly from invalid or inappropriate options passed to them. \ \>", "Text", CellChangeTimes->{{3.4410400036067934`*^9, 3.441040200620085*^9}, { 3.4410402417692547`*^9, 3.4410402503115377`*^9}, {3.441048368845416*^9, 3.441048385459306*^9}}], Cell["\<\ To check whether this functionality is available, one can query the system \ about the names in the package' s context :\ \>", "Text", CellChangeTimes->{{3.4410402520640574`*^9, 3.4410402888870063`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"?", "PackageOptionChecks`*"}]], "Input", CellChangeTimes->{{3.441035177377016*^9, 3.441035179670314*^9}, { 3.441035258173195*^9, 3.4410352682276525`*^9}}], Cell[BoxData[ DynamicModuleBox[{Typeset`open$$ = True}, PaneSelectorBox[{False-> RowBox[{ OpenerBox[Dynamic[Typeset`open$$], ImageSize->Small], StyleBox["PackageOptionChecks`", "InfoHeading"]}], True->GridBox[{ { RowBox[{ OpenerBox[Dynamic[Typeset`open$$], ImageSize->Small], StyleBox["PackageOptionChecks`", "InfoHeading"]}]}, {GridBox[{ { ButtonBox["ClearOptionsInfo", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934160-8992473", "PackageOptionChecks`ClearOptionsInfo"}, ButtonNote->"PackageOptionChecks`"], ButtonBox["PackageOptionChecksAvailableQ", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934160-8992473", "PackageOptionChecks`PackageOptionChecksAvailableQ"}, ButtonNote->"PackageOptionChecks`"]}, { ButtonBox["GetOptionsInfo", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934160-8992473", "PackageOptionChecks`GetOptionsInfo"}, ButtonNote->"PackageOptionChecks`"], ButtonBox["ResetOptionsInfo", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934160-8992473", "PackageOptionChecks`ResetOptionsInfo"}, ButtonNote->"PackageOptionChecks`"]}, { ButtonBox["OptionCheckIsOn", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934160-8992473", "PackageOptionChecks`OptionCheckIsOn"}, ButtonNote->"PackageOptionChecks`"], ButtonBox["SetOptionsInfo", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934160-8992473", "PackageOptionChecks`SetOptionsInfo"}, ButtonNote->"PackageOptionChecks`"]}, { ButtonBox["OptionCheckOff", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934160-8992473", "PackageOptionChecks`OptionCheckOff"}, ButtonNote->"PackageOptionChecks`"], ButtonBox["TurnOptionChecksOff", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934160-8992473", "PackageOptionChecks`TurnOptionChecksOff"}, ButtonNote->"PackageOptionChecks`"]}, { ButtonBox["OptionCheckOn", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934160-8992473", "PackageOptionChecks`OptionCheckOn"}, ButtonNote->"PackageOptionChecks`"], ButtonBox["TurnOptionChecksOn", BaseStyle->"InformationLink", ButtonData:>{ "Info3441934160-8992473", "PackageOptionChecks`TurnOptionChecksOn"}, ButtonNote->"PackageOptionChecks`"]} }, DefaultBaseStyle->"InfoGrid", GridBoxItemSize->{"Columns" -> {{ Scaled[0.475]}}}]} }, GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}]}, Dynamic[Typeset`open$$], ImageSize->Automatic]]], "Print", "InfoCell", CellChangeTimes->{3.441962960822176*^9}] }, Open ]], Cell["\<\ The rest of this subsection assumes that the package has been loaded \ successfully and its functions are available.\ \>", "Text", CellChangeTimes->{{3.441040294465027*^9, 3.4410403556329823`*^9}, 3.4419014735628834`*^9}], Cell["\<\ By default, the options-taking functions of are \ protected (in the sense described above). Here, for instance, we try to pass \ an option with an inappropriate rhs to one of the functions : \ \>", "Text", CellChangeTimes->{{3.4410400036067934`*^9, 3.441040200620085*^9}, { 3.4410402417692547`*^9, 3.441040244713488*^9}, {3.441040363574402*^9, 3.4410403984545565`*^9}, {3.4410484102449455`*^9, 3.441048432837432*^9}}], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"Clear", "[", "a", "]"}], ";"}], "\[IndentingNewLine]", RowBox[{"SearchedContexts", "[", RowBox[{"ExcludeSystem", "\[Rule]", "a"}], "]"}]}], "Input", CellChangeTimes->{{3.4404990143847537`*^9, 3.4404990161472883`*^9}, { 3.440951133623454*^9, 3.4409511413345423`*^9}, {3.441040207109416*^9, 3.4410402106745424`*^9}, 3.4418714904993553`*^9}], Cell[BoxData[ RowBox[{ RowBox[{"SearchedContexts", "::", "\<\"badopt\"\>"}], RowBox[{ ":", " "}], "\<\"The option \\!\\(ExcludeSystem \[Rule] a\\) is invalid. \ \\n\\t\\tThe pattern for the option's rhs to match is \\!\\(True | False\\) \ \"\>"}]], "Message", CellChangeTimes->{3.441962963395877*^9}], Cell[BoxData["$Failed"], "Output", CellChangeTimes->{3.441962963395877*^9}] }, Open ]], Cell["\<\ We may turn the protection off for all option-taking functions in the package \ :\ \>", "Text", CellChangeTimes->{{3.4410404030812097`*^9, 3.441040425072832*^9}, { 3.4410474269109807`*^9, 3.441047430245776*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"TurnOptionChecksOff", "[", "\"\\"", "]"}]], "Input", CellChangeTimes->{{3.441028772987957*^9, 3.441028803932453*^9}, { 3.4410288379914274`*^9, 3.441028845392069*^9}, 3.441032523280613*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{ "DependentSymbols", ",", "DependentSymbolsExistQ", ",", "SearchedContexts", ",", "SymbolsContexts"}], "}"}]], "Output", CellChangeTimes->{3.441962965969578*^9}] }, Open ]], Cell["\<\ Now the functions attempt to do the work even when they are given invalid \ option settings (but not necessarily succeed). This case seems ok :\ \>", "Text", CellChangeTimes->{{3.441039683656728*^9, 3.4410397264082017`*^9}, { 3.4410404533534975`*^9, 3.4410405081322656`*^9}, 3.4419014851795874`*^9}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"SearchedContexts", "[", RowBox[{"ExcludeSystem", "\[Rule]", "a"}], "]"}]], "Input", CellChangeTimes->{{3.4410325331648254`*^9, 3.4410325342563953`*^9}, 3.441871495847045*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{"\<\"CheckOptions`\"\>", ",", "\<\"CheckOptions`Private`\"\>", ",", "\<\"Global`\"\>", ",", "\<\"Global`Private`\"\>", ",", "\<\"PackageOptionChecks`\"\>", ",", "\<\"PackageOptionChecks`Private`\"\>", ",", "\<\"PackageSymbolsDependencies`\"\>", ",", "\<\"PackageSymbolsDependencies`Private`\"\>", ",", "\<\"System`\"\>"}], "}"}]], "Output", CellChangeTimes->{3.4419629672113633`*^9}] }, Open ]], Cell["\<\ This is not so innocent (list of strings is expected as the rhs of \ ExcludeContexts)\ \>", "Text", CellChangeTimes->{{3.4410397973401966`*^9, 3.441039844798438*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"SearchedContexts", "[", RowBox[{ RowBox[{"ExcludeSystem", "\[Rule]", "a"}], ",", RowBox[{"ExcludeContexts", " ", "\[Rule]", "b"}]}], "]"}]], "Input", CellChangeTimes->{{3.4410397769608927`*^9, 3.441039782629043*^9}, 3.4418714966381826`*^9}], Cell[BoxData[ RowBox[{ RowBox[{"Complement", "::", "\<\"normal\"\>"}], RowBox[{ ":", " "}], "\<\"Nonatomic expression expected at position \\!\\(2\\) in \ \\!\\(Complement[\\(\\(\\(\\({\\\"CheckOptions`\\\", \\\"PackageOptionChecks`\ \\\", \\(\\(\[LeftSkeleton] 5 \[RightSkeleton]\\)\\), \\\"Global`\\\"}\\)\\), \ b\\)\\)]\\). \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \ ButtonStyle->\\\"Link\\\", ButtonFrame->None, \ ButtonData:>\\\"paclet:ref/message/General/normal\\\", ButtonNote -> \ \\\"Complement::normal\\\"]\\)\"\>"}]], "Message", CellChangeTimes->{3.4419629683730335`*^9}], Cell[BoxData[ RowBox[{ RowBox[{"Join", "::", "\<\"heads\"\>"}], RowBox[{ ":", " "}], "\<\"Heads \\!\\(Complement\\) and \\!\\(List\\) at positions \ \\!\\(1\\) and \\!\\(2\\) are expected to be the same. \ \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \ ButtonFrame->None, ButtonData:>\\\"paclet:ref/message/General/heads\\\", \ ButtonNote -> \\\"Join::heads\\\"]\\)\"\>"}]], "Message", CellChangeTimes->{3.441962968703509*^9}], Cell[BoxData[ RowBox[{ RowBox[{"Join", "::", "\<\"heads\"\>"}], RowBox[{ ":", " "}], "\<\"Heads \\!\\(Complement\\) and \\!\\(List\\) at positions \ \\!\\(1\\) and \\!\\(2\\) are expected to be the same. \ \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \ ButtonFrame->None, ButtonData:>\\\"paclet:ref/message/General/heads\\\", \ ButtonNote -> \\\"Join::heads\\\"]\\)\"\>"}]], "Message", CellChangeTimes->{3.441962968733552*^9}], Cell[BoxData[ RowBox[{ RowBox[{"Complement", "::", "\<\"normal\"\>"}], RowBox[{ ":", " "}], "\<\"Nonatomic expression expected at position \\!\\(2\\) in \ \\!\\(Complement[\\(\\(\\(\\(\[LeftSkeleton] 1 \[RightSkeleton]\\)\\), \ b\\)\\)]\\). \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \ ButtonStyle->\\\"Link\\\", ButtonFrame->None, \ ButtonData:>\\\"paclet:ref/message/General/normal\\\", ButtonNote -> \ \\\"Complement::normal\\\"]\\)\"\>"}]], "Message", CellChangeTimes->{3.4419629691842003`*^9}], Cell[BoxData[ RowBox[{ RowBox[{"Complement", "::", "\<\"normal\"\>"}], RowBox[{ ":", " "}], "\<\"Nonatomic expression expected at position \\!\\(2\\) in \ \\!\\(Complement[\\(\\(\\(\\(\[LeftSkeleton] 1 \[RightSkeleton]\\)\\), \ b\\)\\)]\\). \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \ ButtonStyle->\\\"Link\\\", ButtonFrame->None, \ ButtonData:>\\\"paclet:ref/message/General/normal\\\", ButtonNote -> \ \\\"Complement::normal\\\"]\\)\"\>"}]], "Message", CellChangeTimes->{3.4419629692442865`*^9}], Cell[BoxData[ RowBox[{ RowBox[{"General", "::", "\<\"stop\"\>"}], RowBox[{ ":", " "}], "\<\"Further output of \\!\\(Complement :: \\\"normal\\\"\\) \ will be suppressed during this calculation. \\!\\(\\*ButtonBox[\\\"\ \[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \ ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \ \\\"General::stop\\\"]\\)\"\>"}]], "Message", CellChangeTimes->{3.441962969414531*^9}], Cell[BoxData[ RowBox[{ RowBox[{"StringExpression", "::", "\<\"invld\"\>"}], RowBox[{ ":", " "}], "\<\"Element \ \\!\\(\\(\\(Complement[\\(\\(\\(\\({\\\"CheckOptions`\\\", \ \\\"PackageOptionChecks`\\\", \\(\\(\[LeftSkeleton] 5 \[RightSkeleton]\\)\\), \ \\\"Global`\\\"}\\)\\), b\\)\\)]\\)\\) \\(\\(\[LeftSkeleton] 1 \ \[RightSkeleton]\\)\\) \\(\\({\\(\[LeftSkeleton] 9 \[RightSkeleton]\\) \\(\ \[LeftSkeleton] 1 \[RightSkeleton]\\)\\)\\)\\) is not a valid string or \ pattern element in \ \\!\\(\\(\\(\\(\\(Complement[\\(\\(\\(\\({\\\"CheckOptions`\\\", \\(\\(\ \[LeftSkeleton] 6 \[RightSkeleton]\\)\\), \\\"Global`\\\"}\\)\\), b\\)\\)]\\)\ \\) | \\(\\({\\\"Global`\\\"}\\)\\)\\)\\) ~~ ___\\).\"\>"}]], "Message", CellChangeTimes->{3.4419629699052367`*^9}], Cell[BoxData[ RowBox[{ RowBox[{"StringExpression", "::", "\<\"invld\"\>"}], RowBox[{ ":", " "}], "\<\"Element \ \\!\\(\\(\\(Complement[\\(\\(\\(\\({\\\"CheckOptions`\\\", \ \\\"PackageOptionChecks`\\\", \\(\\(\[LeftSkeleton] 5 \[RightSkeleton]\\)\\), \ \\\"Global`\\\"}\\)\\), b\\)\\)]\\)\\) \\(\\(\[LeftSkeleton] 1 \ \[RightSkeleton]\\)\\) \\(\\({\\(\[LeftSkeleton] 9 \[RightSkeleton]\\) \\(\ \[LeftSkeleton] 1 \[RightSkeleton]\\)\\)\\)\\) is not a valid string or \ pattern element in \ \\!\\(\\(\\(\\(\\(Complement[\\(\\(\\(\\({\\\"CheckOptions`\\\", \\(\\(\ \[LeftSkeleton] 6 \[RightSkeleton]\\)\\), \\\"Global`\\\"}\\)\\), b\\)\\)]\\)\ \\) | \\(\\({\\\"Global`\\\"}\\)\\)\\)\\) ~~ ___\\).\"\>"}]], "Message", CellChangeTimes->{3.4419629699452944`*^9}], Cell[BoxData[ RowBox[{ RowBox[{"StringExpression", "::", "\<\"invld\"\>"}], RowBox[{ ":", " "}], "\<\"Element \ \\!\\(\\(\\(Complement[\\(\\(\\(\\({\\\"CheckOptions`\\\", \ \\\"PackageOptionChecks`\\\", \\(\\(\[LeftSkeleton] 5 \[RightSkeleton]\\)\\), \ \\\"Global`\\\"}\\)\\), b\\)\\)]\\)\\) \\(\\(\[LeftSkeleton] 1 \ \[RightSkeleton]\\)\\) \\(\\({\\(\[LeftSkeleton] 9 \[RightSkeleton]\\) \\(\ \[LeftSkeleton] 1 \[RightSkeleton]\\)\\)\\)\\) is not a valid string or \ pattern element in \ \\!\\(\\(\\(\\(\\(Complement[\\(\\(\\(\\({\\\"CheckOptions`\\\", \\(\\(\ \[LeftSkeleton] 6 \[RightSkeleton]\\)\\), \\\"Global`\\\"}\\)\\), b\\)\\)]\\)\ \\) | \\(\\({\\\"Global`\\\"}\\)\\)\\)\\) ~~ ___\\).\"\>"}]], "Message", CellChangeTimes->{3.4419629700053806`*^9}], Cell[BoxData[ RowBox[{ RowBox[{"General", "::", "\<\"stop\"\>"}], RowBox[{ ":", " "}], "\<\"Further output of \\!\\(StringExpression :: \ \\\"invld\\\"\\) will be suppressed during this calculation. \ \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \ ButtonFrame->None, ButtonData:>\\\"paclet:ref/message/General/stop\\\", \ ButtonNote -> \\\"General::stop\\\"]\\)\"\>"}]], "Message", CellChangeTimes->{3.441962970055453*^9}], Cell[BoxData[ RowBox[{"{", "\<\"System`\"\>", "}"}]], "Output", CellChangeTimes->{3.441962970886648*^9}] }, Open ]], Cell["We now turn the option checks on :", "Text", CellChangeTimes->{{3.4410398577971296`*^9, 3.4410398649674397`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"TurnOptionChecksOn", "[", "\"\\"", "]"}]], "Input", CellChangeTimes->{{3.441028772987957*^9, 3.441028803932453*^9}, { 3.4410288379914274`*^9, 3.441028845392069*^9}, {3.441028885549813*^9, 3.4410288865412383`*^9}, {3.441032542087656*^9, 3.441032544220723*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ "DependentSymbols", ",", "DependentSymbolsExistQ", ",", "SearchedContexts", ",", "SymbolsContexts"}], "}"}]], "Output", CellChangeTimes->{3.4419629721684914`*^9}] }, Open ]], Cell["\<\ Now, the behavior is arguably cleaner, and easier to understand for a user of \ a package :\ \>", "Text", CellChangeTimes->{{3.4410399099921827`*^9, 3.4410399578209567`*^9}, { 3.4418704242061005`*^9, 3.441870425688232*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"SearchedContexts", "[", RowBox[{"ExcludeContexts", " ", "\[Rule]", "b"}], "]"}]], "Input", CellChangeTimes->{{3.4410397769608927`*^9, 3.441039782629043*^9}, 3.4410479492320414`*^9, 3.441871501465123*^9}], Cell[BoxData[ RowBox[{ RowBox[{"SearchedContexts", "::", "\<\"badopt\"\>"}], RowBox[{ ":", " "}], "\<\"The option \\!\\(ExcludeContexts \[Rule] b\\) is invalid. \ \\n\\t\\tThe pattern for the option's rhs to match is \\!\\({___String}\\) \"\ \>"}]], "Message", CellChangeTimes->{3.441962972969643*^9}], Cell[BoxData["$Failed"], "Output", CellChangeTimes->{3.4419629729996862`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"SearchedContexts", "[", RowBox[{"ExcludeSystem", "\[Rule]", "a"}], "]"}]], "Input", CellChangeTimes->{3.441871504539544*^9}], Cell[BoxData[ RowBox[{ RowBox[{"SearchedContexts", "::", "\<\"badopt\"\>"}], RowBox[{ ":", " "}], "\<\"The option \\!\\(ExcludeSystem \[Rule] a\\) is invalid. \ \\n\\t\\tThe pattern for the option's rhs to match is \\!\\(True | False\\) \ \"\>"}]], "Message", CellChangeTimes->{3.4419629752529263`*^9}], Cell[BoxData["$Failed"], "Output", CellChangeTimes->{3.441962975262941*^9}] }, Open ]], Cell["One can check whether or not a given function is protected :", "Text", CellChangeTimes->{{3.4410405582543373`*^9, 3.441040583430539*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"OptionCheckIsOn", "[", "SearchedContexts", "]"}]], "Input", CellChangeTimes->{{3.441047374886173*^9, 3.441047384419882*^9}, 3.4418715111190047`*^9}], Cell[BoxData["True"], "Output", CellChangeTimes->{3.441962978367405*^9}] }, Open ]], Cell["\<\ Keeping the option checks always on may slow some of the functions down \ rather significantly. One can turn off the protection for individual \ functions by using finer tools such as OptionCheckOn/OptionCheckOff :\ \>", "Text", CellChangeTimes->{{3.441047470073045*^9, 3.441047594031288*^9}, { 3.441048503539096*^9, 3.4410485067737474`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"OptionCheckOff", "[", "SearchedContexts", "]"}]], "Input", CellChangeTimes->{{3.44104760334468*^9, 3.441047612307568*^9}, 3.4418715124909773`*^9}], Cell[BoxData[ RowBox[{"{", "\<\"SearchedContexts\"\>", "}"}]], "Output", CellChangeTimes->{3.4419629791986*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"OptionCheckIsOn", "[", "SearchedContexts", "]"}]], "Input", CellChangeTimes->{3.4418715166169105`*^9}], Cell[BoxData["False"], "Output", CellChangeTimes->{3.441962980370285*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"SearchedContexts", "[", RowBox[{"ExcludeSystem", "\[Rule]", "a"}], "]"}]], "Input", CellChangeTimes->{3.441871517828653*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{"\<\"CheckOptions`\"\>", ",", "\<\"CheckOptions`Private`\"\>", ",", "\<\"Global`\"\>", ",", "\<\"Global`Private`\"\>", ",", "\<\"PackageOptionChecks`\"\>", ",", "\<\"PackageOptionChecks`Private`\"\>", ",", "\<\"PackageSymbolsDependencies`\"\>", ",", "\<\"PackageSymbolsDependencies`Private`\"\>", ",", "\<\"System`\"\>"}], "}"}]], "Output", CellChangeTimes->{3.4419629820426893`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"OptionCheckOn", "[", "SearchedContexts", "]"}]], "Input", CellChangeTimes->{{3.4410476271689377`*^9, 3.441047628250493*^9}, 3.441871519110496*^9}], Cell[BoxData[ RowBox[{"{", "\<\"SearchedContexts\"\>", "}"}]], "Output", CellChangeTimes->{3.4419629837651663`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"OptionCheckIsOn", "[", "SearchedContexts", "]"}]], "Input", CellChangeTimes->{3.441871522695651*^9}], Cell[BoxData["True"], "Output", CellChangeTimes->{3.4419629845062323`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"SearchedContexts", "[", RowBox[{"ExcludeSystem", "\[Rule]", "a"}], "]"}]], "Input", CellChangeTimes->{3.4418715252292943`*^9}], Cell[BoxData[ RowBox[{ RowBox[{"SearchedContexts", "::", "\<\"badopt\"\>"}], RowBox[{ ":", " "}], "\<\"The option \\!\\(ExcludeSystem \[Rule] a\\) is invalid. \ \\n\\t\\tThe pattern for the option's rhs to match is \\!\\(True | False\\) \ \"\>"}]], "Message", CellChangeTimes->{3.441962985687931*^9}], Cell[BoxData["$Failed"], "Output", CellChangeTimes->{3.4419629857179747`*^9}] }, Open ]], Cell["\<\ Having the duty of option checks relagated to a separate package has certain \ advantages. For example, you can change the response to a wrong option from \ standard $Failed to, for instance, throwing an exception, without going to \ the low-level details of the main (PackageSymbolsDependencies` in this case) \ package implementation. Here is the current option-protecting information:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"GetOptionsInfo", "[", "\"\\"", "]"}], "//", RowBox[{ RowBox[{"Short", "[", RowBox[{"#", ",", "8"}], "]"}], "&"}]}]], "Input"], Cell[BoxData[ TagBox[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"ExcludeContexts", ",", RowBox[{"{", "___String", "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"SearchedContexts", "\[RuleDelayed]", "$Failed"}], ",", RowBox[{"DependentSymbols", "\[RuleDelayed]", "$Failed"}], ",", RowBox[{"DependentSymbolsExistQ", "\[RuleDelayed]", "$Failed"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{"ExcludeSystem", ",", RowBox[{"True", "|", "False"}], ",", RowBox[{"{", RowBox[{ RowBox[{"SearchedContexts", "\[RuleDelayed]", "$Failed"}], ",", RowBox[{"DependentSymbols", "\[RuleDelayed]", "$Failed"}], ",", RowBox[{"DependentSymbolsExistQ", "\[RuleDelayed]", "$Failed"}]}], "}"}]}], "}"}], ",", RowBox[{"\[LeftSkeleton]", "6", "\[RightSkeleton]"}], ",", RowBox[{"{", RowBox[{"ContextsOnly", ",", RowBox[{"True", "|", "False"}], ",", RowBox[{"SymbolsContexts", "\[RuleDelayed]", "$Failed"}]}], "}"}]}], "}"}], Short[#, 8]& ]], "Output", CellChangeTimes->{3.441962988041315*^9}] }, Open ]], Cell["\<\ Here is what we have to do in order for the previous input to throw, rather \ than return, $Failed:\ \>", "Text"], Cell[BoxData[ RowBox[{"ResetOptionsInfo", "[", RowBox[{"\"\\"", ",", RowBox[{"{", RowBox[{"{", RowBox[{"ExcludeSystem", ",", RowBox[{"True", "|", "False"}], ",", RowBox[{"SearchedContexts", "\[RuleDelayed]", RowBox[{"Throw", "[", "$Failed", "]"}]}]}], "}"}], "}"}]}], "]"}]], "Input"], Cell["Check now:", "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"GetOptionsInfo", "[", "\"\\"", "]"}], "//", RowBox[{ RowBox[{"Short", "[", RowBox[{"#", ",", "8"}], "]"}], "&"}]}]], "Input"], Cell[BoxData[ TagBox[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"ExcludeContexts", ",", RowBox[{"{", "___String", "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"SearchedContexts", "\[RuleDelayed]", "$Failed"}], ",", RowBox[{"DependentSymbols", "\[RuleDelayed]", "$Failed"}], ",", RowBox[{"DependentSymbolsExistQ", "\[RuleDelayed]", "$Failed"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{"ExcludeSystem", ",", RowBox[{"True", "|", "False"}], ",", RowBox[{"{", RowBox[{ RowBox[{"SearchedContexts", "\[RuleDelayed]", RowBox[{"Throw", "[", "$Failed", "]"}]}], ",", RowBox[{"DependentSymbols", "\[RuleDelayed]", "$Failed"}], ",", RowBox[{"DependentSymbolsExistQ", "\[RuleDelayed]", "$Failed"}]}], "}"}]}], "}"}], ",", RowBox[{"\[LeftSkeleton]", "6", "\[RightSkeleton]"}], ",", RowBox[{"{", RowBox[{"ContextsOnly", ",", RowBox[{"True", "|", "False"}], ",", RowBox[{"SymbolsContexts", "\[RuleDelayed]", "$Failed"}]}], "}"}]}], "}"}], Short[#, 8]& ]], "Output", CellChangeTimes->{3.441962991526326*^9}] }, Open ]], Cell["And:", "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"SearchedContexts", "[", RowBox[{"ExcludeSystem", "\[Rule]", "a"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{ RowBox[{"SearchedContexts", "::", "\<\"badopt\"\>"}], RowBox[{ ":", " "}], "\<\"The option \\!\\(ExcludeSystem \[Rule] a\\) is invalid. \ \\n\\t\\tThe pattern for the option's rhs to match is \\!\\(True | False\\) \ \"\>"}]], "Message", CellChangeTimes->{3.4419629944305024`*^9}], Cell[BoxData[ RowBox[{ RowBox[{"Throw", "::", "\<\"nocatch\"\>"}], RowBox[{ ":", " "}], "\<\"Uncaught \\!\\(Throw[$Failed]\\) returned to top level. \ \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \ ButtonFrame->None, ButtonData:>\\\"paclet:ref/message/Throw/nocatch\\\", \ ButtonNote -> \\\"Throw::nocatch\\\"]\\)\"\>"}]], "Message", CellChangeTimes->{3.441962994670848*^9}], Cell[BoxData[ RowBox[{"Hold", "[", RowBox[{"Throw", "[", "$Failed", "]"}], "]"}]], "Output", CellChangeTimes->{3.4419629947109056`*^9}] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["\<\ Dependencies of symbols in other contexts on symbols in a given context\ \>", "Subsection", CellChangeTimes->{{3.4403561737785854`*^9, 3.440356178515397*^9}, { 3.4403574047486334`*^9, 3.440357427391192*^9}}, FontWeight->"Plain"], Cell["\<\ We will load one of the (legacy for v6 .0 +) packages that uses other \ packages:\ \>", "Text", CellChangeTimes->{{3.4404377027405043`*^9, 3.4404377376707315`*^9}, { 3.441048527523584*^9, 3.4410485311187534`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Needs", "[", "\"\\"", "]"}]], "Input", CellChangeTimes->{{3.440351287562552*^9, 3.4403512935311346`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"General", "::", "\<\"obspkg\"\>"}], RowBox[{ ":", " "}], "\<\"\\!\\(\\\"Statistics`MultiDescriptiveStatistics`\\\"\\) is \ now obsolete. The legacy version being loaded may conflict with current \ Mathematica functionality. See the Compatibility Guide for updating \ information. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \ ButtonStyle->\\\"Link\\\", ButtonFrame->None, \ ButtonData:>\\\"paclet:Compatibility/Tutorials/Statistics/\ MultiDescriptiveStatistics\\\", ButtonNote -> \ \\\"General::obspkg\\\"]\\)\"\>"}]], "Message", "MSG", CellChangeTimes->{3.441962997434822*^9}] }, Open ]], Cell["\<\ The package just loaded uses, among others, the functions from \ \"Statistics`DataManipulation`\". We can now see precisely which functions in \ other packages (including \"Statistics`MultiDescriptiveStatistics`\") depend \ on the functionality of \"Statistics`DataManipulation`\" :\ \>", "Text", CellChangeTimes->{{3.4404410736075726`*^9, 3.4404411844269233`*^9}, { 3.4410485470015917`*^9, 3.4410485548128242`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"DependentSymbols", "[", RowBox[{"\"\\"", ",", RowBox[{"DependencyCheck", "\[Rule]", " ", "Normal"}]}], "]"}], "//", "Timing"}]], "Input", CellChangeTimes->{ 3.4403512839974256`*^9, {3.440351393334645*^9, 3.4403514061731057`*^9}, { 3.4403518248851843`*^9, 3.4403518273687553`*^9}, {3.4404412428809757`*^9, 3.4404412488495584`*^9}, {3.440441292412198*^9, 3.440441314944598*^9}, { 3.440499366851576*^9, 3.440499367562598*^9}, {3.4404998098986464`*^9, 3.4404998120317135`*^9}, {3.4409477250721984`*^9, 3.4409477436789536`*^9}, {3.4410480068348703`*^9, 3.441048008757635*^9}, { 3.4419020613981485`*^9, 3.44190207139252*^9}, {3.4419021179594803`*^9, 3.4419021236476593`*^9}, {3.441902597679283*^9, 3.4419026012944813`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"12.758000000000001`", ",", RowBox[{"{", RowBox[{"\<\"MultivariateMode\"\>", ",", "\<\"Column\"\>", ",", "\<\"Mode\"\>"}], "}"}]}], "}"}]], "Output", CellChangeTimes->{3.44196301258661*^9}] }, Open ]], Cell["\<\ Here we pass an inappropriate option. If the option - protection is on, the \ function should return $Failed :\ \>", "Text", CellChangeTimes->{{3.4410486152597427`*^9, 3.4410486599439955`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"DependentSymbols", "[", RowBox[{"\"\\"", ",", RowBox[{"DependencyCheck", "\[Rule]", " ", "Normal"}], ",", RowBox[{"a", "\[Rule]", "b"}]}], "]"}], "//", "Timing"}]], "Input", CellChangeTimes->{{3.4405023909600306`*^9, 3.4405023926624784`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"DependentSymbols", "::", "\<\"optundef\"\>"}], RowBox[{ ":", " "}], "\<\"The option \\!\\(a \[Rule] b\\) is unknown\"\>"}]], \ "Message", CellChangeTimes->{3.4419630154907856`*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{"0.010000000000000103`", ",", "$Failed"}], "}"}]], "Output", CellChangeTimes->{3.4419630154907856`*^9}] }, Open ]], Cell["\<\ The setting DependencyCheck -> Normal is the default one, and it corresponds \ to search being performed in contexts returned by SearchedContexts[].\ \>", "Text", CellChangeTimes->{{3.440441328984787*^9, 3.4404413822413664`*^9}, 3.4418715282035713`*^9}], Cell["\<\ Sometimes we may use the present functionality to discover changes that a \ given package introduced to functions in other contexts (packages). We see \ for instance that the system functions Column and Mode have been modified \ (overloaded) by the package.\ \>", "Text", CellChangeTimes->{{3.4403516119489965`*^9, 3.440351647249757*^9}, { 3.440357960577877*^9, 3.4403579615192304`*^9}, {3.4404411918976655`*^9, 3.440441226877965*^9}, {3.44104868314736*^9, 3.4410487268802447`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"DownValues", "[", "Mode", "]"}], "//", RowBox[{ RowBox[{"Short", "[", RowBox[{"#", ",", "3"}], "]"}], "&"}]}]], "Input", CellChangeTimes->{{3.4403515754865665`*^9, 3.4403516042278943`*^9}, { 3.4403516535287857`*^9, 3.4403516547505426`*^9}, {3.440437814751568*^9, 3.4404378170949373`*^9}}], Cell[BoxData[ TagBox[ RowBox[{"{", RowBox[{ RowBox[{"HoldPattern", "[", RowBox[{ "Mode", "[", "Statistics`DescriptiveStatistics`Private`list_", "]"}], "]"}], "\[RuleDelayed]", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"\[LeftSkeleton]", "64", "\[RightSkeleton]"}], "[", RowBox[{"Mode", ",", RowBox[{"\<\"Statisti\"\>", "\[Ellipsis]", "\<\"atistics`\"\>"}]}], "]"}], ";", RowBox[{"\[LeftSkeleton]", "1", "\[RightSkeleton]"}]}], ")"}], "/;", RowBox[{"\[LeftSkeleton]", "1", "\[RightSkeleton]"}]}]}], "}"}], Short[#, 3]& ]], "Output", CellChangeTimes->{3.4419630175437374`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"DownValues", "[", "Column", "]"}], "//", RowBox[{ RowBox[{"Short", "[", RowBox[{"#", ",", "5"}], "]"}], "&"}]}]], "Input", CellChangeTimes->{{3.440351659667613*^9, 3.440351661720565*^9}, { 3.4404378211507697`*^9, 3.4404378299333982`*^9}}], Cell[BoxData[ TagBox[ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"HoldPattern", "[", RowBox[{"Column", "[", RowBox[{ RowBox[{"Statistics`DataManipulation`Private`data", ":", RowBox[{"{", "___List", "}"}]}], ",", "Statistics`DataManipulation`Private`n_Integer"}], "]"}], "]"}], "\[RuleDelayed]", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"\[LeftSkeleton]", "59", "\[RightSkeleton]"}], "[", RowBox[{"Column", ",", "\<\"Statistics`DataManipulation`\"\>"}], "]"}], ";", RowBox[{ RowBox[{"\[LeftSkeleton]", "40", "\[RightSkeleton]"}], "\[LeftDoubleBracket]", RowBox[{"All", ",", RowBox[{"\[LeftSkeleton]", "37", "\[RightSkeleton]"}]}], "\[RightDoubleBracket]"}]}], ")"}]}], ",", RowBox[{"\[LeftSkeleton]", "1", "\[RightSkeleton]"}]}], "}"}], Short[#, 5]& ]], "Output", CellChangeTimes->{3.4419630186653504`*^9}] }, Open ]], Cell["\<\ One can get somewhat more detailed information with < \ DependentSymbolsInDefinitions > :\ \>", "Text", CellChangeTimes->{{3.4418694322497377`*^9, 3.4418694561541104`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"?", "DependentSymbolsInDefinitions"}]], "Input", CellChangeTimes->{{3.441869207686832*^9, 3.4418692178614626`*^9}}], Cell[BoxData[ StyleBox["\<\"DependentSymbolsInDefinitions[property_Symbol,context_String,\\\ nsymbols:{___String}] produces a list of sublists containing dependent \ symbols together with their contexts. The symbol is dependent wrt the \ property if the code for property[symbol] contains symbols in the \ context \\n\"\>", "MSG"]], "Print", "PrintUsage", CellChangeTimes->{3.4419630200673666`*^9}, CellTags->"Info3441934219-7942539"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"DependentSymbolsInDefinitions", "[", RowBox[{"DownValues", ",", "\"\\"", ",", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.44186923126073*^9, 3.441869327909704*^9}, { 3.4418693728443165`*^9, 3.441869379003173*^9}, {3.441869462172765*^9, 3.4418694878296576`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"\<\"Mode\"\>", ",", RowBox[{"{", RowBox[{"\<\"Statistics`DataManipulation`\"\>", ",", "\<\"Statistics`DescriptiveStatistics`Private`\"\>", ",", "\<\"System`\"\>"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"Column\"\>", ",", RowBox[{"{", RowBox[{"\<\"Statistics`DataManipulation`Private`\"\>", ",", "\<\"System`\"\>"}], "}"}]}], "}"}]}], "}"}]], "Output", CellChangeTimes->{3.441963021409296*^9}] }, Open ]], Cell["\<\ Displayed are those symbols from our symbol (string) list that depend in \ particular on some of the symbols of a given context \ (\"Statistics`DataManipulation`\" in this case).\ \>", "Text", CellChangeTimes->{{3.44186947201692*^9, 3.4418695512909107`*^9}}], Cell["\<\ We now perform the full dependency check over the entire system - all the \ contexts currently loaded into the system will be checked:\ \>", "Text", CellChangeTimes->{{3.440354514582779*^9, 3.4403545334499087`*^9}, 3.4404412374331427`*^9, {3.440441403481909*^9, 3.4404414229499025`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"DependentSymbols", "[", RowBox[{"\"\\"", ",", RowBox[{"DependencyCheck", "\[Rule]", " ", "Full"}]}], "]"}], "//", "Timing"}]], "Input", CellChangeTimes->{{3.4403537908921633`*^9, 3.440353801176952*^9}, 3.4404378962487555`*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{"35.461`", ",", RowBox[{"{", RowBox[{"\<\"MultivariateMode\"\>", ",", "\<\"Column\"\>", ",", "\<\"Mode\"\>", ",", "\<\"Out\"\>"}], "}"}]}], "}"}]], "Output", CellChangeTimes->{3.4419630587930512`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"DependentSymbols", "[", RowBox[{"\"\\"", ",", RowBox[{"DependencyCheck", "\[Rule]", " ", "Ful"}]}], "]"}], "//", "Timing"}]], "Input", CellChangeTimes->{3.441020579366107*^9}], Cell[BoxData[ RowBox[{ RowBox[{"DependentSymbols", "::", "\<\"badopt\"\>"}], RowBox[{ ":", " "}], "\<\"The option \\!\\(DependencyCheck \[Rule] Ful\\) is \ invalid. \\n\\t\\tThe pattern for the option's rhs to match is \\!\\(Normal | \ Full\\) \"\>"}]], "Message", CellChangeTimes->{3.4419630609261184`*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{"0.009999999999998187`", ",", "$Failed"}], "}"}]], "Output", CellChangeTimes->{3.4419630609561615`*^9}] }, Open ]], Cell["By checking only specific properties, we may get is faster", "Text", CellChangeTimes->{{3.4403518806553774`*^9, 3.440351898621211*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"DependentSymbols", "[", RowBox[{"\"\\"", ",", RowBox[{"PropertiesToCheck", "\[Rule]", " ", RowBox[{"{", "DownValues", "}"}]}]}], "]"}], "//", "Timing"}]], "Input", CellChangeTimes->{{3.4403518760587683`*^9, 3.4403518777712307`*^9}, { 3.440355835422053*^9, 3.4403558371445293`*^9}, 3.4404380699885807`*^9, { 3.4405024941984797`*^9, 3.440502494869445*^9}, {3.440502682419128*^9, 3.4405026896795683`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"2.7339999999999973`", ",", RowBox[{"{", RowBox[{"\<\"MultivariateMode\"\>", ",", "\<\"Column\"\>", ",", "\<\"Mode\"\>", ",", "\<\"Out\"\>"}], "}"}]}], "}"}]], "Output", CellChangeTimes->{3.441963066203707*^9}] }, Open ]], Cell["Or may miss it ...", "Text", CellChangeTimes->{{3.4404381279619427`*^9, 3.4404381321479616`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"DependentSymbols", "[", RowBox[{"\"\\"", ",", RowBox[{"PropertiesToCheck", "\[Rule]", " ", RowBox[{"{", "UpValues", "}"}]}]}], "]"}], "//", "Timing"}]], "Input", CellChangeTimes->{{3.440351809142547*^9, 3.4403518108850527`*^9}, { 3.440351861227442*^9, 3.4403518630400476`*^9}, 3.4404380641702147`*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{"3.4449999999999994`", ",", RowBox[{"{", "}"}]}], "}"}]], "Output", CellChangeTimes->{3.4419630705399427`*^9}] }, Open ]], Cell["\<\ If all we need is just a fact of presence or absence of dependencies, then we \ may use < DependentSymbolsExistQ >, which may be somewhat faster in some \ cases :\ \>", "Text", CellChangeTimes->{{3.440355849892861*^9, 3.440355898542816*^9}, { 3.4403580928380575`*^9, 3.4403580980155025`*^9}, {3.441868732163062*^9, 3.4418687335951214`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{ "DependentSymbolsExistQ", "[", "\"\\"", "]"}], "//", "Timing"}]], "Input", CellChangeTimes->{{3.4403557926205072`*^9, 3.4403558145820866`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"2.7440000000000038`", ",", "True"}], "}"}]], "Output", CellChangeTimes->{3.4419630753668833`*^9}] }, Open ]], Cell["\<\ If we are not interested in possible modifications of system functions, then \ we may use the ExcludeSystem -> True setting, which will somewhat speed up \ the search. However, it is not sped up in proportion of the fraction of total \ considered namespace, occupied by system symbols, because most of them don' t \ have the user - defined (externally - defined) rules and thus checking \ System` context is not that time - consuming.\ \>", "Text", CellChangeTimes->{{3.44035822357605*^9, 3.440358399509029*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"DependentSymbols", "[", RowBox[{ "\"\\"", ",", "\[IndentingNewLine]", RowBox[{"ExcludeSystem", "\[Rule]", " ", "True"}], ",", RowBox[{"PropertiesToCheck", "\[Rule]", " ", RowBox[{"{", "DownValues", "}"}]}]}], "]"}], "//", "Timing"}]], "Input", CellChangeTimes->{{3.440357014727811*^9, 3.4403570365091314`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"1.7629999999999988`", ",", RowBox[{"{", "\<\"MultivariateMode\"\>", "}"}]}], "}"}]], "Output", CellChangeTimes->{3.4419630785314336`*^9}] }, Open ]], Cell["\<\ Rather than excluding some contexts from the search (with ExcludeContexts \ option), we may restrict the list of searched contexts to some specific set \ of contexts. This, for example, checks which system functions, if any, have \ been modified by a package :\ \>", "Text", CellChangeTimes->{{3.440356753602331*^9, 3.44035678141232*^9}, { 3.4403581217997026`*^9, 3.4403581998919935`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"DependentSymbols", "[", RowBox[{ "\"\\"", ",", "\[IndentingNewLine]", RowBox[{"IncludeOnlyContexts", "\[Rule]", " ", RowBox[{"{", "\"\\"", "}"}]}], ",", RowBox[{"PropertiesToCheck", "\[Rule]", " ", RowBox[{"{", "DownValues", "}"}]}]}], "]"}], "//", "Timing"}]], "Input", CellChangeTimes->{{3.4403566635628605`*^9, 3.440356743537859*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"1.0109999999999968`", ",", RowBox[{"{", RowBox[{"\<\"Column\"\>", ",", "\<\"Mode\"\>", ",", "\<\"Out\"\>"}], "}"}]}], "}"}]], "Output", CellChangeTimes->{3.441963081515725*^9}] }, Open ]], Cell["\<\ By the way, this shows once again, that the search over system symbols is \ relatively fast. \ \>", "Text", CellChangeTimes->{{3.4403571279606323`*^9, 3.4403572250302114`*^9}, { 3.440438693455082*^9, 3.440438734844597*^9}}], Cell["\<\ As it is already clear by now, the main reason for the slowdown is a \ typically huge number of symbols involved in a \"blind\" search. If we are \ only interested in checking dependencies between specific contexts, things \ are much faster for contexts with the reasonably small number of symbols (not \ like System`) :\ \>", "Text", CellChangeTimes->{{3.4403571279606323`*^9, 3.4403572250302114`*^9}, { 3.440438693455082*^9, 3.4404387360062675`*^9}, {3.440441522402909*^9, 3.440441523614651*^9}, {3.441048822898312*^9, 3.4410488767156973`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"DependentSymbols", "[", RowBox[{ "\"\\"", ",", "\[IndentingNewLine]", RowBox[{"IncludeOnlyContexts", "\[Rule]", " ", RowBox[{"{", "\"\\"", "}"}]}], ",", RowBox[{"PropertiesToCheck", "\[Rule]", " ", RowBox[{"{", "DownValues", "}"}]}]}], "]"}], "//", "Timing"}]], "Input", CellChangeTimes->{{3.440357089955984*^9, 3.4403571167845616`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"0.10999999999999818`", ",", RowBox[{"{", "\<\"MultivariateMode\"\>", "}"}]}], "}"}]], "Output", CellChangeTimes->{3.441963083718893*^9}] }, Open ]], Cell["\<\ We can do things even much faster if we have a (small) list of symbols that \ we wish to check \ \>", "Text", CellChangeTimes->{{3.44035680194184*^9, 3.4403568033839135`*^9}, { 3.4403569713654594`*^9, 3.440356997072424*^9}, {3.440357241754259*^9, 3.4403572424352384`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"DependentSymbols", "[", RowBox[{ "\"\\"", ",", "\[IndentingNewLine]", RowBox[{"CheckContexts", "\[Rule]", " ", "False"}], ",", RowBox[{"IncludeOnlyContexts", "\[Rule]", " ", RowBox[{"{", "\"\\"", "}"}]}], ",", RowBox[{"PropertiesToCheck", "\[Rule]", " ", RowBox[{"{", "DownValues", "}"}]}], ",", RowBox[{"SymbolsToCheck", "\[Rule]", " ", RowBox[{"{", RowBox[{ "Map", ",", "Thread", ",", "Outer", ",", "Set", ",", "Mode", ",", "Rule", ",", "Column"}], "}"}]}]}], "]"}], "//", "Timing"}]], "Input", CellChangeTimes->{{3.440356918138923*^9, 3.4403569640849905`*^9}, { 3.441868826488696*^9, 3.4418688531069713`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"0.010000000000002292`", ",", RowBox[{"{", RowBox[{"\<\"Mode\"\>", ",", "\<\"Column\"\>"}], "}"}]}], "}"}]], "Output",\ CellChangeTimes->{3.4419630857117586`*^9}] }, Open ]], Cell["\<\ So, the more narrow is a set of symbols, whose possible dependencies on \ symbols in the given context we check, the less time the check will take.\ \>", "Text", CellChangeTimes->{{3.440357255463973*^9, 3.4403573278180127`*^9}}] }, Closed]], Cell[CellGroupData[{ Cell["\<\ Symbols used to build a given expression, and their contexts \ \>", "Subsection", CellChangeTimes->{{3.4403574355929856`*^9, 3.440357455231224*^9}, { 3.4403574943474703`*^9, 3.4403575102503376`*^9}, {3.4404401102723646`*^9, 3.4404401181536975`*^9}}, FontWeight->"Plain"], Cell["\<\ In other words, here we will answer the following question: given an \ expression, what is a set of contexts to which belong all symbols used to \ build this expression.\ \>", "Text", CellChangeTimes->{{3.440357512283261*^9, 3.440357556857355*^9}, { 3.440438787209894*^9, 3.4404387995876927`*^9}, {3.4404415546592913`*^9, 3.440441555230112*^9}, {3.441048921139576*^9, 3.441048927979411*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"?", "SymbolsContexts"}]], "Input", CellChangeTimes->{{3.440353444974758*^9, 3.4403534907906384`*^9}}], Cell[BoxData[ StyleBox["\<\"SymbolsContexts[expr_] produces a list of contexts of all \ symbols used in building an expression. Heads are taken into \ consideration\"\>", "MSG"]], "Print", "PrintUsage", CellChangeTimes->{3.4419630915601683`*^9}, CellTags->"Info3441934291-5129878"] }, Open ]], Cell["\<\ This gives a complete list of all symbols used in definition of < \ MultivariateMode >, together with their contexts.\ \>", "Text", CellChangeTimes->{{3.4403536934420366`*^9, 3.440353731206339*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"SymbolsContexts", "[", RowBox[{"DownValues", "[", "MultivariateMode", "]"}], "]"}], "//", RowBox[{ RowBox[{"Short", "[", RowBox[{"#", ",", "10"}], "]"}], "&"}]}]], "Input", CellChangeTimes->{{3.440353496218443*^9, 3.4403535328811617`*^9}}], Cell[BoxData[ TagBox[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Hold", "[", "RuleDelayed", "]"}], ",", "\<\"System`\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Hold", "[", "HoldPattern", "]"}], ",", "\<\"System`\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Hold", "[", "MultivariateMode", "]"}], ",", "\<\"Statistics`MultiDescriptiveStatistics`\"\>"}], "}"}], ",", RowBox[{"\[LeftSkeleton]", "44", "\[RightSkeleton]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Hold", "[", "Part", "]"}], ",", "\<\"System`\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{ "Hold", "[", "Statistics`MultiDescriptiveStatistics`Private`ms", "]"}], ",", "\<\"Statistics`MultiDescriptiveStatistics`Private`\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{ "Hold", "[", "Statistics`MultiDescriptiveStatistics`Private`ms", "]"}], ",", "\<\"Statistics`MultiDescriptiveStatistics`Private`\"\>"}], "}"}]}], "}"}], Short[#, 10]& ]], "Output", CellChangeTimes->{3.44196309286204*^9}] }, Open ]], Cell["\<\ This gives us only the set of contexts symbols from which are used in \ definition of < MultivariateMode >\ \>", "Text", CellChangeTimes->{{3.440353653134077*^9, 3.4403536846393795`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"SymbolsContexts", "[", RowBox[{ RowBox[{"DownValues", "[", "MultivariateMode", "]"}], ",", RowBox[{"ContextsOnly", "\[Rule]", " ", "True"}]}], "]"}]], "Input", CellChangeTimes->{{3.440353545489291*^9, 3.4403535490744467`*^9}, { 3.4403536466948175`*^9, 3.440353647485955*^9}, 3.4404415903506126`*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{"\<\"Statistics`DataManipulation`\"\>", ",", "\<\"Statistics`MultiDescriptiveStatistics`\"\>", ",", "\<\"Statistics`MultiDescriptiveStatistics`Private`\"\>", ",", "\<\"System`\"\>"}], "}"}]], "Output", CellChangeTimes->{3.4419630948448915`*^9}] }, Open ]], Cell["\<\ The next 3 inputs try to pass inappropriate options. If the option - \ protecting functionality is available and switched on, the function should \ print an error message and return $Failed. \ \>", "Text", CellChangeTimes->{{3.4410489557793856`*^9, 3.441049030566925*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"SymbolsContexts", "[", RowBox[{ RowBox[{"DownValues", "[", "MultivariateMode", "]"}], ",", RowBox[{"ContextsOnly", "\[Rule]", " ", "Trye"}]}], "]"}]], "Input", CellChangeTimes->{{3.441020647454013*^9, 3.4410206479447184`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"SymbolsContexts", "::", "\<\"badopt\"\>"}], RowBox[{ ":", " "}], "\<\"The option \\!\\(ContextsOnly \[Rule] Trye\\) is invalid. \ \\n\\t\\tThe pattern for the option's rhs to match is \\!\\(True | False\\) \ \"\>"}]], "Message", CellChangeTimes->{3.4419630975888367`*^9}], Cell[BoxData["$Failed"], "Output", CellChangeTimes->{3.4419630976188803`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"DependentSymbols", "[", RowBox[{"\"\\"", ",", RowBox[{"PropertiesToCheck", "\[Rule]", " ", "UpValues"}]}], "]"}], "\[IndentingNewLine]"}]], "Input", CellChangeTimes->{{3.440351748375168*^9, 3.4403517776372447`*^9}, 3.440355929337096*^9}], Cell[BoxData[ RowBox[{ RowBox[{"DependentSymbols", "::", "\<\"badopt\"\>"}], RowBox[{ ":", " "}], "\<\"The option \\!\\(PropertiesToCheck \[Rule] UpValues\\) is \ invalid. \\n\\t\\tThe pattern for the option's rhs to match is \\!\\(_List ? \ \\(\\((\\(\\(\\(\\(\\(Complement[\\(\\(#1, \\(\\({DownValues, \\(\\(\ \[LeftSkeleton] 6 \[RightSkeleton]\\)\\), DefaultValues}\\)\\)\\)\\)]\\)\\) \ === \\(\\({}\\)\\)\\)\\) &\\))\\)\\)\\) \"\>"}]], "Message", CellChangeTimes->{3.4419631023256483`*^9}], Cell[BoxData["$Failed"], "Output", CellChangeTimes->{3.4419631023657055`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"DependentSymbols", "[", RowBox[{"\"\\"", ",", RowBox[{"PropertiesToCheck", "\[Rule]", " ", RowBox[{"{", "NewProperty", "}"}]}]}], "]"}], "\[IndentingNewLine]"}]], "Input", CellChangeTimes->{{3.440351920783078*^9, 3.44035192568012*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"DependentSymbols", "::", "\<\"badopt\"\>"}], RowBox[{ ":", " "}], "\<\"The option \\!\\(PropertiesToCheck \[Rule] \ \\(\\({NewProperty}\\)\\)\\) is invalid. \\n\\t\\tThe pattern for the \ option's rhs to match is \\!\\(_List ? \ \\(\\((\\(\\(\\(\\(\\(Complement[\\(\\(#1, \\(\\({DownValues, \\(\\(\ \[LeftSkeleton] 6 \[RightSkeleton]\\)\\), DefaultValues}\\)\\)\\)\\)]\\)\\) \ === \\(\\({}\\)\\)\\)\\) &\\))\\)\\)\\) \"\>"}]], "Message", CellChangeTimes->{3.441963104138254*^9}], Cell[BoxData["$Failed"], "Output", CellChangeTimes->{3.4419631041883264`*^9}] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Shadowing", "Subsection", CellChangeTimes->{{3.4403559519796543`*^9, 3.440355956375976*^9}}, FontWeight->"Plain"], Cell["\<\ While the functionality of the present package mostly does not deal with \ shadowing (resolving shadowing is another problem), the predicate that tests \ whether or not a given symbol is shadowed, does logically belong here.\ \>", "Text", CellChangeTimes->{{3.440438851442256*^9, 3.4404389326390114`*^9}, { 3.4404416213852386`*^9, 3.4404416247000046`*^9}, {3.441868963115155*^9, 3.4418689636359043`*^9}}], Cell["\<\ Consider the following piece of code, that introduces a new symbol in \ the new context \"Test`\": \ \>", "Text", CellChangeTimes->{{3.4403528139574003`*^9, 3.4403528182535777`*^9}, { 3.44043895134591*^9, 3.4404390037512655`*^9}, {3.4404399524854784`*^9, 3.440439953106371*^9}}], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"Begin", "[", "\"\\"", "]"}], ";"}], "\[IndentingNewLine]", RowBox[{"Test`Map", ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Print", "[", RowBox[{"Names", "[", RowBox[{"$Context", "<>", "\"\<*\>\""}], "]"}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"End", "[", "]"}], ";"}]}], "Input", CellChangeTimes->{{3.4403525401937475`*^9, 3.440352573491627*^9}, { 3.44035278591708*^9, 3.4403528089502*^9}, 3.440353120598328*^9}], Cell[BoxData[ RowBox[{"{", "\<\"Test`Map\"\>", "}"}]], "Print", CellChangeTimes->{3.441963106151149*^9}] }, Open ]], Cell["\<\ This is innocent so far. We can check what are the contexts for < Map > now :\ \ \>", "Text", CellChangeTimes->{{3.4404390114823823`*^9, 3.4404390344654303`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"AllContexts", "[", "Map", "]"}]], "Input", CellChangeTimes->{{3.4404390431979876`*^9, 3.4404390434984193`*^9}}], Cell[BoxData[ RowBox[{"{", "\<\"System`\"\>", "}"}]], "Output", CellChangeTimes->{3.441963108404389*^9}] }, Open ]], Cell["We can also test shadowing with the ShadowedQ predicate:", "Text", CellChangeTimes->{{3.4404391139397087`*^9, 3.4404391397968893`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"ShadowedQ", "[", "Map", "]"}]], "Input", CellChangeTimes->{{3.4404391471374445`*^9, 3.440439151984414*^9}}], Cell[BoxData["False"], "Output", CellChangeTimes->{3.441963109856477*^9}] }, Open ]], Cell["\<\ The reason that Map is not shadowed is that the new context \"Test`\" is not \ on the search path. Consider :\ \>", "Text", CellChangeTimes->{{3.44043905208076*^9, 3.440439059401286*^9}, { 3.4404390967349696`*^9, 3.4404391104346685`*^9}, {3.440439160286352*^9, 3.440439190750157*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"MemberQ", "[", RowBox[{"$ContextPath", ",", "\"\\""}], "]"}]], "Input", CellChangeTimes->{{3.440439345392522*^9, 3.440439348246626*^9}, { 3.4404394310256557`*^9, 3.440439440839768*^9}}], Cell[BoxData["False"], "Output", CellChangeTimes->{3.4419631107177153`*^9}] }, Open ]], Cell["\<\ Now we import our context, and define in it another symbol that will conflict \ with an existing function :\ \>", "Text", CellChangeTimes->{{3.4403528247328944`*^9, 3.4403528314124994`*^9}, { 3.44043946417332*^9, 3.4404394819188366`*^9}}], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"BeginPackage", "[", "\"\\"", "]"}], ";"}], "\[IndentingNewLine]", "MultivariateMode", "\[IndentingNewLine]", RowBox[{"EndPackage", "[", "]"}]}], "Input", CellChangeTimes->{{3.440352732630458*^9, 3.4403527531900206`*^9}, { 3.440440092927424*^9, 3.440440093207827*^9}, {3.4410326605880513`*^9, 3.441032663832717*^9}, {3.4410360959578705`*^9, 3.441036097099512*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"MultivariateMode", "::", "\<\"shdw\"\>"}], RowBox[{ ":", " "}], "\<\"Symbol \\!\\(\\\"MultivariateMode\\\"\\) appears in \ multiple contexts \\!\\({\\\"Test`\\\", \ \\\"Statistics`MultiDescriptiveStatistics`\\\"}\\); definitions in context \ \\!\\(\\\"Test`\\\"\\) may shadow or be shadowed by other definitions. \\!\\(\ \\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \ ButtonFrame->None, ButtonData:>\\\"paclet:ref/message/General/shdw\\\", \ ButtonNote -> \\\"Test`MultivariateMode::shdw\\\"]\\)\"\>"}]], "Message", CellChangeTimes->{3.4419631123300333`*^9}], Cell[BoxData["MultivariateMode"], "Output", CellChangeTimes->{3.441963112360077*^9}] }, Open ]], Cell["Now the context \"Test`\" is on the search path :", "Text", CellChangeTimes->{{3.440439499544181*^9, 3.4404395146358814`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"MemberQ", "[", RowBox[{"$ContextPath", ",", "\"\\""}], "]"}]], "Input", CellChangeTimes->{{3.440439360303963*^9, 3.4404393669535246`*^9}, 3.440439496640005*^9}], Cell[BoxData["True"], "Output", CellChangeTimes->{3.4419631143929996`*^9}] }, Open ]], Cell["\<\ Our < AllContexts > function now shows that the above symbols belong to two \ different contexts :\ \>", "Text", CellChangeTimes->{{3.4404395649081697`*^9, 3.4404395981960354`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"AllContexts", "[", "MultivariateMode", "]"}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{"\<\"Test`\"\>", ",", "\<\"Statistics`MultiDescriptiveStatistics`\"\>"}], "}"}]], "Output", CellChangeTimes->{3.441963115604742*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"AllContexts", "[", "Map", "]"}]], "Input", CellChangeTimes->{{3.4404395315301743`*^9, 3.4404395327419167`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"\<\"Test`\"\>", ",", "\<\"System`\"\>"}], "}"}]], "Output", CellChangeTimes->{3.4419631170167727`*^9}] }, Open ]], Cell["\<\ Now both < Map > and < MultivariateMode > are shadowed, as the red \ highlighting in versions 6.0 + will indicate.\ \>", "Text", CellChangeTimes->{{3.4403528395141487`*^9, 3.4403528929610014`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"ShadowedQ", "[", "Map", "]"}]], "Input", CellChangeTimes->{{3.440352583726344*^9, 3.440352623133008*^9}}], Cell[BoxData["True"], "Output", CellChangeTimes->{3.4419631181183567`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"ShadowedQ", "[", "MultivariateMode", "]"}]], "Input", CellChangeTimes->{{3.440352919959824*^9, 3.4403529287124095`*^9}}], Cell[BoxData["True"], "Output", CellChangeTimes->{3.441963119480315*^9}] }, Open ]], Cell["\<\ Because < \"Test`\" > stands first, the \"correct\" functionality of the \ shadowed symbols is unavailable :\ \>", "Text", CellChangeTimes->{{3.440439558929573*^9, 3.4404395600812287`*^9}, { 3.4404396044149776`*^9, 3.440439642549813*^9}}], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"ClearAll", "[", "f", "]"}], ";"}], "\[IndentingNewLine]", RowBox[{"Map", "[", RowBox[{"f", ",", RowBox[{"Range", "[", "5", "]"}]}], "]"}]}], "Input", CellChangeTimes->{{3.4404395419050927`*^9, 3.4404395511383696`*^9}, { 3.440440011059704*^9, 3.4404400210741043`*^9}}], Cell[BoxData[ RowBox[{"f", "/@", RowBox[{"{", RowBox[{"1", ",", "2", ",", "3", ",", "4", ",", "5"}], "}"}]}]], "Output", CellChangeTimes->{3.44196312040164*^9}] }, Open ]], Cell["\<\ To get rid of malicious symbols in the \"Test`\" contexts, there are two \ ways. If we know exactly which symbols are causing harm, but their context(s) \ is/are to be kept loaded, then one can just Remove those symbols\ \>", "Text", CellChangeTimes->{{3.4403529743580446`*^9, 3.440353067151475*^9}, { 3.4404396708505073`*^9, 3.440439754580906*^9}, {3.4404400280441265`*^9, 3.44044005318027*^9}, {3.4404416930482845`*^9, 3.440441700689272*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"Remove", "[", RowBox[{"Test`Map", ",", "Test`MultivariateMode"}], "]"}], ";"}]], "Input",\ CellChangeTimes->{{3.4404397570544624`*^9, 3.4404397759516354`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Map", "[", RowBox[{"f", ",", RowBox[{"Range", "[", "5", "]"}]}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"f", "[", "1", "]"}], ",", RowBox[{"f", "[", "2", "]"}], ",", RowBox[{"f", "[", "3", "]"}], ",", RowBox[{"f", "[", "4", "]"}], ",", RowBox[{"f", "[", "5", "]"}]}], "}"}]], "Output", CellChangeTimes->{3.441963123516118*^9}] }, Open ]], Cell[TextData[{ "If the entire context has to be removed, my suggestion would be to use some \ tools that are designed for this purpose. For example, another package of \ mine, \"PackageManipulations`\" (that is, if you trust it:)), which has a \ function < PackageRemove > that does exactly that (I assume that it is placed \ in a directory where ", StyleBox["Mathematica", FontSlant->"Italic"], " can find it, for instance the same as where the present package resides)." }], "Text", CellChangeTimes->{{3.4404397803179135`*^9, 3.4404398512098513`*^9}, { 3.440440079337883*^9, 3.4404400796984015`*^9}, {3.440441713487675*^9, 3.4404417651419506`*^9}, {3.441869102405445*^9, 3.441869132308443*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"Needs", "[", "\"\\"", "]"}], ";"}]], "Input", CellChangeTimes->{{3.440439858540392*^9, 3.4404398686949935`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"?", "PackageRemove"}]], "Input", CellChangeTimes->{{3.4403529500430813`*^9, 3.4403529532476892`*^9}, { 3.440353173694677*^9, 3.4403531764686656`*^9}}], Cell[BoxData[ StyleBox["\<\"PackageRemove[context_String] completely removes all the \ \\ndefinitions of the package symbols from the system's namespace,\\nand \ updates the relevant system variables ($Packages, $ContextPath)\"\>", "MSG"]], "Print", "PrintUsage", CellChangeTimes->{3.441963126961072*^9}, CellTags->"Info3441934326-4844470"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"BeginPackage", "[", "\"\\"", "]"}], ";"}], "\[IndentingNewLine]", "MultivariateMode", "\[IndentingNewLine]", RowBox[{"EndPackage", "[", "]"}], "\[IndentingNewLine]"}], "Input", CellChangeTimes->{{3.440352732630458*^9, 3.4403527531900206`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"MultivariateMode", "::", "\<\"shdw\"\>"}], RowBox[{ ":", " "}], "\<\"Symbol \\!\\(\\\"MultivariateMode\\\"\\) appears in \ multiple contexts \\!\\({\\\"Test`\\\", \ \\\"Statistics`MultiDescriptiveStatistics`\\\"}\\); definitions in context \ \\!\\(\\\"Test`\\\"\\) may shadow or be shadowed by other definitions. \\!\\(\ \\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \ ButtonFrame->None, ButtonData:>\\\"paclet:ref/message/General/shdw\\\", \ ButtonNote -> \\\"Test`MultivariateMode::shdw\\\"]\\)\"\>"}]], "Message", CellChangeTimes->{3.441963128553362*^9}], Cell[BoxData["MultivariateMode"], "Output", CellChangeTimes->{3.441963128593419*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"ShadowedQ", "[", "MultivariateMode", "]"}]], "Input", CellChangeTimes->{{3.44035308534764*^9, 3.440353093809808*^9}}], Cell[BoxData["True"], "Output", CellChangeTimes->{3.4419631309367886`*^9}] }, Open ]], Cell[BoxData[ RowBox[{"PackageRemove", "[", "\"\\"", "]"}]], "Input", CellChangeTimes->{{3.4403529339499407`*^9, 3.4403529650546675`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"ShadowedQ", "[", "MultivariateMode", "]"}]], "Input"], Cell[BoxData["False"], "Output", CellChangeTimes->{3.441963132719352*^9}] }, Open ]] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell["Summary", "Section", CellChangeTimes->{{3.4419003136850605`*^9, 3.4419003160985312`*^9}}, FontWeight->"Plain"], Cell[TextData[{ "The package provides functionality for checking whether any symbol in a \ set of specified contexts does depend through its global properties on \ symbols from a given context. This may be useful for checking that there are \ no \"leaks\" of symbols through the namespaces, which may occur eventually, \ especially during the development of large projects. It may also be helpful \ in deciding whether it is safe to remove some of the presently loaded \ contexts at any given moment.\n\nThe package can also be used \tto monitor \ modifications introduced by some package to global properties/definitions of \ symbols in other contexts/packages, including possible overloading of System \ symbols. Finally, one can use it to monitor shadowing and test symbols for \ being shadowed. \n\nOne can use ", StyleBox["SearchedContexts[] ", FontWeight->"Bold", FontSlant->"Italic"], "to monitor the set of contexts being searched for dependencies. ", StyleBox["DependentSymbols", FontWeight->"Bold", FontSlant->"Italic"], " can be used to obtain a list of symbols in other contexts that depend on \ some symbols in a given context. A number of options are available to \ customize the workings of ", StyleBox["DependentSymbols", FontWeight->"Bold", FontSlant->"Italic"], ". Somewhat more specific information can be obtained by ", StyleBox["DependentSymbolsInDefinitions", FontWeight->"Bold", FontSlant->"Italic"], ", which allows to select from a list of symbols (given by their string \ names) those whose particular global property (DownValues etc)'s code \ contains some of the symbols from a given context. \n\nTo get a list of \ symbols (together with their contexts) that participate in building a given \ expression, one can use ", StyleBox["SymbolsContexts", FontWeight->"Bold", FontSlant->"Italic"], ". Optionally, it may return only the set of contexts where all \ expression-building symbols belong. \n\nThe ", StyleBox["AllContexts", FontWeight->"Bold", FontSlant->"Italic"], " function lists all the currently visible contexts (those on the search \ path), which have a given symbol. If there is more than one, the symbol is \ shadowed. The ", StyleBox["ShadowedQ", FontWeight->"Bold", FontSlant->"Italic"], " predicate tests more specifically for shadowing. " }], "Text", CellChangeTimes->{{3.441900334004278*^9, 3.4419005965117455`*^9}, { 3.441900630150115*^9, 3.4419008513081245`*^9}, {3.4419009302916975`*^9, 3.4419010734976177`*^9}, {3.4419011124736624`*^9, 3.4419012378539505`*^9}, {3.4419012714422483`*^9, 3.441901285662696*^9}, { 3.4419013164870195`*^9, 3.4419013611812863`*^9}, 3.4419105568840575`*^9, { 3.441910597883011*^9, 3.441910620765915*^9}, {3.441910657638936*^9, 3.441910664218397*^9}}] }, Open ]] }, Open ]] }, WindowSize->{1015, 651}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, ShowSelection->True, Magnification->1.5, FrontEndVersion->"6.0 for Microsoft Windows (32-bit) (April 28, 2007)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{ "Info3441934152-3443651"->{ Cell[11854, 347, 457, 7, 170, "Print", CellTags->"Info3441934152-3443651"]}, "Info3441934219-7942539"->{ Cell[46989, 1342, 457, 7, 170, "Print", CellTags->"Info3441934219-7942539"]}, "Info3441934291-5129878"->{ Cell[59003, 1679, 284, 5, 89, "Print", CellTags->"Info3441934291-5129878"]}, "Info3441934326-4844470"->{ Cell[74157, 2137, 346, 6, 116, "Print", CellTags->"Info3441934326-4844470"]} } *) (*CellTagsIndex CellTagsIndex->{ {"Info3441934152-3443651", 79491, 2275}, {"Info3441934219-7942539", 79602, 2278}, {"Info3441934291-5129878", 79714, 2281}, {"Info3441934326-4844470", 79825, 2284} } *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 445, 10, 159, "Subtitle"], Cell[CellGroupData[{ Cell[1060, 37, 278, 9, 156, "Subsection"], Cell[1341, 48, 147, 2, 41, "Subsubsection"], Cell[1491, 52, 390, 9, 31, "Subsubsection"] }, Open ]], Cell[CellGroupData[{ Cell[1918, 66, 121, 2, 105, "Section"], Cell[2042, 70, 777, 16, 213, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[2856, 91, 251, 8, 105, "Section"], Cell[CellGroupData[{ Cell[3132, 103, 176, 3, 54, "Subsection"], Cell[3311, 108, 529, 9, 90, "Text"], Cell[3843, 119, 396, 10, 118, "Input"], Cell[4242, 131, 113, 1, 41, "Text"], Cell[4358, 134, 209, 4, 43, "Input"], Cell[4570, 140, 128, 1, 41, "Text"], Cell[CellGroupData[{ Cell[4723, 145, 139, 2, 43, "Input"], Cell[4865, 149, 5633, 156, 301, "Print"] }, Open ]], Cell[10513, 308, 89, 1, 71, "Input"], Cell[10605, 311, 126, 1, 41, "Text"], Cell[CellGroupData[{ Cell[10756, 316, 338, 7, 98, "Input"], Cell[11097, 325, 310, 6, 68, "Output"] }, Open ]], Cell[11422, 334, 264, 5, 66, "Text"], Cell[CellGroupData[{ Cell[11711, 343, 140, 2, 43, "Input"], Cell[11854, 347, 457, 7, 170, "Print", CellTags->"Info3441934152-3443651"] }, Open ]], Cell[12326, 357, 258, 5, 66, "Text"], Cell[CellGroupData[{ Cell[12609, 366, 308, 7, 43, "Input"], Cell[12920, 375, 482, 11, 112, "Output"] }, Open ]], Cell[13417, 389, 234, 4, 66, "Text"], Cell[CellGroupData[{ Cell[13676, 397, 315, 8, 43, "Input"], Cell[13994, 407, 453, 10, 112, "Output"] }, Open ]], Cell[14462, 420, 228, 5, 41, "Text"], Cell[CellGroupData[{ Cell[14715, 429, 351, 9, 43, "Input"], Cell[15069, 440, 136, 4, 61, "Output"] }, Open ]], Cell[15220, 447, 324, 6, 66, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[15581, 458, 214, 3, 40, "Subsection"], Cell[15798, 463, 486, 8, 90, "Text"], Cell[16287, 473, 214, 4, 41, "Text"], Cell[CellGroupData[{ Cell[16526, 481, 181, 3, 43, "Input"], Cell[16710, 486, 3210, 88, 185, "Print"] }, Open ]], Cell[19935, 577, 236, 5, 41, "Text"], Cell[20174, 584, 463, 7, 66, "Text"], Cell[CellGroupData[{ Cell[20662, 595, 387, 7, 71, "Input"], Cell[21052, 604, 309, 7, 58, "Message"], Cell[21364, 613, 76, 1, 42, "Output"] }, Open ]], Cell[21455, 617, 224, 5, 41, "Text"], Cell[CellGroupData[{ Cell[21704, 626, 249, 4, 43, "Input"], Cell[21956, 632, 207, 5, 42, "Output"] }, Open ]], Cell[22178, 640, 313, 5, 66, "Text"], Cell[CellGroupData[{ Cell[22516, 649, 206, 4, 43, "Input"], Cell[22725, 655, 447, 9, 93, "Output"] }, Open ]], Cell[23187, 667, 177, 4, 41, "Text"], Cell[CellGroupData[{ Cell[23389, 675, 279, 6, 43, "Input"], Cell[23671, 683, 595, 11, 58, "Message"], Cell[24269, 696, 462, 9, 58, "Message"], Cell[24734, 707, 462, 9, 58, "Message"], Cell[25199, 718, 509, 10, 58, "Message"], Cell[25711, 730, 509, 10, 58, "Message"], Cell[26223, 742, 453, 9, 58, "Message"], Cell[26679, 753, 765, 14, 108, "Message"], Cell[27447, 769, 765, 14, 108, "Message"], Cell[28215, 785, 765, 14, 108, "Message"], Cell[28983, 801, 458, 9, 58, "Message"], Cell[29444, 812, 106, 2, 42, "Output"] }, Open ]], Cell[29565, 817, 120, 1, 41, "Text"], Cell[CellGroupData[{ Cell[29710, 822, 322, 5, 43, "Input"], Cell[30035, 829, 209, 5, 42, "Output"] }, Open ]], Cell[30259, 837, 236, 5, 41, "Text"], Cell[CellGroupData[{ Cell[30520, 846, 235, 4, 43, "Input"], Cell[30758, 852, 310, 7, 58, "Message"], Cell[31071, 861, 78, 1, 42, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[31186, 867, 152, 3, 43, "Input"], Cell[31341, 872, 311, 7, 58, "Message"], Cell[31655, 881, 76, 1, 42, "Output"] }, Open ]], Cell[31746, 885, 144, 1, 41, "Text"], Cell[CellGroupData[{ Cell[31915, 890, 177, 3, 43, "Input"], Cell[32095, 895, 73, 1, 42, "Output"] }, Open ]], Cell[32183, 899, 357, 6, 66, "Text"], Cell[CellGroupData[{ Cell[32565, 909, 175, 3, 43, "Input"], Cell[32743, 914, 113, 2, 42, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[32893, 921, 127, 2, 43, "Input"], Cell[33023, 925, 74, 1, 42, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[33134, 931, 152, 3, 43, "Input"], Cell[33289, 936, 447, 9, 93, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[33773, 950, 175, 3, 43, "Input"], Cell[33951, 955, 117, 2, 42, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[34105, 962, 125, 2, 43, "Input"], Cell[34233, 966, 75, 1, 42, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[34345, 972, 154, 3, 43, "Input"], Cell[34502, 977, 309, 7, 58, "Message"], Cell[34814, 986, 78, 1, 42, "Output"] }, Open ]], Cell[34907, 990, 411, 6, 115, "Text"], Cell[CellGroupData[{ Cell[35343, 1000, 204, 6, 43, "Input"], Cell[35550, 1008, 1141, 29, 162, "Output"] }, Open ]], Cell[36706, 1040, 124, 3, 41, "Text"], Cell[36833, 1045, 358, 9, 71, "Input"], Cell[37194, 1056, 26, 0, 41, "Text"], Cell[CellGroupData[{ Cell[37245, 1060, 204, 6, 43, "Input"], Cell[37452, 1068, 1180, 30, 162, "Output"] }, Open ]], Cell[38647, 1101, 20, 0, 41, "Text"], Cell[CellGroupData[{ Cell[38692, 1105, 110, 2, 43, "Input"], Cell[38805, 1109, 311, 7, 58, "Message"], Cell[39119, 1118, 410, 8, 32, "Message"], Cell[39532, 1128, 140, 3, 42, "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[39721, 1137, 242, 5, 40, "Subsection"], Cell[39966, 1144, 226, 5, 41, "Text"], Cell[CellGroupData[{ Cell[40217, 1153, 174, 3, 43, "Input"], Cell[40394, 1158, 619, 12, 88, "Message"] }, Open ]], Cell[41028, 1173, 429, 7, 90, "Text"], Cell[CellGroupData[{ Cell[41482, 1184, 823, 14, 71, "Input"], Cell[42308, 1200, 244, 6, 42, "Output"] }, Open ]], Cell[42567, 1209, 204, 4, 41, "Text"], Cell[CellGroupData[{ Cell[42796, 1217, 323, 6, 71, "Input"], Cell[43122, 1225, 221, 6, 32, "Message"], Cell[43346, 1233, 143, 3, 42, "Output"] }, Open ]], Cell[43504, 1239, 268, 5, 66, "Text"], Cell[43775, 1246, 498, 8, 90, "Text"], Cell[CellGroupData[{ Cell[44298, 1258, 340, 8, 43, "Input"], Cell[44641, 1268, 685, 19, 87, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[45363, 1292, 287, 7, 43, "Input"], Cell[45653, 1301, 970, 26, 112, "Output"] }, Open ]], Cell[46638, 1330, 183, 4, 41, "Text"], Cell[CellGroupData[{ Cell[46846, 1338, 140, 2, 43, "Input"], Cell[46989, 1342, 457, 7, 170, "Print", CellTags->"Info3441934219-7942539"] }, Open ]], Cell[CellGroupData[{ Cell[47483, 1354, 450, 9, 71, "Input"], Cell[47936, 1365, 531, 14, 93, "Output"] }, Open ]], Cell[48482, 1382, 269, 5, 66, "Text"], Cell[48754, 1389, 302, 5, 66, "Text"], Cell[CellGroupData[{ Cell[49081, 1398, 309, 7, 71, "Input"], Cell[49393, 1407, 255, 6, 42, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[49685, 1418, 254, 6, 71, "Input"], Cell[49942, 1426, 316, 7, 58, "Message"], Cell[50261, 1435, 143, 3, 42, "Output"] }, Open ]], Cell[50419, 1441, 142, 1, 41, "Text"], Cell[CellGroupData[{ Cell[50586, 1446, 494, 9, 71, "Input"], Cell[51083, 1457, 265, 6, 42, "Output"] }, Open ]], Cell[51363, 1466, 104, 1, 41, "Text"], Cell[CellGroupData[{ Cell[51492, 1471, 386, 7, 71, "Input"], Cell[51881, 1480, 154, 4, 42, "Output"] }, Open ]], Cell[52050, 1487, 356, 7, 66, "Text"], Cell[CellGroupData[{ Cell[52431, 1498, 216, 5, 43, "Input"], Cell[52650, 1505, 138, 3, 42, "Output"] }, Open ]], Cell[52803, 1511, 523, 8, 115, "Text"], Cell[CellGroupData[{ Cell[53351, 1523, 400, 8, 71, "Input"], Cell[53754, 1533, 182, 4, 42, "Output"] }, Open ]], Cell[53951, 1540, 402, 7, 90, "Text"], Cell[CellGroupData[{ Cell[54378, 1551, 443, 9, 98, "Input"], Cell[54824, 1562, 231, 6, 42, "Output"] }, Open ]], Cell[55070, 1571, 236, 5, 41, "Text"], Cell[55309, 1578, 564, 9, 90, "Text"], Cell[CellGroupData[{ Cell[55898, 1591, 479, 10, 98, "Input"], Cell[56380, 1603, 181, 4, 42, "Output"] }, Open ]], Cell[56576, 1610, 288, 6, 41, "Text"], Cell[CellGroupData[{ Cell[56889, 1620, 757, 16, 152, "Input"], Cell[57649, 1638, 212, 6, 42, "Output"] }, Open ]], Cell[57876, 1647, 239, 4, 66, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[58152, 1656, 287, 6, 40, "Subsection"], Cell[58442, 1664, 407, 7, 66, "Text"], Cell[CellGroupData[{ Cell[58874, 1675, 126, 2, 43, "Input"], Cell[59003, 1679, 284, 5, 89, "Print", CellTags->"Info3441934291-5129878"] }, Open ]], Cell[59302, 1687, 209, 4, 41, "Text"], Cell[CellGroupData[{ Cell[59536, 1695, 290, 7, 43, "Input"], Cell[59829, 1704, 1153, 34, 212, "Output"] }, Open ]], Cell[60997, 1741, 198, 4, 41, "Text"], Cell[CellGroupData[{ Cell[61220, 1749, 337, 6, 43, "Input"], Cell[61560, 1757, 296, 6, 68, "Output"] }, Open ]], Cell[61871, 1766, 285, 5, 66, "Text"], Cell[CellGroupData[{ Cell[62181, 1775, 261, 5, 43, "Input"], Cell[62445, 1782, 312, 7, 58, "Message"], Cell[62760, 1791, 78, 1, 42, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[62875, 1797, 320, 7, 98, "Input"], Cell[63198, 1806, 502, 9, 83, "Message"], Cell[63703, 1817, 78, 1, 42, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[63818, 1823, 320, 7, 98, "Input"], Cell[64141, 1832, 519, 10, 83, "Message"], Cell[64663, 1844, 78, 1, 42, "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[64790, 1851, 121, 2, 40, "Subsection"], Cell[64914, 1855, 421, 7, 66, "Text"], Cell[65338, 1864, 300, 6, 41, "Text"], Cell[CellGroupData[{ Cell[65663, 1874, 506, 13, 125, "Input"], Cell[66172, 1889, 106, 2, 32, "Print"] }, Open ]], Cell[66293, 1894, 173, 4, 41, "Text"], Cell[CellGroupData[{ Cell[66491, 1902, 136, 2, 43, "Input"], Cell[66630, 1906, 106, 2, 42, "Output"] }, Open ]], Cell[66751, 1911, 142, 1, 41, "Text"], Cell[CellGroupData[{ Cell[66918, 1916, 132, 2, 43, "Input"], Cell[67053, 1920, 74, 1, 42, "Output"] }, Open ]], Cell[67142, 1924, 300, 6, 41, "Text"], Cell[CellGroupData[{ Cell[67467, 1934, 223, 4, 43, "Input"], Cell[67693, 1940, 76, 1, 42, "Output"] }, Open ]], Cell[67784, 1944, 251, 5, 41, "Text"], Cell[CellGroupData[{ Cell[68060, 1953, 418, 7, 98, "Input"], Cell[68481, 1962, 620, 11, 83, "Message"], Cell[69104, 1975, 85, 1, 42, "Output"] }, Open ]], Cell[69204, 1979, 133, 1, 41, "Text"], Cell[CellGroupData[{ Cell[69362, 1984, 200, 4, 43, "Input"], Cell[69565, 1990, 75, 1, 42, "Output"] }, Open ]], Cell[69655, 1994, 192, 4, 41, "Text"], Cell[CellGroupData[{ Cell[69872, 2002, 79, 1, 43, "Input"], Cell[69954, 2005, 176, 4, 42, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[70167, 2014, 136, 2, 43, "Input"], Cell[70306, 2018, 143, 3, 42, "Output"] }, Open ]], Cell[70464, 2024, 208, 4, 41, "Text"], Cell[CellGroupData[{ Cell[70697, 2032, 130, 2, 43, "Input"], Cell[70830, 2036, 75, 1, 42, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[70942, 2042, 145, 2, 43, "Input"], Cell[71090, 2046, 73, 1, 42, "Output"] }, Open ]], Cell[71178, 2050, 251, 5, 41, "Text"], Cell[CellGroupData[{ Cell[71454, 2059, 315, 7, 71, "Input"], Cell[71772, 2068, 169, 4, 42, "Output"] }, Open ]], Cell[71956, 2075, 462, 8, 90, "Text"], Cell[72421, 2085, 200, 5, 43, "Input"], Cell[CellGroupData[{ Cell[72646, 2094, 112, 3, 43, "Input"], Cell[72761, 2099, 290, 8, 42, "Output"] }, Open ]], Cell[73066, 2110, 708, 12, 115, "Text"], Cell[73777, 2124, 175, 4, 43, "Input"], Cell[CellGroupData[{ Cell[73977, 2132, 177, 3, 43, "Input"], Cell[74157, 2137, 346, 6, 116, "Print", CellTags->"Info3441934326-4844470"] }, Open ]], Cell[CellGroupData[{ Cell[74540, 2148, 293, 5, 125, "Input"], Cell[74836, 2155, 618, 11, 83, "Message"], Cell[75457, 2168, 85, 1, 42, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[75579, 2174, 142, 2, 43, "Input"], Cell[75724, 2178, 75, 1, 42, "Output"] }, Open ]], Cell[75814, 2182, 148, 2, 43, "Input"], Cell[CellGroupData[{ Cell[75987, 2188, 77, 1, 43, "Input"], Cell[76067, 2191, 74, 1, 42, "Output"] }, Open ]] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell[76202, 2199, 118, 2, 105, "Section"], Cell[76323, 2203, 2794, 56, 562, "Text"] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)