Meet-forever / Haskell_Binary_Relation

🔍Haskell Binary Relation: Streamlined analysis of relations on sets - Empty, Universal, Reflexive, Symmetric, Antisymmetric, Transitive, Equivalence. Recreate Reflexive, Symmetric, Transitive Closures. Simplify relation analysis in Haskell for enhanced productivity. 🚀

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Haskell Binary Relation

Project idea and instruction taken from: PLC-Project2

"If there are two sets, and we want to check if there is any connection between the two, we use relations." -- Meet Patel

Available Relations

- Empty
- Universal
- Reflexive
- Symmetric
- Antisymmetric
- Transitive
- Equivalence 
"The closure of a subset is the result of a closure operator applied to the subset. The closure of a subset under some operations is the smallest subset that is closed under these operations. It is often called the span (for example linear span) or the generated set." -- Wikipedia

Available Closures

- Reflexive Closure
- Symmetric Closure
- Transitive Closure

Sample Run:

*Main> r1 = add (1,2) (add (2,3) (add (3,4) emptyBinaryRelation)) 
*Main> r2 = add (1,2) (add (3, 4) (add (2,3) emptyBinaryRelation))
*Main> reflexive r1
False
*Main> symmetric r2
False
*Main> r2' = symmetricClosure r2
*Main> symmetric r2'
True
*Main> toString r2'
"[(1,2),(2,1),(2,3),(3,2),(3,4),(4,3)]"

About

🔍Haskell Binary Relation: Streamlined analysis of relations on sets - Empty, Universal, Reflexive, Symmetric, Antisymmetric, Transitive, Equivalence. Recreate Reflexive, Symmetric, Transitive Closures. Simplify relation analysis in Haskell for enhanced productivity. 🚀

License:GNU General Public License v3.0


Languages

Language:Haskell 100.0%