Skip to content

Commit

Permalink
prop.gd: tweak TrueMethods
Browse files Browse the repository at this point in the history
Make it more explicit (just to be safe) that these methods should
only apply to digraphs.

Also add a couple more.
  • Loading branch information
wilfwilson committed Jun 9, 2021
1 parent c2a6a5b commit af7bbd2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
17 changes: 11 additions & 6 deletions gap/prop.gd
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,14 @@ DeclareSynonymAttr("IsQuasiorderDigraph", IsPreorderDigraph);
DeclareOperation("DIGRAPHS_IsMeetJoinSemilatticeDigraph",
[IsHomogeneousList]);

InstallTrueMethod(IsAcyclicDigraph, IsChainDigraph);
InstallTrueMethod(IsAcyclicDigraph, IsDigraph and IsDirectedTree);
InstallTrueMethod(IsAcyclicDigraph, IsEmptyDigraph);
InstallTrueMethod(IsAcyclicDigraph, IsTournament and IsTransitiveDigraph);
InstallTrueMethod(IsAntisymmetricDigraph, IsAcyclicDigraph);
InstallTrueMethod(IsAntisymmetricDigraph, IsTournament);
InstallTrueMethod(IsAntisymmetricDigraph, IsDigraph and IsTournament);
InstallTrueMethod(IsBipartiteDigraph, IsCompleteBipartiteDigraph);
InstallTrueMethod(IsBipartiteDigraph, IsUndirectedForest);
InstallTrueMethod(IsBipartiteDigraph, IsDigraph and IsUndirectedForest);
InstallTrueMethod(IsCompleteMultipartiteDigraph, IsCompleteBipartiteDigraph);
InstallTrueMethod(IsConnectedDigraph, IsBiconnectedDigraph);
InstallTrueMethod(IsConnectedDigraph, IsStronglyConnectedDigraph);
Expand All @@ -88,19 +90,22 @@ InstallTrueMethod(IsHamiltonianDigraph,
InstallTrueMethod(IsInRegularDigraph, IsRegularDigraph);
InstallTrueMethod(IsOutRegularDigraph, IsRegularDigraph);
InstallTrueMethod(IsPreorderDigraph, IsPartialOrderDigraph);
InstallTrueMethod(IsReflexiveDigraph,
IsDigraph and IsVertexTransitive and DigraphHasLoops);
InstallTrueMethod(IsRegularDigraph, IsInRegularDigraph and IsOutRegularDigraph);
InstallTrueMethod(IsRegularDigraph, IsVertexTransitive);
InstallTrueMethod(IsRegularDigraph, IsDigraph and IsVertexTransitive);
InstallTrueMethod(IsStronglyConnectedDigraph,
IsConnectedDigraph and IsSymmetricDigraph);
InstallTrueMethod(IsStronglyConnectedDigraph, IsCycleDigraph);
InstallTrueMethod(IsStronglyConnectedDigraph, IsEulerianDigraph);
InstallTrueMethod(IsStronglyConnectedDigraph, IsHamiltonianDigraph);
InstallTrueMethod(IsStronglyConnectedDigraph, IsUndirectedTree);
InstallTrueMethod(IsStronglyConnectedDigraph, IsDigraph and IsUndirectedTree);
InstallTrueMethod(IsSymmetricDigraph, IsCompleteDigraph);
InstallTrueMethod(IsSymmetricDigraph, IsUndirectedForest);
InstallTrueMethod(IsSymmetricDigraph, IsDigraph and IsUndirectedForest);
InstallTrueMethod(IsTransitiveDigraph, IsTournament and IsAcyclicDigraph);
InstallTrueMethod(IsUndirectedForest, IsUndirectedTree);
InstallTrueMethod(IsUndirectedForest, IsDigraph and IsUndirectedTree);

InstallTrueMethod(DigraphHasEdges, IsDigraph and DigraphHasLoops);
InstallTrueMethod(DigraphHasLoops, IsReflexiveDigraph and DigraphHasVertices);
InstallTrueMethod(DigraphHasVertices, IsDigraph and DigraphHasEdges);
InstallTrueMethod(DigraphHasVertices, IsDigraph and IsDirectedTree);
4 changes: 0 additions & 4 deletions gap/prop.gi
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,6 @@ end);
InstallMethod(IsReflexiveDigraph, "for a digraph", [IsDigraph],
D -> ForAll(DigraphVertices(D), x -> IsDigraphEdge(D, x, x)));

InstallImmediateMethod(DigraphHasLoops, "for a reflexive digraph",
IsReflexiveDigraph, 0,
D -> DigraphNrVertices(D) > 0);

InstallMethod(DigraphHasLoops, "for a digraph with adjacency matrix",
[IsDigraph and HasAdjacencyMatrix],
function(D)
Expand Down

0 comments on commit af7bbd2

Please sign in to comment.