2023-11-23 23:20:02 +03:00
|
|
|
---
|
|
|
|
source: tests/golden_tests.rs
|
2024-05-15 01:25:46 +03:00
|
|
|
input_file: tests/golden_tests/encode_pattern_match/bool.bend
|
2023-11-23 23:20:02 +03:00
|
|
|
---
|
2024-05-18 15:01:20 +03:00
|
|
|
Scott
|
2024-05-10 22:42:32 +03:00
|
|
|
(not) = λa (a bool/false bool/true)
|
2024-02-07 18:19:07 +03:00
|
|
|
|
2024-05-29 10:15:13 +03:00
|
|
|
(and) = λa (a λb (b bool/true bool/false) λd (d bool/false bool/false))
|
2024-02-13 22:34:32 +03:00
|
|
|
|
2024-05-29 10:15:13 +03:00
|
|
|
(and2) = λa (a λb b λd let * = d; bool/false)
|
2024-02-07 18:19:07 +03:00
|
|
|
|
2024-05-29 10:15:13 +03:00
|
|
|
(and3) = λa (a λb (b bool/true bool/false) λd let * = d; bool/false)
|
2024-02-07 18:19:07 +03:00
|
|
|
|
2024-05-29 10:15:13 +03:00
|
|
|
(and4) = λa (a λb (b bool/true bool/false) λd let * = d; bool/false)
|
2024-02-07 18:19:07 +03:00
|
|
|
|
2024-05-10 22:42:32 +03:00
|
|
|
(bool/true) = λa λ* a
|
2024-02-09 20:08:25 +03:00
|
|
|
|
2024-05-10 22:42:32 +03:00
|
|
|
(bool/false) = λ* λb b
|
2024-05-18 15:01:20 +03:00
|
|
|
|
|
|
|
NumScott
|
|
|
|
(not) = λa (a λb switch b { 0: bool/false; _: λ* bool/true; })
|
|
|
|
|
2024-05-29 10:15:13 +03:00
|
|
|
(and) = λa (a λb switch b { 0: λc (c λe switch e { 0: bool/true; _: λ* bool/false; }); _: λ* λf (f λh switch h { 0: bool/false; _: λ* bool/false; }); })
|
2024-05-18 15:01:20 +03:00
|
|
|
|
2024-05-29 10:15:13 +03:00
|
|
|
(and2) = λa (a λb switch b { 0: λc c; _: λ* λe let * = e; bool/false; })
|
2024-05-18 15:01:20 +03:00
|
|
|
|
2024-05-29 10:15:13 +03:00
|
|
|
(and3) = λa (a λb switch b { 0: λc (c λe switch e { 0: bool/true; _: λ* bool/false; }); _: λ* λf let * = f; bool/false; })
|
2024-05-18 15:01:20 +03:00
|
|
|
|
2024-05-29 10:15:13 +03:00
|
|
|
(and4) = λa (a λb switch b { 0: λc (c λe switch e { 0: bool/true; _: λ* bool/false; }); _: λ* λf let * = f; bool/false; })
|
2024-05-18 15:01:20 +03:00
|
|
|
|
2024-05-27 21:09:23 +03:00
|
|
|
(bool/true) = λa (a bool/true/tag)
|
2024-05-18 15:01:20 +03:00
|
|
|
|
2024-05-27 21:09:23 +03:00
|
|
|
(bool/false) = λa (a bool/false/tag)
|
|
|
|
|
|
|
|
(bool/true/tag) = 0
|
|
|
|
|
|
|
|
(bool/false/tag) = 1
|