Skip to content

a parameter cannot say that a missing row is absent, so a decision supplied as data brings back the rows its mask deleted #790

Description

@FBumann

Prompt: Close the issue and open a follow up scoped to the absence question.
And link related PRs

Note

The following content was generated by AI.

What can be improved?

A missing row means two things by kind: a masked variable is absent and takes the row, while a missing parameter row reads as 0 and the row stands. A quantity that moves from decision to data changes meaning. parameters: could take absence: like variables:.

Evidence, proposal, related work

Follow-up to #750, scoped to the absence: question. The null point of #750 is settled by #788: a null or NaN parameter value is refused when the data is attached, so a gap in parameter data is only a missing row.

The law as written

absence.md: "A where: does not set a variable to zero. It leaves the variable unbuilt", and "A missing parameter row is not absence. It reads as the value that contributes nothing: 0 as a coefficient." Each rule holds on its own. The two differ only by the kind of name.

Where it breaks: a decision fixed as data

#748 (spec.fix, for #303) turns a variable into a parameter under the same name. For a variable with where: and absence: undefined, the row p <= cap * avail was not built where cap did not exist. Once cap is a parameter it reads 0 there, and p <= 0 stands. #249 (closed) found this first.

#748 reconstructs the absence from the program:

  • a read inside sum, sum(by=) or sum_back is safe, since an absent summand and a 0 one give the same sum;
  • a read under a mask that holds every conjunct of the variable's mask is safe;
  • an unguarded read directly in a constraint adds the variable's mask to that constraint's where:;
  • a read through shift, through at, or in an unguarded case is refused, because the mask cannot be carried to the row there.

Proposal

absence: zero | undefined on parameters:, with the values and meaning it has on variables::

  • zero, the default, is today's law: a missing row reads 0.
  • undefined: a missing row is absent. It spreads through arithmetic, shift and at, takes the row, and is one summand fewer inside a summing operator, as a masked variable is.

With it, fix copies the variable's absence, and every read keeps its meaning with no rewrite and no refusal. #748 shrinks to the dtype rule, the bounds assumption and the rows that become assumptions.

Related

Ref State Relation
#750 closed the parent issue; this one takes its main proposal
#788 merged a gap arrives only as no row, so absence: has one form to decide
#748 draft PR spec.fix; shrinks if this lands
#303 open the need fix answers
#749 draft PR spec.sensitivity; meets the reverse case, a deleted dual that should count as 0. A read keyword like shift's edge=0 would answer it, and waits for a second caller
#296, #671 open, PR open coverage: total | masked says whether a table may have gaps; absence: says what a gap reads as. Orthogonal
#773 open default: fills a missing row. It interacts with absence: undefined: a default and an absent gap cannot both apply
#249 closed PR the first fix, with a coverage key main no longer has
#259 open sum(..., where=). A separate need
#13 declined parameters, variables and expressions stay three declarations

Open

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: data contractWhat a file guarantees about the data it binds

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions