Chapter 7 — Pending approval and approved
The contractual lines written so far are all pending approval: the report lists them in section 4,
PENDING APPROVAL, NOT CONTRACT. The chapter indicates who approves them, how the approval is written in the file and with
which bcdd command it is recorded.
Who approves
A contractual line becomes approved only by decision of whoever has the authority to do so:
in the example, the building manager. Neither bcdd nor a language model ever approves a line.
The approval decision is recorded elsewhere, for example in the register of decisions of the block of flats, with
an identifier. In the file the decision reference is written: the prefix D- followed by digits only,
for example D-7. Over time, the reference makes it possible to trace who approved and for what
reason.
The STATUS line
The approval status is recorded in the file with STATUS, in two forms:
STATUS HYPOTHESIS: pending approval;STATUS RATIFIED BY D-7: approved with decisionD-7.
HYPOTHESIS means “hypothesis”, that is pending approval; RATIFIED BY means “ratified by”, that is approved. In
the output of bcdd, an approved line “is part of the contract”.
STATUS is written in two positions. In the header it applies to the whole CSC. The header consists of the
CSC line and of the lines that follow it before the body, that is before the lines that describe the
boundary: PURPOSE, any STATUS and any IMPORT PROFILE (chapter 27), in any order. In the examples of the
manual STATUS immediately follows the CSC line. After the short name of a contractual line, instead,
STATUS applies only to that line:
GUARANTEE g1 STATUS RATIFIED BY D-7: VERBAL "When someone presses the button, the light switches on"
If a contractual line has its own STATUS, that one applies; otherwise the STATUS of the header applies.
In the absence of any STATUS, the line is pending approval: nothing becomes approved without a written decision.
The skeleton of a new file
The bcdd new command creates the skeleton of a new CSC in the current folder:
$ bcdd new UsoLuce
created UsoLuce.csc
The file created is the following:
-- CSC created by bcdd new. It is filled in by hand; bcdd check checks the form.
-- Without STATUS RATIFIED no line is part of the contract: it is pending approval until the operator approves it.
CSC UsoLuce VERSION 0.1
STATUS HYPOTHESIS
PURPOSE "to be filled in: in one sentence, what UsoLuce is responsible for"
-- Inputs and outputs (uncomment and fill in):
-- CAPABILITY Name(parameter: Type) what can be requested
-- EVENT IN name(parameter: Type) what arrives from outside
-- EVENT OUT name(parameter: Type) what goes out
-- STATE name : Type INITIAL value what is visible from outside
-- Guarantees in words:
-- GUARANTEE g1: VERBAL "what it guarantees"
-- VERIFY BY JUDGEMENT "who judges, and on what"
END
The skeleton contains only the header with STATUS HYPOTHESIS, the purpose to be filled in, and END; the other
forms are suggested in comments, to be completed and activated by removing the two hyphens. bcdd new never
overwrites an existing file.
The CSC pending approval
With the explicit STATUS in the header, the CSC of chapter 6 becomes:
-- The staircase light, as seen by the person on the stairs and by the caretaker.
CSC UsoLuce VERSION 0.1
STATUS HYPOTHESIS
PURPOSE "The person on the stairs presses a button and has light to go up or down"
TYPE Modo := {spenta, accesa, in_pulizia}
CAPABILITY Pulizie(durata: Duration)
EVENT IN premuto
EVENT OUT avviso
STATE modo : Modo INITIAL spenta
GUARANTEE g1: VERBAL "When someone presses the button, the light switches on"
VERIFY BY JUDGEMENT "a person who presses the button and watches"
GUARANTEE g2: VERBAL "The light switches off by itself after a while"
VERIFY BY JUDGEMENT "a person with a watch"
GUARANTEE g3: VERBAL "Shortly before switching off, the light gives a warning to the person on the stairs"
VERIFY BY JUDGEMENT "a person on the stairs who waits for the light to switch off"
GUARANTEE g4: VERBAL "A cleaning request is rejected if the requested duration exceeds two hours; otherwise it is accepted"
VERIFY BY JUDGEMENT "the caretaker, who requests cleaning with different durations"
GUARANTEE g5: VERBAL "After an accepted request the light stays on for the whole requested duration; when it expires the request has succeeded"
VERIFY BY JUDGEMENT "the caretaker, with a watch"
GUARANTEE g6: VERBAL "If the light cannot stay on until the duration expires, the request has failed"
VERIFY BY JUDGEMENT "the caretaker, who removes the lamp during cleaning"
GUARANTEE g7: VERBAL "During cleaning the mode is in_pulizia, and a press of the button does not change it"
VERIFY BY JUDGEMENT "the caretaker, who presses the button during cleaning"
ASSUME a1: VERBAL "Whoever presses the button holds it down for at least a tenth of a second"
VERIFY BY JUDGEMENT "a person who observes how the button is pressed"
END
Approval with bcdd ratify
The bcdd ratify command records in the file an approval decision that has already been taken. It requires as arguments
the file, what is approved and the decision reference. Usually the whole CSC is approved, with the --all
option:
$ bcdd ratify UsoLuce.csc --all D-7
approved with D-7 in CSC UsoLuce: 1 line
line 4: CSC UsoLuce
contract: 8
Only one line changes in the file, the header:
STATUS RATIFIED BY D-7
The command reports 1 line because it modified only the STATUS of the header. The eight contractual
lines do not have a STATUS of their own and take that of the header: they are all approved, as indicated by
contract: 8. The report confirms it:
$ bcdd check --strict UsoLuce.csc
bcdd check --strict UsoLuce.csc
lines: 30 (recognised 25, comments 1, blank 4, unrecognised 0)
blocks: 1
line 3: CSC UsoLuce VERSION 0.1, STATUS RATIFIED BY D-7
1. ERRORS: 0
2. DEGREE OF THE CONTRACTUAL LINES
verbal: 8
formal: 0
declared extension: 0
unrecognised: 0
line 14: GUARANTEE g1 verbal
line 16: GUARANTEE g2 verbal
line 18: GUARANTEE g3 verbal
line 20: GUARANTEE g4 verbal
line 22: GUARANTEE g5 verbal
line 24: GUARANTEE g6 verbal
line 26: GUARANTEE g7 verbal
line 28: ASSUME a1 verbal
3. UNDECIDED: 0
4. PENDING APPROVAL, NOT CONTRACT: 0
5. UNRECOGNISED LINES: 0
6. UNDECLARED TYPES: 0
7. CSCs NAMED BUT NOT CHECKED: 0
outcome: no errors
Section 4 is empty: the CSC of the light is approved in full, and it is now the contract between the building manager and whoever implements the installation.
A single line can also be approved, by giving its short name. If the CSC is still pending approval:
$ bcdd ratify UsoLuce.csc g1 D-7
approved line 14: GUARANTEE g1 with D-7
In this case the command writes the STATUS in the line of g1, as in the example of the section “The STATUS line”;
the other lines remain pending approval.
bcdd ratify first performs the same check as bcdd check --strict and does not modify a file that does not
pass it. If the file passes, it modifies only the STATUS lines: the rest of the file remains identical.
An approved line is not modified
An approved line is never modified again. To change an approved CSC a new version of it is written, with the procedure of chapter 10.
Likewise, STATUS RATIFIED BY is not written by hand: it is written by bcdd ratify, on the basis of a
decision already taken. bcdd check does not distinguish a STATUS RATIFIED BY written by hand from one
written by the command.
Summary
- A contractual line becomes approved only by decision of whoever has the authority to do so, never of the program or of a language model.
- In the file approval is recorded with
STATUS RATIFIED BY D-number, whereD-numberis the decision reference;STATUS HYPOTHESISindicates a line pending approval. - The
STATUSof the header applies to the lines that do not have one of their own; without anySTATUS, a line is pending approval. bcdd newcreates the skeleton of a CSC;bcdd ratifyrecords the approval, of one line or of all of them (--all), modifying only theSTATUSlines.
Special cases
File with errors. bcdd ratify does not record the approval of a file that does not pass the check. If the
file contains INITIAL buia (chapter 6):
$ bcdd ratify UsoLuce.csc --all D-7
bcdd ratify: the file does not pass bcdd check --strict (errors: 1, unrecognised lines: 0): I am not approving
Line already approved. A line already approved is not approved again, not even with another decision:
$ bcdd ratify UsoLuce.csc g1 D-8
bcdd ratify: g1 is already part of the contract (line 14): I am changing nothing
Invalid reference. The reference must have the form D- followed by digits:
$ bcdd ratify UsoLuce.csc --all D7
bcdd ratify: invalid decision: D7 (D-number is needed)
The same message appears for a person's name in place of the reference, for example amministratore.
Approval without reference. A STATUS RATIFIED line lacking BY and the reference is an error:
1. ERRORS: 1
line 4: [E04] STATUS RATIFIED without a decision: BY D-number is needed
File already existing. bcdd new does not overwrite a file with the same name:
$ bcdd new UsoLuce
bcdd new: UsoLuce.csc already exists: I am not overwriting it

