Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

149
LINES

< > BotCompany Repo | #1025734 // Musings (philosophy bot test cases)

Document

1  
true
2  
3  
true => a & b
4  
5  
expect (a)
6  
expect (b)
7  
8  
---
9  
10  
theory (a human weighs between 80 and 400 pounds) {
11  
  $x is a human
12  
    & $x weighs $y pounds
13  
    => $y >= 80 & $y <= 400
14  
}
15  
  
16  
john is a human
17  
john weighs x pounds
18  
19  
expect (x >= 80)
20  
expect (x <= 400)
21  
22  
---
23  
24  
$x says (i weigh $y pounds)
25  
  => $x weighs $y pounds
26  
27  
(user 123) says (i weigh 50 pounds)
28  
29  
expect ((user 123) weighs 50 pounds)
30  
31  
---
32  
33  
import math
34  
35  
proc {
36  
  if (10 >= 5):
37  
    ok1
38  
  if (10 >= 20):
39  
    ok2
40  
}
41  
42  
expect ok1
43  
don't expect ok2
44  
45  
---
46  
47  
import math
48  
6 >= 5
49  
don't expect contradiction
50  
51  
---
52  
53  
import math
54  
5 >= 6
55  
expect contradiction
56  
57  
---
58  
59  
import bool
60  
61  
proc {
62  
  if false:
63  
    nothing
64  
  else if true:
65  
    yes
66  
}
67  
68  
expect yes
69  
don't expect nothing
70  
71  
---
72  
73  
import bool
74  
75  
proc {
76  
  if true:
77  
    nothing
78  
  else if true:
79  
    yes
80  
}
81  
82  
expect nothing
83  
don't expect yes
84  
85  
---
86  
87  
import bool
88  
89  
proc {
90  
  if false:
91  
    nothing
92  
  else if false:
93  
    yes
94  
}
95  
96  
don't expect nothing
97  
don't expect yes
98  
99  
---
100  
101  
import math
102  
103  
proc {
104  
  if (6 > 5):
105  
    ok1
106  
  if (5 > 5):
107  
    ok2
108  
}
109  
110  
expect ok1
111  
don't expect ok2
112  
113  
---
114  
115  
import math
116  
117  
proc {
118  
  if (4 < 5):
119  
    ok1
120  
  if (5 < 5):
121  
    ok2
122  
}
123  
124  
expect ok1
125  
don't expect ok2
126  
127  
---
128  
129  
import math
130  
131  
theory (weight change) {
132  
  $x weighs $y
133  
    & last time $x weighed $z
134  
    => proc {
135  
      if ($y < $z):
136  
        say (You lost weight)
137  
      else if ($y > $z):
138  
        say (You gained weight)
139  
      else:
140  
        say (You are stagnant)
141  
    }
142  
}
143  
144  
x weighs 45
145  
last time x weighed 50
146  
147  
expect (say (You lost weight))
148  
don't expect (say (You gained weight))
149  
don't expect (say (You are stagnant))

download  show line numbers   

Travelled to 8 computer(s): bhatertpkbcr, kncoksjjbkvx, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1025734
Snippet name: Musings (philosophy bot test cases)
Eternal ID of this version: #1025734/13
Text MD5: 474b9b9ab42174032e2dca94ced1ac9d
Author: stefan
Category: javax
Type: Document
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-16 23:17:02
Source code size: 1677 bytes / 149 lines
Pitched / IR pitched: No / No
Views / Downloads: 229 / 462
Version history: 12 change(s)
Referenced in: [show references]