Skip to content

Instantly share code, notes, and snippets.

@gclaramunt
Created December 13, 2010 13:33
Show Gist options
  • Save gclaramunt/738996 to your computer and use it in GitHub Desktop.
Save gclaramunt/738996 to your computer and use it in GitHub Desktop.
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