-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLebensohl.hs
More file actions
248 lines (233 loc) · 10.6 KB
/
Copy pathLebensohl.hs
File metadata and controls
248 lines (233 loc) · 10.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
module Topics.Lebensohl(topic) where
import Control.Monad(join)
import Action(extractLastCall, withholdBid)
import qualified Bids.Cappelletti as Capp
import qualified Bids.DONT as DONT
import qualified Bids.Lebensohl as Leb
import qualified Bids.Meckwell as MW
import qualified Bids.NaturalOneNotrumpDefense as Nat
import CommonBids(setOpener)
import EDSL(makePass)
import Output(Description, (.+))
import Situation(situation, (<~))
import qualified Terminology as T
import Topic(Topic, wrap, Situations, makeTopic)
ignoreOpps :: Situations
ignoreOpps = let
sit (overcall, response, overcallIs2C) = let
action = do
setOpener T.North
Leb.b1N
overcall
explanation =
"Partner opened a strong " .+ Leb.b1N .+ ", and RHO interfered " .+
"with the auction. However, their call didn't actually take up " .+
"any of our bidding room. Ignore it, and use our usual systems " .+
"over notrump" .+
(if overcallIs2C then " (double of " .+ overcall .+ " is Stayman)"
else mempty) .+ "."
in situation "ignr" action response explanation
in
-- East should be an unpassed hand to interfere over North's notrump.
wrap $ return sit <~ [ (DONT.b1NoX, Leb.b1NoX2C, False)
, (DONT.b1NoX, Leb.b1NoX2D, False)
, (DONT.b1NoX, Leb.b1NoX2H, False)
, (MW.b1NoX, Leb.b1NoX2C, False)
, (MW.b1NoX, Leb.b1NoX2D, False)
, (MW.b1NoX, Leb.b1NoX2H, False)
, (Capp.b1NoX, Leb.b1NoX2C, False)
, (Capp.b1NoX, Leb.b1NoX2D, False)
, (Capp.b1NoX, Leb.b1NoX2H, False)
, (DONT.b1No2C, Leb.b1No2CX, True)
, (DONT.b1No2C, Leb.b1No2C2D, True)
, (DONT.b1No2C, Leb.b1No2C2H, True)
, (MW.b1No2C, Leb.b1No2CX, True)
, (MW.b1No2C, Leb.b1No2C2D, True)
, (MW.b1No2C, Leb.b1No2C2H, True)
, (Capp.b1No2C, Leb.b1No2CX, True)
, (Capp.b1No2C, Leb.b1No2C2D, True)
, (Capp.b1No2C, Leb.b1No2C2H, True)
, (Nat.b1No2C, Leb.b1No2CX, True)
, (Nat.b1No2C, Leb.b1No2C2D, True)
, (Nat.b1No2C, Leb.b1No2C2H, True)
]
<~ [T.North, T.South, T.West]
<~ T.allVulnerabilities
signoff2 :: Situations
signoff2 = let
sit (overcall, response) = let
action = do
setOpener T.North
Leb.b1N
overcall
explanation =
"Partner opened a strong " .+ Leb.b1N .+ ", and RHO interfered " .+
"with the auction. We're so weak we don't even want to invite " .+
"to game, but we do have enough strength to suspect this is " .+
"our contract. Bid our suit at the 2 level, as signoff."
in situation "so2" action response explanation
in
wrap $ return sit <~ [ (DONT.b1No2D, Leb.b1No2D2H)
, (DONT.b1No2D, Leb.b1No2D2S)
-- If RHO shows both majors, don't bid a major!
--, (DONT.b1No2H, Leb.b1No2H2S)
, (MW.b1No2D, Leb.b1No2D2H)
, (MW.b1No2D, Leb.b1No2D2S)
, (MW.b1No2H, Leb.b1No2H2S)
-- If RHO shows both majors, don't bid a major!
--, (Capp.b1No2D, Leb.b1No2D2H)
--, (Capp.b1No2D, Leb.b1No2D2S)
, (Capp.b1No2H, Leb.b1No2H2S)
, (Nat.b1No2D, Leb.b1No2D2H)
, (Nat.b1No2D, Leb.b1No2D2S)
, (Nat.b1No2H, Leb.b1No2H2S)
]
-- East should be an unpassed hand to interfere.
<~ [T.North, T.South, T.West]
<~ T.allVulnerabilities
gameForce :: Situations
gameForce = let
sit (overcall, responses) dlr vul = let
action = do
setOpener T.North
Leb.b1N
overcall
explanation =
"Partner opened a strong " .+ Leb.b1N .+ ", and RHO interfered " .+
"with the auction. We're at least game-forcing, so should " .+
"bid our suit at the 3 level. Partner will bid naturally, and " .+
"we'll find a game (likely either our suit or notrump)."
inner response = situation "gfnat" action response explanation dlr vul
in return inner <~ responses
in
wrap . join $ return sit
<~ [ (Nat.b1No2D, [Leb.b1No2D3C, Leb.b1No2D3H, Leb.b1No2D3S])
, (Nat.b1No2H, [Leb.b1No2H3C, Leb.b1No2H3D, Leb.b1No2H3S])
, (Nat.b1No2S, [Leb.b1No2S3C, Leb.b1No2S3D, Leb.b1No2S3H])
, (DONT.b1No2D, [Leb.b1No2D3C, Leb.b1No2D3H, Leb.b1No2D3S])
-- Don't bid either major when the opponents have shown both
, (DONT.b1No2H, [Leb.b1No2H3C, Leb.b1No2H3D])
, (DONT.b1No2S, [Leb.b1No2S3C, Leb.b1No2S3D, Leb.b1No2S3H])
, (MW.b1No2D, [Leb.b1No2D3C, Leb.b1No2D3H, Leb.b1No2D3S])
, (MW.b1No2H, [Leb.b1No2H3C, Leb.b1No2H3D, Leb.b1No2H3S])
, (MW.b1No2S, [Leb.b1No2S3C, Leb.b1No2S3D, Leb.b1No2S3H])
-- Again, don't bid a major when RHO has them both. 3D should be
-- natural and not a cue bid, because you'd never want to have a
-- Stayman-like bid when RHO has shown both majors.
, (Capp.b1No2D, [Leb.b1No2D3C, Leb.b1No2H3D])
, (Capp.b1No2H, [Leb.b1No2H3C, Leb.b1No2H3D, Leb.b1No2H3S])
, (Capp.b1No2S, [Leb.b1No2S3C, Leb.b1No2S3D, Leb.b1No2S3H])
]
-- East should be an unpassed hand to interfere.
<~ [T.North, T.South, T.West]
<~ T.allVulnerabilities
signoff3 :: Situations
signoff3 = let
sit (overcall, relay, responses) dlr vul = let
inner response = let
action = do
setOpener T.North
Leb.b1N
_ <-overcall
withholdBid response
responseDescription :: Description
responseDescription =
if (T.removeAlert . extractLastCall $ response) == T.Pass
then "pass" .+ ""
else "bid " .+ response
explanation =
"Partner opened a strong " .+ Leb.b1N .+ ", and RHO " .+
"interfered with the auction. We're less-than-invitational, " .+
"and just want to sign off in partscore. However, we can't " .+
"do that at the 2 level any more. Make a lebensohl relay, " .+
"planning to " .+ responseDescription .+ " afterwards."
in situation "so3" action relay explanation dlr vul
in return inner <~ responses
in
wrap . join $ return sit
<~ [ (Nat.b1No2D, Leb.b1No2D2N,
[Leb.b1No2D2N3CP])
, (Nat.b1No2H, Leb.b1No2H2N,
[Leb.b1No2H2N3CP, Leb.b1No2H2N3C3D])
, (Nat.b1No2S, Leb.b1No2S2N,
[Leb.b1No2S2N3CP, Leb.b1No2S2N3C3D, Leb.b1No2S2N3C3H])
, (DONT.b1No2D, Leb.b1No2D2N,
[Leb.b1No2D2N3CP])
, (DONT.b1No2H, Leb.b1No2H2N,
-- Don't bid either major when the opponents have shown both
[Leb.b1No2H2N3CP, Leb.b1No2H2N3C3D])
, (DONT.b1No2S, Leb.b1No2S2N,
[Leb.b1No2S2N3CP, Leb.b1No2S2N3C3D, Leb.b1No2S2N3C3H])
, (MW.b1No2D, Leb.b1No2D2N,
[Leb.b1No2D2N3CP])
, (MW.b1No2H, Leb.b1No2H2N,
[Leb.b1No2H2N3CP, Leb.b1No2H2N3C3D])
, (MW.b1No2S, Leb.b1No2S2N,
[Leb.b1No2S2N3CP, Leb.b1No2S2N3C3D, Leb.b1No2S2N3C3H])
-- Again, don't bid a major when RHO has them both. 3D should be
-- natural and not a cue bid, because you'd never want to have a
-- Stayman-like bid when RHO has shown both majors.
, (Capp.b1No2D, Leb.b1NoBM2N,
[Leb.b1No2D2N3CP, Leb.b1No2H2N3C3D])
, (Capp.b1No2H, Leb.b1No2H2N,
[Leb.b1No2H2N3CP, Leb.b1No2H2N3C3D])
, (Capp.b1No2S, Leb.b1No2S2N,
[Leb.b1No2S2N3CP, Leb.b1No2S2N3C3D, Leb.b1No2S2N3C3H])
]
-- East should be an unpassed hand to interfere.
<~ [T.North, T.South, T.West]
<~ T.allVulnerabilities
completeRelay :: Situations
completeRelay = let
sit (overcall, relay) = let
action = do
setOpener T.South
Leb.b1N
_ <- overcall
_ <-relay
makePass -- TODO: prevent RHO from raising LHO's suit
explanation =
"We opened a strong " .+ Leb.b1N .+ ", and LHO interfered " .+
"with the auction. Partner made a lebensohl bid, and we " .+
"should complete the relay to see what they do next. Partner " .+
"is captain of the auction, and knows where we're going."
in situation "relay" action Leb.b1N2N3C explanation
in
wrap $ return sit
<~ [ (Nat.b1No2D, Leb.b1No2D2N)
, (Nat.b1No2H, Leb.b1No2H2N)
, (Nat.b1No2S, Leb.b1No2S2N)
, (DONT.b1No2D, Leb.b1No2D2N)
, (DONT.b1No2H, Leb.b1NoBM2N)
, (DONT.b1No2S, Leb.b1No2S2N)
, (MW.b1No2D, Leb.b1No2D2N)
, (MW.b1No2H, Leb.b1No2H2N)
, (MW.b1No2S, Leb.b1No2S2N)
-- Again, don't bid a major when RHO has them both. 3D should be
-- natural and not a cue bid, because you'd never want to have a
-- Stayman-like bid when RHO has shown both majors.
, (Capp.b1No2D, Leb.b1NoBM2N)
, (Capp.b1No2H, Leb.b1No2H2N)
, (Capp.b1No2S, Leb.b1No2S2N)
]
-- West should be an unpassed hand to interfere.
<~ [T.North, T.South, T.East]
<~ T.allVulnerabilities
-- TODO:
-- jump to 3N
-- relay to 3N (answer should be 2N planning to rebid 3N)
-- cue bid for Stayman
-- relay to cue bid (answer should be 2N planning to rebid the cue)
-- pass after relay and signoff
-- pass or bid game after relay and invite
topic :: Topic
topic = makeTopic
("lebensohl after interference over our " .+ T.Bid 1 T.Notrump)
"leb1N" situations
where
situations = wrap [ ignoreOpps
, signoff2
, signoff3
, gameForce
, completeRelay
]