vault backup: 2023-09-07 15:20:06
This commit is contained in:
parent
b6db041ec7
commit
3f91501d0c
@ -107,14 +107,24 @@ val or_if: bool -> bool -> bool = <fun>
|
||||
|
||||
|
||||
(*logical implication*)
|
||||
if a && b then
|
||||
true
|
||||
else if not a && b then
|
||||
true
|
||||
else if not a && not b then
|
||||
true
|
||||
else
|
||||
false
|
||||
# let imply_if a b =
|
||||
if a then b
|
||||
else true;;
|
||||
val imply_if: bool -> bool -> bool = <fun>
|
||||
|
||||
(*logical exclusive or*)
|
||||
let xor a b =
|
||||
if a then
|
||||
if b then false else true
|
||||
else
|
||||
if b then true else false
|
||||
|
||||
(*logical equivalence = a b*)
|
||||
let equiv a b =
|
||||
if a then b
|
||||
else
|
||||
if b then false else true (*not b*)
|
||||
|
||||
```
|
||||
|
||||
### Exercise 3.3
|
||||
|
Loading…
x
Reference in New Issue
Block a user