✓
Passing This code compiles and runs correctly.
Code
import std/io
import std/sym
// exp's law -f + f' = 0 -> -(a_n) + (n+1)a_{n+1} = 0
std/sym:cert-seed(body: "p0=[-1]|p1=[1]")
| exact c |> std/sym:cert-bridge(c)
| exact r |> std/io:print.ln("{{ r:s }}")
| bad-cert m |> std/io:print.ln("{{ m:s }}")
| bad-cert m |> std/io:print.ln("{{ m:s }}")
// 1/(1-x): constant coefficients
std/sym:cert-seed(body: "p0=[1,0]|p1=[-1,1]")
| exact c |> std/sym:cert-bridge(c)
| exact r |> std/io:print.ln("{{ r:s }}")
| bad-cert m |> std/io:print.ln("{{ m:s }}")
| bad-cert m |> std/io:print.ln("{{ m:s }}")
// sqrt(1+x) discovered -> bridged: (2n+1)a_{n+1} + (2n+4)a_{n+2} = 0
std/sym:lit(√((1e0+x)))
| exact a |> std/sym:derive-ode(a, max-order: 2, max-deg: 2)
| exact c |> std/sym:cert-bridge(c)
| exact r |> std/io:print.ln("{{ r:s }}")
| bad-cert m |> std/io:print.ln("{{ m:s }}")
| not-found |> std/io:print.ln("nf")
| non-analytic |> std/io:print.ln("na")
| non-rational |> std/io:print.ln("nr")
| bad |> std/io:print.ln("bad")
| bad |> std/io:print.ln("bad-lit")
// q_{K,0} = 0: leading bridge poly vanishes -> det=0, order drops
std/sym:cert-seed(body: "p0=[1]|p1=[0,1]")
| exact c |> std/sym:cert-bridge(c)
| exact r |> std/io:print.ln("{{ r:s }}")
| bad-cert m |> std/io:print.ln("{{ m:s }}")
| bad-cert m |> std/io:print.ln("{{ m:s }}")
// malformed external cert through the allocated stdin path
std/io:read-stdin()
| ok junk |> std/sym:cert-bridge(c: junk)
| exact r |> std/io:print.ln("{{ r:s }}")
| bad-cert m |> std/io:print.ln("{{ m:s }}")
| eof |> std/io:print.ln("eof")
| failed _ |> std/io:print.ln("ff")
Actual
rec(k=1,d=1,via=bridge,det=1)|p0=[-1]|p1=[1,1]
rec(k=2,d=1,via=bridge,det=1)|p0=[0]|p1=[2,1]|p2=[-2,-1]
rec(k=2,d=1,via=bridge,det=1)|p0=[0]|p1=[1,2]|p2=[4,2]
rec(k=1,d=1,via=bridge,det=0)|p0=[0]|p1=[2,1]
malformed-cert
Expected output
rec(k=1,d=1,via=bridge,det=1)|p0=[-1]|p1=[1,1]
rec(k=2,d=1,via=bridge,det=1)|p0=[0]|p1=[2,1]|p2=[-2,-1]
rec(k=2,d=1,via=bridge,det=1)|p0=[0]|p1=[1,2]|p2=[4,2]
rec(k=1,d=1,via=bridge,det=0)|p0=[0]|p1=[2,1]
malformed-cert
Flows
flow ~cert-seed click a branch to expand · @labels scroll to their anchor
cert-seed (body: "p0=[-1]|p1=[1]")
flow ~cert-seed click a branch to expand · @labels scroll to their anchor
cert-seed (body: "p0=[1,0]|p1=[-1,1]")
flow ~lit click a branch to expand · @labels scroll to their anchor
lit (expr: √((1e0+x)))
flow ~cert-seed click a branch to expand · @labels scroll to their anchor
cert-seed (body: "p0=[1]|p1=[0,1]")
flow ~read-stdin click a branch to expand · @labels scroll to their anchor
read-stdin
Test Configuration
MUST_RUN
stdin:
junk cert, not parseable