vault backup: 2023-09-07 15:03:14
This commit is contained in:
parent
613ea71e10
commit
b6db041ec7
@ -92,20 +92,19 @@ let f a b c =
|
|||||||
### Exercise 3.2
|
### Exercise 3.2
|
||||||
```OCaml
|
```OCaml
|
||||||
(*logical and*)
|
(*logical and*)
|
||||||
if a == b then
|
# let and_if a b =
|
||||||
true
|
if a then
|
||||||
else false
|
b
|
||||||
let and_if a b =
|
else false;;
|
||||||
|
val and_if: bool -> bool -> bool = <fun>
|
||||||
|
|
||||||
(*logical or*)
|
(*logical or*)
|
||||||
if a && b then
|
# let or_if a b =
|
||||||
true
|
if a then true
|
||||||
else if a && not b then
|
else b;;
|
||||||
true
|
|
||||||
else if not a && b then
|
val or_if: bool -> bool -> bool = <fun>
|
||||||
true
|
|
||||||
else
|
|
||||||
false
|
|
||||||
|
|
||||||
(*logical implication*)
|
(*logical implication*)
|
||||||
if a && b then
|
if a && b then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user