Round trip, case by case: open operators
theorem jsonVal_head (sf : Sf) (v : Json) (hv : jwf v = true) (hn : ∀ n, v ≠ .num n) :
∃ t r, jsonVal sf v = t :: r ∧
(sf = .latex → ∀ X, jsonStart (t :: X) = true) ∧ (sf = .typst → t = .code v ∧ r = [])
A field value as JSON tokens starts with a token the parser takes for JSON.
def valToks (c : Ctx) (b : Bool) (v : Json) : List Tok
A field value as printed: an expression at level 4 (b), or JSON.
def fieldToks (c : Ctx) (o : String) (kv : String × Json) : List Tok
A field of the operator o as printed: key, =, value.
theorem callForm_facts {o : String} {fs : List (String × Json)} (h : callFormOK o fs = true) :
callOps.contains o = false ∧ o ≠ "neg" ∧ o ≠ "pow" ∧ o ≠ "D" ∧
(coreOps.contains o && !(fieldCallOps.contains o)) = false
What the call form’s condition gives the reader.