"""Rigorous outward verifier for the pinned-small-prime model, version 2 (independent implementation). Units: integers in units 1/S, S = 2^28. Lower bounds rounded down, upper bounds rounded up. Two enclosure forms: * cell form (lo[i], hi[i]), i < M: lo[i] <= f(t) <= hi[i] for t in the open cell (i/M, (i+1)/M); * vertex form (lo[n], hi[n]), n <= M: piecewise-linear functions with knots at the mesh points, given by their vertex values, with PL_lo(t) <= f(t) <= PL_hi(t) for all t in (0,1] (right limits at 1/2 where stated). The convolution of two step functions is PL with knots at the mesh points; so the convolution of cell-form bounds of nonnegative functions yields vertex-form bounds: V[n] = (1/M) sum_{i+j=n-1} a_i b_j (exact integer products by a four-prime NTT, oracle-tested, then one directed rounding). Signed (x) nonnegative uses the positive/negative parts of the signed bounds. Linear combinations with exact dyadic coefficients are taken in vertex form (PL combination of PL bounds is a PL bound), and only then converted to cell form by vertex min/max. This avoids adding the within-cell variations of many terms that cancel. Model for the independent calculation: C_u = sum_w c_{u+w} K_w, G_z = chi C_z + sum_{v != 0} (-1)^{|v|} K_v * chi C_{z+v}, N(t) = sum_r c_r T_{r-e0}(t) = C^-_{e0}(t) + chi C_{e0}(t) + sum_{v != 0} (-2)^{|v|} (K_v * chi C_{e0+v})(t), parity = C^-_0(1) + C_0(1) + sum_{v != 0} (-2)^{|v|} (K_v * chi C_v)(1) + sum_j w_j theta_j (must be 0), h(s) = -N(1-s)/B(s), B = sum_j w_j T^R_j, J_0 = 1_small h/s, J_k = J_0 * R_k, giant value at observer z: -y [G_z(y) + hpart_z(y)], prime f(1) = -[G_0(1) + sum_j w_j Psi_j(1)]. usage: rverify2.py table.json M """ import sys, json, time, math import numpy as np from fractions import Fraction as Fr from itertools import product S = 2 ** 28 QBITS = 24 def sub(a, b): return tuple(x - y for x, y in zip(a, b)) def add(a, b): return tuple(x + y for x, y in zip(a, b)) def leq(a, b): return all(x <= y for x, y in zip(a, b)) def subvecs(r): return product(*(range(a + 1) for a in r)) def dyadic_scale(A, p): """exact outward bounds of (p/2^24)*[lo,hi] (elementwise), int64, no overflow (asserted).""" def fl(x, q): # floor(q*x / 2^24) xh = x >> 20; xl = x & ((1 << 20) - 1) Ah = q * xh; Bl = q * xl return (Ah >> 4) + ((((Ah & 15) << 20) + Bl) >> 24) lo, hi = A m = max(abs(int(lo.min())), abs(int(hi.max())), 1) assert abs(p) * ((m >> 20) + 1) < 2 ** 62 and abs(p) < 2 ** 40 c1 = fl(lo, p); c2 = fl(hi, p); d1 = -fl(lo, -p); d2 = -fl(hi, -p) return np.minimum(c1, c2), np.maximum(d1, d2) def ivadd(A, B, k=1): if k >= 0: return A[0] + k * B[0], A[1] + k * B[1] return A[0] + k * B[1], A[1] + k * B[0] def fadd(x, y, w=1): if w >= 0: return (x[0] + w * y[0], x[1] + w * y[1]) return (x[0] + w * y[1], x[1] + w * y[0]) class V2: def __init__(self, edges, M, coeffs, prof={2: 1, 3: -1}, log=print): from nttpy import conv_div self._conv = conv_div; self.nconv = 0; self.log = log self.edges = [Fr(e) for e in edges]; self.M = M; self.k = len(edges) - 1; self.prof = prof for e in self.edges: assert (e * M).denominator == 1 self.cut = [int(e * M) for e in self.edges]; self.half = M // 2 assert self.cut[-1] == self.half and 2 * self.half == M assert 2 * self.edges[0] >= self.edges[1] self.lo = self.edges[:-1]; self.hi = self.edges[1:] self.zero = (0,) * self.k; self.e0 = (1,) + (0,) * (self.k - 1) self.c = {} for r, v in coeffs.items(): p = int(round(v * 2 ** QBITS)) if p: self.c[r] = p def vconv(self, a, b, div, ceil): M = self.M; V = np.zeros(M + 1, dtype=np.int64) na = np.nonzero(a)[0]; nb = np.nonzero(b)[0] if len(na) == 0 or len(nb) == 0: return V a0, a1 = na[0], na[-1] + 1; b0, b1 = nb[0], nb[-1] + 1 if a0 + b0 >= M: return V a1 = min(a1, M - b0); b1 = min(b1, M - a0) L = max(a1 - a0, b1 - b0, min(a1 - a0 + b1 - b0 - 1, M - a0 - b0)) A = np.zeros(L, dtype=np.int64); B = np.zeros(L, dtype=np.int64) A[:a1 - a0] = a[a0:a1]; B[:b1 - b0] = b[b0:b1] out = self._conv(A, B, M * S * div, ceil); self.nconv += 1 n0 = a0 + b0 + 1; m = min(L, M + 1 - n0) V[n0:n0 + m] = out[:m] return V def pconv(self, A, B, div=1): # nonneg cell x nonneg cell -> vertex return self.vconv(A[0], B[0], div, 0), self.vconv(A[1], B[1], div, 1) def sconv(self, A, B): # signed cell x nonneg cell -> vertex pos = lambda x: np.maximum(x, 0); neg = lambda x: np.maximum(-x, 0) lo = self.vconv(pos(A[0]), B[0], 1, 0) - self.vconv(neg(A[0]), B[1], 1, 1) hi = self.vconv(pos(A[1]), B[1], 1, 1) - self.vconv(neg(A[1]), B[0], 1, 0) return lo, hi @staticmethod def cells(V): return np.minimum(V[0][:-1], V[0][1:]), np.maximum(V[1][:-1], V[1][1:]) def chi(self, A): # cell form, zero below 1/2 lo, hi = A[0].copy(), A[1].copy(); lo[:self.half] = 0; hi[:self.half] = 0 return lo, hi def zv(self): return np.zeros(self.M + 1, dtype=np.int64), np.zeros(self.M + 1, dtype=np.int64) def run(self): t0 = time.time(); M = self.M; half = self.half; cut = self.cut; k = self.k; lo, hi = self.lo, self.hi idx = np.arange(M, dtype=np.int64) def kern(a, b): l = np.zeros(M, dtype=np.int64); h = l.copy(); ix = idx[a:b] l[ix] = (S * M) // (ix + 1); h[ix] = -((-S * M) // ix) return l, h base = {b: kern(cut[b], cut[b + 1]) for b in range(k)} rough = kern(cut[1], half) def rec(i, rem): if i == k: yield (); return for n in range(int(rem / lo[i]) + 1): for t in rec(i + 1, rem - n * lo[i]): yield (n,) + t free = [r for r in rec(0, Fr(1)) if sum(a * b for a, b in zip(r, lo)) < 1 < sum(a * b for a, b in zip(r, hi))] for r in self.c: assert r in free, ('coefficient on infeasible box', r) obs = [z for z in rec(0, Fr(1, 2)) if any(z) and sum(a * b for a, b in zip(z, lo)) < Fr(1, 2)] U = [self.zero] + obs # parity direction candidates: all no-small boxes with >= 2 parts (coefficient may be zero) gcands = [tuple(g) for g in self.gcands] if getattr(self, 'gcands', None) else [r for r in free if r[0] == 0 and sum(r) >= 2] for g_ in gcands: assert g_ in free and g_[0] == 0 and sum(g_) >= 2 need = set(U) for r in list(self.c) + gcands: for v in subvecs(r): need.add(v) keepK = set(U) for g in gcands: for v in subvecs(g): keepK.add(v) Cu = {u: list(self.zv()) for u in U} # vertex form, only n >= half used Cm = {u: list(self.zv()) for u in (self.zero, self.e0)} Kcell = {}; Kvert = {} def accumulate(w, Vw): # Vw vertex bounds of K_w (|w| >= 2) for u in U: p = self.c.get(add(u, w)) if p is None: continue sc = dyadic_scale(Vw, p) Cu[u][0] += sc[0]; Cu[u][1] += sc[1] if u in Cm: if sum(w) % 2 == 0: Cm[u][0] += sc[0]; Cm[u][1] += sc[1] else: Cm[u][0] -= sc[1]; Cm[u][1] -= sc[0] nK = 0 def visit(w, Kc, Vw): nonlocal nK nK += 1 if sum(w) >= 2: accumulate(w, Vw) if w in keepK: Kcell[w] = Kc; Kvert[w] = Vw i = next((i for i in range(k) if w[i]), k) js = range(k) if w == self.zero else range(i + 1) for j in js: child = tuple(w[t] + (t == j) for t in range(k)) if child not in need: continue if w == self.zero: visit(child, base[j], None) else: V = self.pconv(Kc, base[j], div=child[j]) visit(child, self.cells(V), V) sys.setrecursionlimit(10000) visit(self.zero, None, None) self.log('K_w: %d vectors, %d convolutions, %.1f s' % (nK, self.nconv, time.time() - t0)) at1 = lambda V: (Fr(int(V[0][M]), S), Fr(int(V[1][M]), S)) # chi C_u in cell form (as convolution input) chiC = {u: self.chi(self.cells(Cu[u])) for u in U} # G_z vertex form (n >= half meaningful): chi C_z + sum_v (-1)^|v| K_v * chi C_{z+v} G = {z: [np.where(np.arange(M + 1) >= half, Cu[z][0], 0), np.where(np.arange(M + 1) >= half, Cu[z][1], 0)] for z in U} Nv = list(ivadd(Cm[self.e0], Cu[self.e0])) # C^-_e0 + chi C_e0 (t > 1/2 region used) par = fadd(at1(Cm[self.zero]), at1(Cu[self.zero])) # C^-_0(1) + C_0(1) for u in U: if not chiC[u][1].any() and not chiC[u][0].any(): continue for v in U: if v == self.zero or not leq(v, u): continue z = sub(u, v) Vx = self.sconv(chiC[u], Kcell[v]) G[z] = list(ivadd(G[z], Vx, (-1) ** sum(v))) if z == self.zero: par = fadd(par, at1(Vx), (-2) ** sum(v)) if z == self.e0: Nv = list(ivadd(Nv, Vx, (-2) ** sum(v))) if getattr(self, 'debug', False): tt = np.arange(M - cut[1], M - cut[0] + 1); wd = (Vx[1][tt] - Vx[0][tt]).max() / S; vv = np.abs(Vx[0][tt]).max() / S cw = (chiC[u][1] - chiC[u][0])[half:].max() / S; cv = np.abs(chiC[u][0][half:]).max() / S self.log(' N term v=%s weight %d: |val|<=%.3f vertex width %.3e ; input chiC_%s |val|<=%.2f cellwidth %.2e' % (v, (-2) ** sum(v), vv, wd, u, cv, cw)) if getattr(self, 'debug', False): tt = np.arange(M - cut[1], M - cut[0] + 1) self.log(' N base: C^-_e0 width %.3e, C_e0 width %.3e' % ((Cm[self.e0][1][tt]-Cm[self.e0][0][tt]).max()/S, (Cu[self.e0][1][tt]-Cu[self.e0][0][tt]).max()/S)) del Cu self.log('G_z, N, parity: %d convolutions, %.1f s' % (self.nconv, time.time() - t0)) # rough kernels R_j (vertex and cell), diagonal B = sum_j w_j T^R_j (t > 1/2) RV = {}; R = {1: rough} for j in (2, 3): RV[j] = self.pconv(R[j - 1], rough, div=j); R[j] = self.cells(RV[j]) TRV = {} for j in (2, 3): acc = self.zv() if j % 2 == 0: acc = (2 * RV[j][0], 2 * RV[j][1]) for v in range(1, j): if j - v < 2: continue acc = ivadd(acc, self.pconv(R[v], self.chi(R[j - v])), (-2) ** v) TRV[j] = acc BV = self.zv() for j, w in self.prof.items(): BV = ivadd(BV, TRV[j], w) Bc = self.cells(BV); Nc = self.cells(Nv) sm = np.arange(cut[0], cut[1]); tc = M - 1 - sm Blo = Bc[0][tc]; Bhi = Bc[1][tc]; Nlo = Nc[0][tc]; Nhi = Nc[1][tc] assert Blo.min() > 0 hlo = np.zeros(M, dtype=np.int64); hhi = np.zeros(M, dtype=np.int64) for a_i, i in enumerate(sm): a = -int(Nhi[a_i]); b = -int(Nlo[a_i]); bl = int(Blo[a_i]); bh = int(Bhi[a_i]) hlo[i] = min((a * S) // bl, (a * S) // bh); hhi[i] = max(-((-b * S) // bl), -((-b * S) // bh)) hw = (hhi[sm] - hlo[sm]) / S self.log('B in [%.6f, %.6f]; h in [%.6f, %.6f]; max cell width of h %.2e' % (Blo.min() / S, Bhi.max() / S, hlo[sm].min() / S, hhi[sm].max() / S, hw.max())) J0 = (np.zeros(M, dtype=np.int64), np.zeros(M, dtype=np.int64)) for i in sm: kl = (S * M) // (i + 1); kh = -((-S * M) // i) ps = [int(hlo[i]) * kl, int(hlo[i]) * kh, int(hhi[i]) * kl, int(hhi[i]) * kh] J0[0][i] = min(ps) // S; J0[1][i] = -((-max(ps)) // S) J = {0: J0}; JV = {} for j in (1, 2, 3): JV[j] = self.sconv(J0, R[j]); J[j] = self.cells(JV[j]) chiR2 = self.chi(R[2]); chiR3 = self.chi(R[3]); chiJ1 = self.chi(J[1]); chiJ2 = self.chi(J[2]) A1 = self.sconv(chiJ1, R[1]); A2 = self.sconv(chiJ2, R[1]); A3 = self.sconv(chiJ1, R[2]) A4 = self.sconv(J0, chiR2); A5 = self.sconv(J0, chiR3); A6 = self.sconv(J[1], chiR2) geh = lambda V: (np.where(np.arange(M + 1) >= half, V[0], 0), np.where(np.arange(M + 1) >= half, V[1], 0)) def vs(terms): acc = self.zv() for V, w in terms: acc = ivadd(acc, V, w) return acc PsiV = {1: geh(JV[1]), 2: vs([(geh(JV[2]), 1), (A1, -1), (A4, -1)]), 3: vs([(geh(JV[3]), 1), (A2, -1), (A3, 1), (A5, -1), (A6, 1)])} th2 = fadd(fadd((Fr(0), Fr(0)), at1(A1), -2), at1(A4), -2) th3 = (Fr(0), Fr(0)) for V, w in [(JV[3], 2), (A2, -2), (A3, 4), (A5, -2), (A6, 4)]: th3 = fadd(th3, at1(V), w) theta = fadd(fadd((Fr(0), Fr(0)), th2, self.prof.get(2, 0)), th3, self.prof.get(3, 0)) partot = fadd(par, theta) # P_b vertex: P_0 = chi R_2 - chi R_3 + R_1*chi R_2 ; P_1 = -chi R_2 RR = self.pconv(R[1], chiR2) P0 = vs([(geh(RV[2]), 1), (geh(RV[3]), -1), (RR, 1)]); P1 = (-geh(RV[2])[1], -geh(RV[2])[0]) Pbc = {0: self.cells(P0), 1: self.cells(P1)} # parity direction: best separated t_g = T_g(1) best = None for g in gcands: tg = fadd((Fr(0), Fr(0)), at1(Kvert[g]), 1 + (-1) ** sum(g)) for v in subvecs(g): if v == self.zero or v == g: continue w_ = sub(g, v) if sum(w_) < 2: continue tg = fadd(tg, at1(self.pconv(Kcell[v], self.chi(Kcell[w_]))), (-2) ** sum(v)) if tg[0] * tg[1] > 0: sep = min(abs(tg[0]), abs(tg[1])) if best is None or sep > best[0]: best = (sep, g, tg) _, g, tg = best q = sorted([-partot[0] / tg[0], -partot[0] / tg[1], -partot[1] / tg[0], -partot[1] / tg[1]]) ts = (q[0], q[-1]) self.log('parity residual [%.4e, %.4e] (theta [%.5f, %.5f]); direction %s t_g [%.6f, %.6f]; correction [%.5e, %.5e]' % (float(partot[0]), float(partot[1]), float(theta[0]), float(theta[1]), g, float(tg[0]), float(tg[1]), float(ts[0]), float(ts[1]))) def LV(d): # vertex form of L_d = chi K_d + sum_{v != 0,d} (-1)^|v| K_v * chi K_{d-v} acc = self.zv() if sum(d) < 2: return acc acc = ivadd(acc, geh(Kvert[d]), 1) for v in subvecs(d): if v == self.zero or v == d: continue w_ = sub(d, v) if sum(w_) < 2: continue acc = ivadd(acc, self.pconv(Kcell[v], self.chi(Kcell[w_])), (-1) ** sum(v)) return acc LG = {z: LV(sub(g, z)) for z in U if leq(z, g)} # ---------- prime ---------- H01 = (Fr(0), Fr(0)) for j, w in self.prof.items(): H01 = fadd(H01, at1(PsiV[j]), w) Lg1 = at1(LG[self.zero]); pp = [a * b for a in ts for b in Lg1] Gp = fadd(fadd(at1(G[self.zero]), H01), (min(pp), max(pp))) prime = (-Gp[1], -Gp[0]) assert prime[1] < 0 self.log('prime value in [%.7f, %.7f]' % (float(prime[0]), float(prime[1]))) # ---------- nonprime values ---------- vmin = Fr(0); vmax = Fr(0); wmin = wmax = ('baseline 0',) def upd(a, b, tag_lo, tag_hi): nonlocal vmin, vmax, wmin, wmax if a < vmin: vmin = a; wmin = tag_lo if b > vmax: vmax = b; wmax = tag_hi def sparse(arr, fn): lv = [arr.astype(np.float64)]; w = 1 while 2 * w <= len(arr): lv.append(fn(lv[-1][:-w], lv[-1][w:])); w *= 2 def q_(a, b): ln = b - a + 1 L = np.array([int(x).bit_length() - 1 for x in ln]) assert np.all((1 << L) <= ln) and np.all(ln < (2 << L)) out = np.empty(len(a)) for l in np.unique(L): s_ = L == l; out[s_] = fn(lv[l][a[s_]], lv[l][b[s_] + 1 - (1 << l)]) return out return q_ qmin = sparse(hlo, np.minimum); qmax = sparse(hhi, np.maximum) nfree = 0 for r in free: cv = Fr(self.c.get(r, 0), 2 ** QBITS); iv = (cv, cv) if r == g: iv = (cv + ts[0], cv + ts[1]) j = sum(r) - r[0] if r[0] == 1 and self.prof.get(j, 0): rl = sum(a * b for a, b in zip(r[1:], lo[1:])); rh = sum(a * b for a, b in zip(r[1:], hi[1:])) i0 = max(cut[0], int((1 - rh) * M) - 1); i1 = min(cut[1] - 1, int((1 - rl) * M)) if i0 > i1: continue hl = Fr(int(hlo[i0:i1 + 1].min()), S); hh = Fr(int(hhi[i0:i1 + 1].max()), S) iv = fadd(iv, (hl, hh), self.prof[j]) nfree += 1 upd(iv[0], iv[1], ('free', r), ('free', r)) REL = 2.0 ** -45; ABS = 2.0 ** -28 nobs = 0 for z in obs: zl = sum(a * b for a, b in zip(z, lo)); zh = sum(a * b for a, b in zip(z, hi)) n0 = max(half, int((1 - zh) * M)); n1 = int((1 - zl) * M) if n1 <= n0: continue ns = np.arange(n0, n1) br = G[z] if z in LG: # ts * L_{g-z}, exact: ts endpoints are rationals; bound with python ints on the needed range Ll, Lh = LG[z][0][n0:n1 + 1], LG[z][1][n0:n1 + 1] # ts rounded outward to dyadics p/2^30, then exact floor/ceil of x*p/2^30 by 32-bit splitting pl_ = math.floor(ts[0] * 2 ** 30); ph_ = math.ceil(ts[1] * 2 ** 30) assert abs(pl_) < 2 ** 30 and abs(ph_) < 2 ** 30 and max(abs(int(Ll.min())), abs(int(Lh.max()))) < 2 ** 60 def mul30(x, p, up): if up: return -mul30(x, -p, 0) xh = x >> 32; xl = x & ((1 << 32) - 1) return xh * p * 4 + ((xl * p) >> 30) c1 = np.minimum.reduce([mul30(Ll, pl_, 0), mul30(Lh, pl_, 0), mul30(Ll, ph_, 0), mul30(Lh, ph_, 0)]) c2 = np.maximum.reduce([mul30(Ll, pl_, 1), mul30(Lh, pl_, 1), mul30(Ll, ph_, 1), mul30(Lh, ph_, 1)]) corr = (np.zeros(M + 1, dtype=np.int64), np.zeros(M + 1, dtype=np.int64)) corr[0][n0:n1 + 1] = c1; corr[1][n0:n1 + 1] = c2 br = ivadd(br, corr) b = sum(z) - z[0] if z[0] == 0: for j, w in self.prof.items(): if j - b >= 1: br = ivadd(br, PsiV[j - b], w) bc = self.cells(br) blo = bc[0][ns].astype(np.float64); bhi = bc[1][ns].astype(np.float64) if z[0] == 1 and b <= 1: rlo = zl - lo[0]; rhi = zh - hi[0] rloM = int(rlo * M); rhiM = int(rhi * M) i0 = np.maximum(cut[0], M - ns - 1 - rhiM - 1); i1 = np.minimum(cut[1] - 1, M - ns - rloM) ok = i0 <= i1 ns = ns[ok]; blo = blo[ok]; bhi = bhi[ok]; i0 = i0[ok]; i1 = i1[ok] hl = qmin(i0, i1); hh = qmax(i0, i1) pl = Pbc[b][0][ns].astype(np.float64); ph = Pbc[b][1][ns].astype(np.float64) qq = np.array([hl * pl, hl * ph, hh * pl, hh * ph]) / S blo = blo + qq.min(0) - np.abs(qq).max(0) * REL - 1; bhi = bhi + qq.max(0) + np.abs(qq).max(0) * REL + 1 if len(ns) == 0: continue y0 = ns / M; y1 = (ns + 1) / M cand = np.array([-y0 * blo, -y0 * bhi, -y1 * blo, -y1 * bhi]) / S vl = cand.min(0); vh = cand.max(0) vl = vl - np.abs(vl) * REL - ABS; vh = vh + np.abs(vh) * REL + ABS il = int(np.argmin(vl)); ih = int(np.argmax(vh)) upd(Fr(vl[il]), Fr(vh[ih]), ('obs', z, round(float(ns[il]) / M, 6)), ('obs', z, round(float(ns[ih]) / M, 6))) nobs += len(ns) cap = 1 + vmax / (-prime[1]); reserve = vmin - prime[1] self.log('free boxes %d, observed giant cells %d; nonprime values in [%.7f, %.7f]; lowest at %s; highest at %s' % (nfree, nobs, float(vmin), float(vmax), wmin, wmax)) self.log('positivity reserve (min nonprime - max prime) = %.7f ; cap upper bound = %.7f ; %d convolutions ; %.1f s' % (float(reserve), float(cap), self.nconv, time.time() - t0)) return dict(prime=prime, vmin=vmin, vmax=vmax, cap=cap, reserve=reserve, g=g, ts=ts) if __name__ == '__main__': d = json.load(open(sys.argv[1])); M = int(sys.argv[2]) co = {tuple(map(int, k.split(','))): v for k, v in d['coefficients'].items()} V = V2(d['edges'], M, co, log=lambda *a: print(*a, flush=True)) # provenance only: rank parity directions by a float estimate of t_g = T_g(1) (fmodel, N=8000); the verifier # then encloses t_g rigorously for the top three and keeps the best separated one from fmodel import Model fm = Model([Fr(e) for e in d["edges"]], 8000) cand = sorted([r for r in fm.free if r[0] == 0 and sum(r) >= 2], key=lambda r: -abs(fm.T[r][8000]))[:3] V.gcands = cand V.debug = len(sys.argv) > 4 print('table', sys.argv[1], 'edges', d['edges'], 'mesh', M, 'nonzero dyadic coefficients', len(V.c), flush=True) res = V.run() print('RESULT cap_upper %.7f reserve %.7f PASS(cap<%s)=%s' % (float(res['cap']), float(res['reserve']), sys.argv[3] if len(sys.argv) > 3 else '-', (res['reserve'] > 0 and (len(sys.argv) <= 3 or res['cap'] < Fr(sys.argv[3])))), flush=True) print('exact cap bound', res['cap'], flush=True)