
#13038: implementation of Modus ponens and Modus tollens -------------------------------------+------------------------------------- Reporter: vanto | Owner: Type: feature request | Status: infoneeded Priority: normal | Milestone: Component: libraries/base | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by vanto): Here is the code[[BR]] a is v(p) and b is v(q) and the implies function is separate and can be used independently of the other functions.[[BR]] {{{ implies::Bool->Bool->Bool implies a b = (||) (not a) b mod_ponens :: Bool -> Bool -> Bool mod_ponens a b = if a==True && implies a b == True then True else False mod_tollens :: Bool -> Bool -> Bool mod_tollens a b = if b==False && implies a b == True then True else False }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13038#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler