---
title: "31.9 The formal model"
url: https://una-lang.org/en/docs/spec/31-http-servers/9-the-formal-model/
release: v0.4.0
source: https://github.com/una-lang/una/blob/v0.4.0/docs/spec/31-http-servers.md
---

# 31.9 The formal model

(ADR 0123 S10, rule 11 of its implementation plan; #1012.) The formal track's model of Core (`formal/UnaFormal/F1`, `docs/plan/formal-track.md`) does not model the server yet. It is a statement about the model and the re-check of `una.core/1` documents, not a rule on programs: no verdict of `una check` depends on it.

1. **Not re-checked, never accepted.** The re-check reports as not re-checked, with a reason that names ADR 0123, every declaration whose Core holds a construct of the server: the base type `ReplyRight`; a kind of §1 rule 2 that Core declares in the module `prelude` (`Method`, `Param`, `Request`, `Exchange`, `Reply` and `ServeError`), as a type, a failure's kind, a constructor or a pattern; a name of §8 in the module `std.testing` (`TestRequestError`, `test_request`, `test_exchange`); or a node that names the capability `HttpServer`: an operation (`next`, `reply`, `close`), a `uses` entry, a handler of it. As for every form outside the model, each declaration that reaches one, by a call, an instance or a record type with a field of one, is not re-checked either. The function `handle` of a `serve` section (§7 rule 2) is such a declaration, since its parameter is a `Request`, and the driver of §7 rule 4 is engine code outside Core, which the re-check never reads. `Status` is an `Int` with a refinement in Core, and `Header` the kind of `spec/24 §1` that the model reads, so neither is a construct of the server.
2. **By module.** A kind of the program named as one of the server's (§1 rule 1) is declared in its own module and read as before. A `uses` entry names its capability without its module, so a capability of the program named `HttpServer` is refused with the host's: the re-check fails closed.
3. **What the model will cover** (ADR 0123 S10): `next` as an input stream and `reply` as an effect; T6 under a fixed stop schedule with the stream as input; and a lemma that which task holds a reply right is a function of each task's own order. The parser of §3 and §4 stays outside the model, and its fuzzing and differential tests stand for it. The milestones are #1863 (`next`), #1864 (`reply` and the reply rights) and #1865 (T6 and the lemma); until they land, rule 1 holds.
