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*)
|
(*logical implication*)
|
||||||
if a && b then
|
# let imply_if a b =
|
||||||
true
|
if a then b
|
||||||
else if not a && b then
|
else true;;
|
||||||
true
|
val imply_if: bool -> bool -> bool = <fun>
|
||||||
else if not a && not b then
|
|
||||||
true
|
(*logical exclusive or*)
|
||||||
else
|
let xor a b =
|
||||||
false
|
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
|
### Exercise 3.3
|
||||||
|
Loading…
x
Reference in New Issue
Block a user