Skip to content

Commit

Permalink
prop.gd: add "condition true → property false" implications
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfwilson committed Oct 27, 2021
1 parent ce01c04 commit 507c008
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 6 deletions.
38 changes: 38 additions & 0 deletions gap/prop.gd
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,41 @@ InstallTrueMethod(DigraphHasEdges, IsDigraph and DigraphHasLoops);
InstallTrueMethod(DigraphHasLoops, IsReflexiveDigraph and DigraphHasVertices);
InstallTrueMethod(DigraphHasVertices, IsDigraph and DigraphHasEdges);
InstallTrueMethod(DigraphHasVertices, IsDigraph and IsDirectedTree);

# Implications that something is false
InstallTrueMethod(HasDigraphHasLoops, IsAcyclicDigraph);
InstallTrueMethod(HasDigraphHasLoops, IsTournament);
InstallTrueMethod(HasDigraphHasLoops, IsUndirectedForest);
InstallTrueMethod(HasDigraphHasLoops, IsDirectedTree);
InstallTrueMethod(HasDigraphHasLoops, IsEmptyDigraph);
InstallTrueMethod(HasDigraphHasLoops, IsCompleteDigraph and DigraphHasEdges);
InstallTrueMethod(HasDigraphHasLoops, IsBipartiteDigraph);

# The following are valid, but unnecessary because of immediate methods
InstallTrueMethod(HasDigraphHasEdges, IsEmptyDigraph);
InstallTrueMethod(HasIsEmptyDigraph, IsDigraph and DigraphHasEdges);

InstallTrueMethod(HasIsAcyclicDigraph, IsCompleteDigraph and DigraphHasEdges);
InstallTrueMethod(HasIsAcyclicDigraph, IsDigraph and DigraphHasLoops);
InstallTrueMethod(HasIsAcyclicDigraph,
IsStronglyConnectedDigraph and DigraphHasEdges);
InstallTrueMethod(HasIsAntisymmetricDigraph,
IsCompleteDigraph and DigraphHasEdges);
InstallTrueMethod(HasIsChainDigraph, IsDigraph and DigraphHasLoops);
InstallTrueMethod(HasIsChainDigraph, IsSymmetricDigraph and DigraphHasEdges);
InstallTrueMethod(HasIsCompleteDigraph, IsDigraph and DigraphHasLoops);
InstallTrueMethod(HasIsReflexiveDigraph,
IsAcyclicDigraph and DigraphHasVertices);

InstallTrueMethod(HasIsSymmetricDigraph, IsAcyclicDigraph and DigraphHasEdges);
InstallTrueMethod(HasIsSymmetricDigraph, IsDirectedTree and DigraphHasEdges);
InstallTrueMethod(HasIsSymmetricDigraph, IsTournament and DigraphHasEdges);

InstallTrueMethod(HasIsMultiDigraph, IsChainDigraph);
InstallTrueMethod(HasIsMultiDigraph, IsCompleteDigraph);
InstallTrueMethod(HasIsMultiDigraph, IsCompleteMultipartiteDigraph);
InstallTrueMethod(HasIsMultiDigraph, IsCycleDigraph);
InstallTrueMethod(HasIsMultiDigraph, IsEmptyDigraph);
InstallTrueMethod(HasIsMultiDigraph, IsFunctionalDigraph);
InstallTrueMethod(HasIsMultiDigraph, IsTournament);
InstallTrueMethod(HasIsMultiDigraph, IsUndirectedForest);
4 changes: 0 additions & 4 deletions gap/prop.gi
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,6 @@ function(D)
return DigraphNrConnectedComponents(D) = 1;
end);

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

InstallImmediateMethod(IsAcyclicDigraph, "for a strongly connected digraph",
IsStronglyConnectedDigraph, 0,
D -> DigraphNrVertices(D) <= 1 and IsEmptyDigraph(D));
Expand Down
4 changes: 2 additions & 2 deletions tst/standard/prop.tst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#############################################################################
##
#W standard/prop.tst
#Y Copyright (C) 2014-17 James D. Mitchell
#Y Copyright (C) 2014-21 James D. Mitchell
## Wilf A. Wilson
##
## Licensing information can be found in the README file of this package.
Expand Down Expand Up @@ -139,7 +139,7 @@ gap> gr := Digraph([[1]]);;
gap> DigraphHasLoops(gr);
true
gap> HasIsAcyclicDigraph(gr);
false
true
gap> IsAcyclicDigraph(gr);
false
gap> gr := Digraph([[2], []]);
Expand Down

0 comments on commit 507c008

Please sign in to comment.