I would like to automatically determine whether given object is Combinatorica or Mathematica 8.0 Graph.
It doesn't seem that FullForm has enough information to tell which one is which
(* output of Combinatorica`CompleteGraph[1] *)
Graph[List[],List[List[List[0,0]]]]
(* output of System`CompleteGraph[1] *)
Graph[List[1],List[]]
Mathematica, however, is able to tell them apart and renders one as a text string and another as visual object. Is there
- Way to view "hidden" information in expressions that doesn't show in FullForm
- Way to look at the rules Mathematica uses to render expressions?
Update: It seems that Head gives different result for two graphs even though displayed heads are identical. Defining function as f[a_System'Graph] and f[a_Combinatorica'Graph] results in correct version being called