Created
December 13, 2010 13:33
-
-
Save gclaramunt/738996 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LogicBoolean(val value:Boolean) { | |
import LogicBoolean.¬ | |
override def toString=value.toString | |
def V(b:LogicBoolean)=new LogicBoolean(this.value || b.value) | |
def Λ(b:LogicBoolean)=new LogicBoolean(this.value && b.value) | |
def →(b:LogicBoolean)=(¬(this)) V (this Λ b) | |
} | |
object LogicBoolean { | |
def ¬(a:LogicBoolean)=new LogicBoolean(!a.value) | |
implicit def boolToLogicBool(x:Boolean)=new LogicBoolean(x) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment