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 Jun 9, 2021
1 parent af7bbd2 commit 4a8d83d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
37 changes: 37 additions & 0 deletions gap/prop.gd
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,40 @@ 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);

InstallTrueMethod(HasDigraphHasEdges, IsEmptyDigraph);

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(HasIsEmptyDigraph, IsDigraph and DigraphHasEdges);
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 @@ -189,10 +189,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 4a8d83d

Please sign in to comment.