Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object Prop {
- def simplify(prop : Prop) : Prop = {
- prop match {
- case Not(Or(a,b)) => simplify(And(Not(a),Not(b)))
- case Not(And(a,b)) => simplify(Or(Not(a),Not(b)))
- case Not(Not(a)) => simplify(a)
- case _ => {
- if (testSimp(prop)) simplify(prop)
- else prop
- }
- }
- }
- def testSimp (prop : Prop) : Boolean = {
- if (simplify(prop) == prop) false
- else true
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement