Message Boards Message Boards

2
|
19286 Views
|
33 Replies
|
29 Total Likes
View groups...
Share
Share this post:

Could Wolfram Language construct a network diagram of its functionality?

For example, a network diagram of pattern matching might have _ at the root and the List and ?NumberQ, etc. connected to it and then more complicated patterns connected to those, etc. I think I diagram of that sort could be quite useful.

POSTED BY: Frank Kampas
33 Replies

I cannot believe it! They made what I asked for a few months ago (i.e. WolframLanguageData[])..

Now I wish I could extend the meta-data system to create AntelopeData[] (or MySpecialData[]). That would extend the meta-data system itself. The next request after that would be to extend one of the datasets, such as the ability to add chemical compounds to ChemicalData[] or the like!

Anyways, thanks WRI team!

POSTED BY: Aeyoss Antelope

Great stuff. The LinkTrails property does not appear to be documented fully, though. It is used in ref/WolframLanguageData but it is not one of the listed properties in the details section.

POSTED BY: Seth Chandler

Due to release of new functionality WolframLanguageData there is another way of doing it. Let's take a look at only Graphics functions (one can generalize). Draw a directed network illustrating connectivity of Wolfram Language documentation reference (leaf nodes) and guide (internal nodes) pages:

graphicssym = EntityList[EntityClass["WolframLanguageSymbol", {"FunctionalityArea", "GraphicsFunctions"}]];

linktrails = EntityValue[graphicssym, 
   EntityProperty["WolframLanguageSymbol", "LinkTrails"]];

edges = Flatten[(DirectedEdge @@@ Partition[#, 2, 1]) & /@ 
    Select[Flatten[linktrails, 1], Length[#] > 1 &]];

verts = Flatten[List @@@ edges] // Union;

Graph[edges, VertexLabels -> Placed["Name", Tooltip], 
 VertexStyle -> ((# -> If[StringMatchQ[#, "*ref/*"], Red, Green]) & /@verts)]

enter image description here

Also fun related things:

WolframLanguageData["Cos", "RelationshipCommunityGraph"]

enter image description here

POSTED BY: Vitaliy Kaurov

When I was teaching Mathematica years ago, I started out with numbers, lists, symbols, patterns, rules, and functions, which I regarded as the fundamental components. I don't know how one would extract that sort of thing from the documentation.

POSTED BY: Frank Kampas
Posted 10 years ago

I expected this much since just the valid options for Graphics3D is probably a huge graph by itself.

If you include the options for all the functions and all of the constants (which any large system has), you get this type of graph. Anybody ever heard of PlotRangeClipping? Ever used it?

It would be no different than if you see the anatomy of a human elbow, with all of the skin, blood vessels, musculature, lymph nodes, bone, all displayed at once on one graph. Actually it would be very tough for most layman to understand. But if you could select a location in the elbow (maybe where it hurts) and through views or overlays, you could expose or mask different levels of detail, you might have a chance to find where to look for the root cause.

That's why what we need for this is: a set of annotated functions (not including options, constants) with a way to relate/group these and a way to traverse these groups

This is why I wanted to strip the constants (starts with '$') and all the options. I guess the options are in the See Also lists. :-(

POSTED BY: Aeyoss Antelope

Yes, what we're seeing is the infrastructure. I had no idea there was so much of it.

POSTED BY: Frank Kampas
Posted 10 years ago

This should be taken over by WRI and called MathematicaFunctionsData[]..

POSTED BY: Aeyoss Antelope

Where's Mathematica in this? What I see is almost entirely rarely used symbols from what used to be the "add-ons". Mathematica used to be factored rather than presented to the user as a big flat lump. These graphics are an excellent illustration of the fog that now obscures the core functionality. If you want to master Mathematica, this is the stuff you should generally ignore. Only use it when it's applicable to your very specific, specialized problem.

POSTED BY: John Doty

Marco, Bernat, I'm really impressed by what you've been able to do.

POSTED BY: Frank Kampas
Posted 10 years ago

Thanks for doing this Marco! I believe some of this data will help me learn more Mathematica...

POSTED BY: Aeyoss Antelope

Hi Everyone,

I also had the idea of using the documentation:

http://reference.wolfram.com/language/guide/AlphabeticalListing.html

It is easy to import all commands from that website:

helppages = Select[Import["http://reference.wolfram.com/language/guide/AlphabeticalListing.html", "Hyperlinks"], StringMatchQ[#, "http://reference.wolfram.com/language/ref/" ~~ __ ~~ ".html"] &];

The following function imports all the links to other functions in the "See Also" section. Please do not run this function to keep the load on Wolfram Inc's servers as low as possible. The data is attached below to this post. Sorry to Wolfram Inc for downloading all this, it was not a DoS attack :-)

Monitor[For[k = 1, k <= Length[helppages], k++, dummy = URLFetch[helppages[[k]]]; 
  AppendTo[links, helppages[[k]] \[DirectedEdge] "http://reference.wolfram.com/language/ref/" <> # <> ".html" & /@
     If[Length[StringSplit[dummy, "See Also"]] > 1, (StringSplit[StringJoin[StringSplit[StringSplit[StringSplit[StringSplit[dummy, "See Also"][[2]], "Related Guides"][[1]], "href=\""], "\"><span"]], {"/language/ref/", ".html"}][[2 ;; ;; 2]]), {}]]], N[k/Length[helppages]]]

It is a good idea to save the data:

Export["~/Desktop/MMA-funcs.txt", links]

The following lines work to import the data again from that file:

data = Import["~/Desktop/MMA-funcs.txt", "Plaintext"];
links = ToExpression@Delete[Delete[StringReplace[StringReplace[(# <> "]" & /@ (StringReplace[
          StringReplace[StringSplit[StringReplace[data, "}\n{" -> ","], "],"], {"{Directed" -> "Directed", "]}" -> "]"}], 
          "]" ~~ ___ ~~ "Directed" -> "], Directed"])),  ",Directed" -> "Directed"], "]]" -> "]"], 17648], 17647]

I will attach the txt-file to this post for everyone to play with. We can now graph the "relationship-graph" of all Mathematica functions.

g = Graph[DeleteDuplicates[links]]

enter image description here

One interesting thing is to calculate the Communities:

communities = FindGraphCommunities[g];

We can look at a couple of the smaller ones to see whether the network makes intuitive sense:

Grid[Table[
  StringSplit[StringSplit[#, "ref/"][[2]], ".html"][[1]] & /@ communities[[k]], {k, -25, -1}], Frame -> All]

enter image description here

Every row corresponds to one community. It appears that the communities make sense. The first row for examples is related to Graph commands. We can also plot the CommunityGraph:

CommunityGraphPlot[g, communities]

enter image description here

We can now also try to gauge the importance of different functions, here the 20 most important ones, for example using the BetweenessCentrality:

Grid[Reverse[SortBy[Transpose[{vertices, BetweennessCentrality[g]}], #[[2]] &]][[1 ;; 20]], Frame -> All]

enter image description here

We can compare that to the VertexDegree:

Grid[Reverse[SortBy[Transpose[{vertices, VertexDegree[g]}], #[[2]] &]][[1 ;; 20]], Frame -> All]

enter image description here

or else the PageRankCentrality:

Grid[Reverse[SortBy[Transpose[{vertices, PageRankCentrality[g, 0.85]}], #[[2]] &]][[1 ;; 20]], Frame -> All]

enter image description here

We see that in each of the cases "Graph" ranks very high. Of course we can now also look for specific functions like so:

Part[PageRankCentrality[g, 0.85], VertexIndex[g, "http://reference.wolfram.com/language/ref/" <> # <> ".html"]] & /@ {"ColorSeparate"}
(*{0.000265413}*)

Just replace the "ColorSeparate" by your favourite function. Another thing that I found interesting was the word cloud of all functions. I basically collect all instances of a function being an in- or out-vertex and applying the WordCloud function:

WordCloud[StringSplit[StringSplit[#, "/ref/"][[2]], ".html"][[1]] & /@ Flatten[{links[[All, 1]], links[[All, 2]]}]]

enter image description here

It was interesting for me that "Automatic" was so prominent. This becomes clear if we look at the VertexInDegree.

VertexInDegree[g, "http://reference.wolfram.com/language/ref/Automatic.html"]
(*93*)

as opposed to

VertexInDegree[g, "http://reference.wolfram.com/language/ref/Graph.html"]
(*76*)

and

VertexInDegree[g, "http://reference.wolfram.com/language/ref/Plot3D.html"]
(*14*)

I am quite aware that this post does not address the initial question, but I hope it is of some interest anyway.

Cheers,

M.

PS: Of course, you can now study everything hierarchically. For example we can take the largest Community:

g2 = Graph[Select[links, MemberQ[communities[[1]], #[[2]]] &]];

determine its Communities:

communities2 = FindGraphCommunities[g2];

and plot:

CommunityGraphPlot[g2, communities2]

enter image description here

Here are members of the respective sub-Communities:

StringSplit[StringSplit[communities2[[1]], "/ref/"][[All, 2]], ".html"][[All, 1]]

{"ClickPane", "AngularGauge", "ClockGauge", "VerticalGauge", "Slider", "VerticalSlider", "ProgressIndicator", "Locator", "Slider2D", "ColorSlider", "Control", "LocatorPane", "ControlsRendering", "Animate", "ListAnimate", "Manipulate", "Animator", "Dynamic", "AutorunSequencing", "ActionMenu", "ButtonBar", "PopupMenu", "DockedCells", "Bookmarks", "AnimationDirection", "Arrow", "Inset", "Arrowheads", "AnimationRunning", "Trigger", "Pause", "Manipulator", "BaselinePosition", "Antialiasing", "Rasterize", "AnySubset", "FormFunction", "FormObject", "CheckboxBar", "TogglerBar", "ListPicker", "AppearanceRules", "FormLayoutFunction", "Full", "AutoSpacing", "TextJustification", "Alignment", "TextAlignment", "AlignmentPoint", "Item", "ControlPlacement", "Axes", "AxesLabel", "Frame", "PlotLabel", "FrameLabel", "Background", "ImageMargins", "Pane", "Backward", "Bottom", "MenuView", "BarSpacing", "Spacings", "CellBaseline", "Blend", "BulletGauge", "Setter", "RadioButton", "Panel", "SetterBar", "TabView", "ContentPadding", "FrameMargins", "ImageSize", "GestureHandler", "EventHandler", "Refresh", "MousePosition", "Labeled", "ControlType", "CellMargins", "CellBracketOptions", "CellDingbat", "CellFrame", "CellDynamicExpression", "CellEventActions", "NotebookEventActions", "FrontEndEventActions", "CellFrameLabels", "CellFrameMargins", "CellFrameColor", "CellFrameLabelMargins", "CellLabelMargins", "OpenerView", "ColorSetter", "ColumnAlignments", "ItemSize", "ChartLabels", "Checkbox", "Toggler", "Opener", "RadioButtonBar", "ConstantImage", "FieldSize", "ContentSize", "Update", "Darker", "DataRange", "Dividers", "Delimiter", "FinishDynamic", "Setting", "DynamicWrapper", "FormTheme", "Forward", "ForwardBackward", "Framed", "FrameTicks", "FrameBox", "FrameBoxOptions", "BoxFrame", "FlipView", "SlideView", "PaneSelector", "ImageSizeAction", "GeoMarker", "GaugeFaceElementFunction", "GaugeFaceStyle", "GaugeFrameElementFunction", "GaugeMarkers", "HorizontalGauge", "GaugeFrameStyle", "GaugeStyle", "ScaleRangeStyle", "GrayLevel", "TouchPosition", "GridLines", "GeoBackground", "ThermometerGauge", "IntervalSlider", "Hue", "IconData", "ImageAspectRatio", "ImageCrop", "ImageDimensions", "InitializationCell", "ImageFormattingWidth", "$ImageFormattingWidth", "ImageResolution", "PageWidth", "format/JPEG", "format/GIF", "ImagePadding", "Text", "Magnify", "ImageResize", "RasterSize", "Magnification", "ImageScaled", "ImageSizeMultipliers", "PixelConstrained", "ItemStyle", "Scrollbars", "ItemAspectRatio", "LabelingFunction", "ListPickerBox", "ScrollPosition", "Large", "Lighter", "LocatorAutoCreate", "LocatorRegion", "Left", "LineIndent", "LineIndentMaxFraction", "Legended", "LegendFunction", "LegendMargins", "TouchscreenAutoZoom", "MinIntervalSize", "Medium", "NotebookDynamicExpression", "Overscript", "OverscriptBox", "PackingMethod", "Placed", "PreserveImageOptions", "PlotMarkers", "PlotRangeClipping", "PlotRangePadding", "PlotRegion", "Point", "PassEventsDown", "PassEventsUp", "PolarAxes", "PolarTicks", "RGBColor", "Right", "Raster", "RotateLabel", "RotationAction", "RoundingRadius", "RowAlignments", "Rectangle", "Scale", "Small", "ScaleRanges", "ScalingMatrix", "ScriptBaselineShifts", "ScriptSizeMultipliers", "Set", "SetDelayed", "SynchronousInitialization", "SynchronousUpdating", "TouchscreenControlPlacement", "Ticks", "TrackedSymbols", "TrackingFunction", "Tiny", "Top", "Underscript", "UpdateInterval", "WordCloud", "WordOrientation", "XYZColor"}

Using DeleteDuplicates on the links cleans up the graph considerably:

enter image description here

Attachments:
POSTED BY: Marco Thiel

Marco, this is amazing :-) Attached is an Interactive Graph of the Wolfram Language Documentation Center that I've created by adding tooltips and hyperlinks to your first CommunityGraph:

g = Graph[Map[Hyperlink[Tooltip[#, DirectedEdge[#[[1]], #[[2]]] &@Flatten[StringCases[{First[#], Last[#]}, "http://reference.wolfram.com/language/ref/" ~~ x__ ~~ ".html" -> x]]], Last[#]] &, DeleteDuplicates[links]]];
communities = FindGraphCommunities[g];
CommunityGraphPlot[g, communities]

Interactive Documentation Center Graph

This is an excellent way to explore and learn about new functions.

Enjoy!

Attachments:

Moderation Team note: sorry for the chronological offset of this post.


The functions whose names end in "Q" are not linguistically associated with PatternTest: they are simply functions that yield True or False (predicates). PatternTest may use any such function. It doesn't even need a name:

abs[x_?(# < 0 &)] := -x
abs[x_?(# >= 0 &)] := x

You may use predicates for classifying expressions, regardless of whether there's a PatternTest involved:

IntegerQ /@ {1, 1.5, x}

{True, False, False}

I think this question poorly conceived. Mathematica is not a language in the sense you want. The first rule of Mathematica is "Everything is an expression." Mathematica works by rewriting expressions it recognizes. Sometimes those transformations have side effects. The fundamental expression grammar is trivial, head[sequence]. There are several expression "forms" with more complex grammars, but those grammars are different and not fundamental. You can make meaningless juxtapositions of symbols meaningful by providing a replacement rule or suitably tagged definition. The symbols you think of as human input can also be the output of expression rewriting, and that's often the most effective way to solve problems.

POSTED BY: John Doty
Posted 10 years ago

Actually this is (still) not correct...it needs a custom NearestFunction[]....

POSTED BY: Aeyoss Antelope
Posted 10 years ago

This should come out using WolframLanguageData[Map, SeeAlsoList]

POSTED BY: Aeyoss Antelope
Posted 10 years ago

OK Frank and John:

It seems obvious that Mma cannot possibly attach any semantic meaning to the 3 leters "Map". It only looks up the 3-character symbol in the current Context and begins replacements.

But with all languages, syntax (which Mma is very concerned with) and semantics are in different domains. Certainly as we all work to learn more and more of Mma, the semantic meaning of various functions can be grouped in our minds as "closer" or "farther".

I got stuck on the idea of a visualization of this.

It is interesting to me that Wolfram wants everything to be "computable" but the help system of Mma itself is not computable. Maybe they can make WolframLanguageData[]. But the web is (computable) and Mma's help system is out on the web.

So I posit that a first approximation to this visualization is the "See Also" list of the Mma "man pages" on the web.

Inspired by the example I cited above, I have "sketched some code" in an attached notebook that:

Import[] the man page from the web (e.g. Import["http://reference.wolfram.com/language/ref/Map.html"] )

strips out the "See Also" list of functions

creates Graph[] rules

generates a network for that function

Notes:

Since "See Also" is human-curated, it probably also has limitations.

To run against all the functions, that code needs more error checking.

I could not figure out how to use FindClusters[], since I am not sure how to graph the functions names in 2D.

HTH.

Attachments:
POSTED BY: Aeyoss Antelope

Interesting. This is definitely along the lines I was thinking.

POSTED BY: Frank Kampas

It seems obvious that Mma cannot possibly attach any semantic meaning to the 3 leters "Map". It only looks up the 3-character symbol in the current Context and begins replacements.

Map is a perfect illustration of the difficulty. It's a pure expression rewriter. It certainly has semantics, but in:

Map[head, tails]

as far as I know, there are no restrictions on head and tails: any expression works. Therefore, Map is connected to the entire language.

POSTED BY: John Doty

Given the volume of the documentation, it should be possible to construct a map of the functionality.

In[1]:= Length[Names["*"]]

Out[1]= 5605

5605 is not that many things to deal with for modern machine learning techniques.

POSTED BY: Frank Kampas
Posted 10 years ago

My guess is that WRI has the documentation in some custom format that could easily be converted to some "computable" format. Maybe this is not prioritized.

POSTED BY: Aeyoss Antelope

I would expect that all the documentation was developed in Mathematica.

POSTED BY: Frank Kampas
Posted 10 years ago

To me, if it were, Information[] would emit something other than null.

POSTED BY: Aeyoss Antelope
Posted 10 years ago

Hello John:

Actually I completely agree with you.

But in my mind, the list of Mma functions I know are categorized with some custom meta-data, so that Map[] is closer to Apply[] than it is to NComputeChebyshevDoubleIntegral[]. For sure, you can do Map[] using this non-existent function.

Using this "See Also" metric over the space of functions is far from optimal. But a (correct) visualization using this metric would (I guess) be illuminative.

POSTED BY: Aeyoss Antelope

A network of the cross-references in the documentation won't help you understand the language itself. How could it make sense of the following?

ffmod[g12_][f_][state[n_, v_, {q1_, q2_}, out_]] := 
 state[n + 1, f[n], {q1 + v - b2q[out], q2 + g12*q1}, q2b[q2 + q1]]

This is part of a simulation of a delta-sigma modulator as an inhomogeneous iterated function system. But you can deconstruct it from the "everything is an expression" viewpoint. Note that b2q and q2b are defined functions, while state is an undefined head.

POSTED BY: John Doty
Posted 10 years ago

OK Frank and John:

It seems obvious that Mma cannot possibly attach any semantic meaning to the 3 leters "Map". It only looks up the 3-character symbol in the current Context and begins replacements.

But with all languages, syntax (which Mma is very concerned with) and semantics are in different domains. Certainly as we all work to learn more and more of Mma, the semantic meaning of various functions can be grouped in our minds as "closer" or "farther".

I got stuck on the idea of a visualization of this.

It is interesting to me that Wolfram wants everything to be "computable" but the help system of Mma itself is not computable. Maybe they can make WolframLanguageData[]. But the web is (computable) and Mma's help system is out on the web.

So I posit that a first approximation to this visualization is the "See Also" list of the Mma "man pages" on the web.

Inspired by the example I cited above, I have "sketched some code" in an attached notebook that:

Import[] the man page from the web (e.g. Import["http://reference.wolfram.com/language/ref/Map.html"] ) strips out the "See Also" list of functions creates Graph[] rules generates a network for that function

Since "See Also" is human-curated, it probably also has limitations.

To run against all the functions, that code needs more error checking.

I could not figure out how to use FindClusters[], since I am not sure how to graph the functions in 2D.

HTH.

Attachments:
POSTED BY: Aeyoss Antelope

I hear what you are saying, the replies stating that Mathematica looks for patterns in EXPRESSIONS doesn't mean it can't get from T initai to T final by way of another mesh all points in the complex are connected.

POSTED BY: jonathan lister

Consider:

Sin[IntegerQ[MatrixForm]]

Now, these symbols have no intended connection. Nevertheless, Mathematica accepts and even partially rewrites the expression:

Sin[False]

And, of course, there are several ways you could coax Mathematica to rewrite that if you choose.

Most expressions that fit the form head[sequence] are legitimate in Mathematica. Even many that throw errors are OK when wrapped in Quiet. So a "network diagram" for the "language" would be uninformative, since it's very nearly a fully connected graph. I suppose you could make a weighted diagram for somebody's specific programming style, but I expect that would mostly illuminate bad programming. Using Mathematica's power involves forging connections.

POSTED BY: John Doty
Posted 10 years ago

I thought the original goal of the question was to find some meta-data or annotation for each function that would allow a graph of semantically clustered functions to be constructed. Using that meta-data and Nearest[] could facilitate a classification and/or network of those functions..further down that path would be tool-tips with data from Information[] and links into the documentation. So far I cannot see any such meta-data.

POSTED BY: Aeyoss Antelope

The semantic clustering you seek does not exist, and seeking it will simply mislead you about the nature of Mathematica. "Everything is an expression." Start there.

POSTED BY: John Doty
Posted 10 years ago

I am not sure what you want to do with this info...

Information /@ Take[Names["*Q"], 5]
POSTED BY: Aeyoss Antelope

Yes, the definitions don't provide much more information than the name.

POSTED BY: Frank Kampas

Turns out there are a lot of pattern tests:

In[3]:= Names["*Q"]

Out[3]= {"AcyclicGraphQ", "AlgebraicIntegerQ", "AlgebraicUnitQ", \
"AntihermitianMatrixQ", "AntisymmetricMatrixQ", "ArgumentCountQ", \
"ArrayQ", "AssociationQ", "AtomQ", "BinaryImageQ", "BipartiteGraphQ", \
"BooleanQ", "BoundaryMeshRegionQ", "BoundedRegionQ", "BusinessDayQ", \
"ByteArrayQ", "ColorQ", "CompatibleUnitQ", "CompleteGraphQ", \
"CompositeQ", "ConnectedGraphQ", "ConstantRegionQ", \
"ContinuousTimeModelQ", "ControllableModelQ", "CoprimeQ", \
"DateObjectQ", "DaylightQ", "DayMatchQ", "DeviceOpenQ", \
"DiagonalizableMatrixQ", "DigitQ", "DirectedGraphQ", "DirectoryQ", \
"DiscreteTimeModelQ", "DisjointQ", "DispatchQ", \
"DistributionParameterQ", "DuplicateFreeQ", "EdgeCoverQ", "EdgeQ", \
"EllipticNomeQ", "EmptyGraphQ", "EulerianGraphQ", "EvenQ", \
"ExactNumberQ", "FileExistsQ", "FreeQ", "FrontEndSharedQ", \
"GeoWithinQ", "GraphQ", "GroupElementQ", "HamiltonianGraphQ", \
"HermitianMatrixQ", "HypergeometricPFQ", "ImageInstanceQ", "ImageQ", \
"IndefiniteMatrixQ", "IndependentEdgeSetQ", "IndependentVertexSetQ", \
"InexactNumberQ", "IntegerQ", "IntersectingQ", "IntervalMemberQ", \
"InverseEllipticNomeQ", "IrreduciblePolynomialQ", "IsomorphicGraphQ", \
"JavaObjectQ", "KEdgeConnectedGraphQ", "KernelSharedQ", "KeyExistsQ", \
"KeyFreeQ", "KeyMemberQ", "KnownUnitQ", "KVertexConnectedGraphQ", \
"LeapYearQ", "LegendreQ", "LetterQ", "LinkConnectedQ", "LinkReadyQ", \
"ListQ", "LoopFreeGraphQ", "LowerCaseQ", "MachineNumberQ", \
"ManagedLibraryExpressionQ", "MandelbrotSetMemberQ", "MarcumQ", \
"MatchLocalNameQ", "MatchQ", "MatrixQ", "MemberQ", "MeshRegionQ", \
"MixedGraphQ", "MultigraphQ", "NameQ", "NegativeDefiniteMatrixQ", \
"NegativeSemidefiniteMatrixQ", "NormalMatrixQ", "NumberQ", \
"NumericQ", "ObservableModelQ", "OddQ", "OptionQ", "OrderedQ", \
"OrthogonalMatrixQ", "OutputControllableModelQ", "PacletNewerQ", \
"PartitionsQ", "PathGraphQ", "PermutationCyclesQ", \
"PermutationListQ", "PlanarGraphQ", "PolynomialQ", \
"PositiveDefiniteMatrixQ", "PositiveSemidefiniteMatrixQ", \
"PossibleZeroQ", "PrimePowerQ", "PrimeQ", "PrintableASCIIQ", \
"ProcessParameterQ", "QHypergeometricPFQ", "QuadraticIrrationalQ", \
"QuantityQ", "RegionQ", "RegularlySampledQ", "RootOfUnityQ", \
"SameObjectQ", "SameQ", "SatisfiableQ", "SimpleGraphQ", \
"SquareFreeQ", "SquareMatrixQ", "StringContainsQ", "StringEndsQ", \
"StringFreeQ", "StringMatchQ", "StringQ", "StringStartsQ", "SubsetQ", \
"SymmetricMatrixQ", "SyntaxQ", "TautologyQ", "TensorQ", \
"TimeObjectQ", "TreeGraphQ", "TrueQ", "UnateQ", "UndirectedGraphQ", \
"UnitaryMatrixQ", "UnsameQ", "UpperCaseQ", "URLExistsQ", "ValueQ", \
"VectorQ", "VertexCoverQ", "VertexQ", "WeaklyConnectedGraphQ", \
"WeightedGraphQ"}

In[4]:= Length[%]

Out[4]= 157

I haven't figured out how get their definitions all at once. The following doesn't work:

(? #)& /@ Names["*Q"]
POSTED BY: Frank Kampas
Posted 10 years ago

If I wanted this, I would approach this like the following.

  1. get all of the names in the system...use something like words=Names["System`"];

  2. strip out all of the ones that begin with '$'

  3. use this graph code in the man page here: http://reference.wolfram.com/language/ref/Graph.html

(* Generate a network of "nearby" words in a dictionary *)

Flatten[Map[(Thread[# \[DirectedEdge] DeleteCases[Nearest[words, #, 3], #]]) &, words]];

Flatten[Map[(Thread[# \[DirectedEdge] DeleteCases[Nearest[words, #, 3], #]]) &, words]];

Graph[%, VertexLabels -> "Name", ImageSize -> 450]

To me what would tell more is a different Nearest[] that (somehow) shows near in functionality.

HTH.

POSTED BY: Aeyoss Antelope
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract