Skip to content
/ equiv Public

Function for determining logical equivalence between statements

Notifications You must be signed in to change notification settings

tombch/equiv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

equiv

A function for determining if a set of statements are logically equivalent.

Usage

To compare any number of logical statements, first define them all as functions that take their variables as input.

Then, pass them into the equiv function.

Note: the variables of the statements are matched across the functions by their input variable names.

For example, to show that s1 : ¬(p \/ q) is logically equivalent to s2 : ¬p /\ ¬q:

from equiv import equiv


def s1(p, q):
    return not (p or q)


def s2(p, q):
    return (not p) and (not q)


print(equiv(s1, s2)) # True

About

Function for determining logical equivalence between statements

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages