]> Dogcows Code - chaz/p5-Acme-Test-LogicalEquivalence/commitdiff
Release Acme-Test-LogicalEquivalence 0.001 master
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Mon, 28 Nov 2016 08:22:18 +0000 (01:22 -0700)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Mon, 28 Nov 2016 08:22:18 +0000 (01:22 -0700)
  * Initial release

Changes
README.md

diff --git a/Changes b/Changes
index b621e9a5fbf59fe0ae658a6f8c7352ee57043a97..7499a14c5593bf58a5bc858016c7e63f1f42eb98 100644 (file)
--- a/Changes
+++ b/Changes
@@ -2,3 +2,7 @@ Revision history for Acme-Test-LogicalEquivalence.
 
 {{$NEXT}}
 
 
 {{$NEXT}}
 
+0.001     2016-11-28 01:21:57-07:00 MST7MDT
+
+  * Initial release
+
index 1333ed77b7e1ed056329cae96075dc558158ee69..6fac4f5efa58bc54816e880d2a5fab66ff4666c6 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1 +1,60 @@
-TODO
+# NAME
+
+Acme::Test::LogicalEquivalence - Test if expressions are logically equivalent
+
+# VERSION
+
+version 0.001
+
+# SYNOPSIS
+
+    use Test::More;
+    use Acme::Test::LogicalEquivalence qw(is_logically_equivalent);
+
+    # test two expressions with 2 variables using the special vars $a and $b
+    is_logically_equivalent(2, sub { $a && $b }, sub { $b && $a });
+
+    # same as above
+    is_logically_equivalent(2, sub { $_[0] && $_[1] }, sub { $_[1] && $_[0] });
+
+    # you can do as many vars as you like
+    is_logically_equivalent(3, sub { $_[0] || ($_[1] && $_[2]) },
+                               sub { ($_[0] || $_[1]) && ($_[0] || $_[2]) });
+
+    done_testing;
+
+# DESCRIPTION
+
+Some expressions are "logically equivalent" to other expressions, but it may not be easy to tell if
+one or both of the expressions are reasonably complicated. Or maybe you're like many other people
+and are too lazy to go through the effort... Either way, why not let your computer prove logical
+equivalence for you?
+
+# FUNCTIONS
+
+## is\_logically\_equivalent
+
+Test logical equivalence of two subroutines.
+
+    my $is_equivalent = is_logically_equivalent($numvars, &sub1, &sub2);
+
+This will execute both of the subroutines one or more times (depending on how many variables you
+specify) with different inputs. The subroutines shall be considered logically equivalent if, for all
+combinations of inputs, they both return the same thing.
+
+Returns true if the subroutines are logically equivalent, false otherwise.
+
+# SEE ALSO
+
+- What is logical equivalence? Start here: [https://en.wikipedia.org/wiki/Logical\_equivalence](https://en.wikipedia.org/wiki/Logical_equivalence)
+
+# AUTHOR
+
+Charles McGarvey <chazmcgarvey@brokenzipper.com>
+
+# COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2016 by Charles McGarvey.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
This page took 0.021257 seconds and 4 git commands to generate.