Repository navigation
The report says how to change the model
Some models cost souther examples minutes, or stop it at a figure of the compiler's own, for a reason the author can remove: a helper whose comparisons are read again at every element a call hands it, or conditions made through more choices than one condition's readings reach. 0.5.0 says so before it measures, and says what to write instead:
let fits (limit: Int, n: Int): Bool = n >= limit
behavior asked : (limit: Int, a: Int, b: Int) -> Bool
let asked (limit, a, b) = List.any(n -> fits(limit, n), [ a, b ])
before the lines are measured: the comparisons written in `fits` stand inside a function that a call outside `fits` applies to each element it is given (`asked` on at most 2 applications), so wherever the measurement draws a line from one of them, it may draw it again on each of those applications, ask where it decides and search for rows at it. Declared as a behavior, `fits` reads its comparisons once, over its own inputs.
The measurement of these sources may take minutes. What is said above is not changed by its result, so the model can be changed as said, and measured after that, without waiting for this run to end.
What is said there does not depend on the measurement, so the model can be changed as soon as it is printed. Where measuring a behavior as written would stop at one of the compiler's figures in what the change is about, the behavior is not measured at all. The report names the figure and the change, the summary says not measured, to be changed first, and every other behavior is measured as before. --to-the-end measures such a behavior as it is written, and --strict exits non-zero on one left unmeasured, since nobody looked at what its rows cover. A measurement that runs longer than a few seconds says on stderr which behavior it is on, and from then on once a minute.
A call to another behavior is read as a value the run makes, as a fold is, rather than through the called body. The caller is measured without reading the callee again, and what the callee answers is the callee's report to say. Splitting a large body into behaviors now shortens the measurement.
A stop is said where the run stops
Whether a run may stop is said of the step it stops at — an operation past its type, a division by nought, a construction its invariant refuses — and not of the comparison it was found on the way to. Every such step of a body is judged, whether or not a comparison comes after it, and each is said once, in a stops section of the behavior:
stops may stop 2 not resolved 1
· may stop a run: 9:20 — a run with i.terms = 0, i.issuedOn = 365241780457 gets here and stops in i.issuedOn + 15; every run that gets here stops in i.issuedOn + 15 where i.issuedOn is at least 365241780457
· stop not resolved: 13:31; whether a run stops in division by List.length(ms) is not determined: something evaluated before it may end the run first
A stop is shown by an input that gets to the step past everything worked out before it there, and the program stops at it; the rows every run stops at are said of the runs that get there. A value a run works out — a total, what a choice or a fold answers, a date moved by days — is read by the ways a row makes it come to numbers of the input, so a step over one is shown or ruled out as one over the input is.
Where a run may stop past where a type's representation ends, the report says which input to hold and how: introducing a data of Int that declares invariant value <= …, and taking n0 as it, keeps every run from taking a number past its type there. What is suggested keeps every run going at every step of the behavior together, and nothing is suggested where no value of the input holds it all.
A fold owes a row that reads its accumulator
The rewrites souther examples tries against the rows (ADR-0121) gain two for every fold the body walks (ADR-0126): the walk stopping after its first element, and every step handed the seed in place of what the step before it answered. A row with one element tells neither from the fold, so a total checked only on a one-line order is reported:
replacement 0/3
! no row would come out differently if the fold (6:21) stopped after its first element
! no row would come out differently if the fold (6:21) handed each step the seed in place of what the step before it answered
A row with two lines whose amounts both count closes both.
Other changes in the report
- A boundary on a number only a run works out, such as a sum over a list, is sought by running candidate rows and reading what each came to, and then rows beside the nearest ones. Where none reaches the point, the report names what was tried; that is not a proof the point is unreachable.
--generatealso offers optional rows: the inputs the rows of a called behavior were written with, tried in its caller. They owe nothing, the header counts them apart, and each is markedsuggested input; no uncovered obligation.- A value cut at several places — a helper's comparison read at each call of it — owes one weight per position, however many calls name it, and divides no position by itself (ADR-0124).
- Whether a run completes is shown over every operation it evaluates, and a reading that cannot tell says it is unresolved rather than taking it as either answer (ADR-0125).
- A relation between strings is read as though a
Stringhad no greatest length, as lengths and sizes already were (ADR-0130).
Compatibility
- A
Decimalis any finite decimal and aRationalany rational (ADR-0128). Sums, differences, products and roundings of decimals always have an answer, and so doesDecimal.divideby anything but nought. 0.4.1 aborted an operation whose answer's scale left the 32 bits aBigDecimalkeeps, and wrote that range into what the operation means. A run that has no room to write an answer now fails asOutOfRoom, the platform failing, and says nothing about the model. ADecimalis still ajava.math.BigDecimalon the JVM. - The adequacy report is written as schema version 28 (0.4.1 wrote 24). It adds, among others,
toBeChangedFirstandconditionsStoppedAtAFigureon a behavior,keepingon a finding, andcaseExpansions,costlyReadingsandweightson a partition. A stop is a finding of kindstep_may_stop_a_runorstep_stop_not_shown, placed byatwhere the step is written and carrying noruleId, in place of the kinds 0.4.1 said of a rule. A consumer that checks the version has to accept 28. - Reading more of a model changes what is reported about it. A report or generated rows checked in for 0.4.1 will differ for the same model.
- A module jar compiled by 0.4.0 or 0.4.1 is accepted as it is.
Other changes
- A step handed to a fold as a value is applied inside the loop around the call, and the step, the seed and the list are worked out in the order the call writes them (ADR-0127).
souther init --build noneand the E2109 header no longer drop an apostrophe.
The decisions behind these changes are ADR-0124 to ADR-0130, indexed in docs/adr/README.md.