Appendix B — What bcdd checks
This appendix describes the checks of bcdd 1.0-beta, the version used for the examples in the manual. bcdd check classifies what it reads in three ways:
- an error is a form that the program recognises but that is not written correctly; it appears in section
1 of the report (
ERRORS) with a code in square brackets, makes the command end with exit code 1 and preventsbcdd ratify; - an unrecognised line is a line that does not correspond to any form of the language; it appears in section 5, it is not an
error, and with
--strictit makes the check fail and preventsbcdd ratify(chapter 2); - everything else is recognised and appears in the other sections of the report.
Errors
The messages shown come from test files: the names that appear in them (P, g1, A, …) are those used in those
files, and in real cases they change. The column “Ch.” indicates the chapter in which the error appears in an example; a
dash indicates an error that the manual does not show. There are forty errors, from E01 to E40.
| Code | When it arises | Message | Ch. |
|---|---|---|---|
| E01 | two elements of the same block have the same name: two guarantees, a value and a state, two parameters, two parts, two fields of a record; two blocks with the same name in the same file | name already used at line 5: g1 |
2 |
| E02 | DETAILS names a line that does not exist in the block or that is not of the expected kind: a guarantee or an assumption for a contractual line, a DEFINE for a DEFINE, a scenario for a scenario |
DETAILS names an id that is neither a GUARANTEE nor an ASSUME of this CSC: g9 |
8 |
| E03 | a scenario names an undeclared event, state, request or parameter; a value that does not belong to any list of values of the block | name not declared as EVENT: f; name not declared as a parameter of e: b; name not declared as a value of TYPE: z |
6, 23 |
| E04 | STATUS RATIFIED without BY and the decision reference |
STATUS RATIFIED without a decision: BY D-number is needed |
7 |
| E05 | the details are circular, including when a line is a detail of itself | circular DETAILS: g1 -> g1 |
8 |
| E06 | an open string is not closed before the end of the file | unclosed string: the file ends inside the string opened here |
— |
| E07 | a block without END, because the file ends or another block begins |
unclosed block: END of CSC P is missing; unclosed block: END of CSC Comando is missing |
25 |
| E08 | an END line that does not close any open block |
END without an open block |
25 |
| E09 | a line that begins with CSC, ENTITY, BINDING, VERIFICATION, PROFILE, or with EXTENSION in a profile, and does not have the expected form |
invalid header: CSC Name VERSION number expected; invalid header: BINDING CSCName VERSION number [AS name] expected |
— |
| E10 | a CSC, an entity or a profile without PURPOSE, or with two; two STATUS lines in the header |
PURPOSE missing in CSC P; PURPOSE missing in PROFILE Senza; PURPOSE repeated: the first is at line 2; STATUS repeated: the first is at line 5 |
2, 27 |
| E11 | the file contains no CSC, entity, BINDING, VERIFICATION or profile; the message is preceded by file: instead of the line number |
the file contains no CSC |
— |
| E12 | in a scenario the time of an instant decreases, or the scenario mixes instants with and without a time unit | the time of the step decreases: @3 s after @5 s; steps with and without a time unit in the same SCENARIO |
9 |
| E13 | a guarantee or an assumption in words without the VERIFY line |
VERBAL without VERIFY: VERIFY BY JUDGEMENT or INSPECTION and a string are needed |
2 |
| E14 | in an entity, a part uses a boundary that no other part provides and that the entity does not use from outside | the part pb uses connector B: no other part of E14 provides it, nor does E14 use it from outside |
13 |
| E15 | a line that begins with REFINEMENT, a withdrawn form |
REFINEMENT VIEW has been withdrawn: a decomposition is written with ENTITY |
— |
| E16 | a boundary that the entity provides and that no part provides, or that the entity uses and that no part uses | the public connector C of E16 (provided) is not assigned to any part |
13 |
| E17 | a part provides a boundary that no other part uses and that the entity does not provide to the outside | the part pa provides connector A: no other part of E17 uses it, nor does E17 provide it from outside |
13 |
| E18 | an ASSUME, CAPABILITY, EVENT, STATE, DEFINE or TYPE line appears in an entity |
ASSUME cannot appear in an entity: write it in the CSC of one of its connectors |
12 |
| E19 | the number of copies of a part is not valid | the part pa has an invalid number of copies: [2 .. 1]. Write [minimum .. maximum] with two integers: the minimum 0 or more, the maximum at least 1 and not smaller than the minimum |
16, 19 |
| E20 | in a scenario or in an entity formula, a name preceded by a boundary that the entity neither provides nor uses; in a CSC, a name preceded by a boundary | B.x: E20 neither provides nor uses connector B; a scenario can cite only the connectors of E20; B.x: in a CSC, names are not written with the connector in front. The order of two connectors is written in a SCENARIO of the entity |
11, 18, 21 |
| E21 | VARIANT in a CSC, or written without = or without a choice; PURPOSE inside a variant segment |
VARIANT cannot appear in a CSC: variants are written in an entity; VARIANT badly written: VARIANT group = choice is needed; PURPOSE cannot appear in a VARIANT segment: write it before the first VARIANT |
20 |
| E22 | a group with a single choice, a choice written twice, a variant segment without lines | choice group a has a single choice (b): at least two are needed; a part that may be missing is written with [0 .. 1]; the choice a = b is already written at line 3; the VARIANT segment a = b is empty: a choice without lines is written with a part [0 .. 1] |
20 |
| E23 | an entity with more than 64 compositions | entity E23 has more than 64 compositions: bcdd does not check them one by one. Remove a choice, or divide the entity into smaller entities |
20 |
| E24 | in a formula, in a DEFINE, in a FOLLOWS line or in the use of an extension: an undeclared name, or one of a kind different from the one the position requires; a field that the record does not have; a function call with incorrect arguments; in an entity, a name without the boundary in front |
name not declared: premuta; name not declared as a field of Tocco: stanza; the argument valore is missing in the call to vicino; accesa is not an event: an EVENT, a DEFINE EVENT or a phase of a CAPABILITY is needed |
21, 23 |
| E25 | an expression of a type not admitted in its position; a value written in INITIAL, in the GIVEN, in an assignment or in an argument that is not of the declared type |
inconsistent type: Duration needed, Integer found; value not of type Modo: false; value not of type Percentuale: 120 |
6, 22, 23 |
| E26 | AND and OR mixed without parentheses; two IMPLIES, two comparisons or two ^ in a row without parentheses |
AND and OR together without parentheses: write (a AND b) OR c, or a AND (b OR c); chained comparisons: write a <= b AND b <= c |
21 |
| E27 | a formula keyword nested in another; two scopes in the same property; WITHIN and AT ONCE together; REQUIRES in a guarantee |
ALWAYS inside another form: the language does not nest ALWAYS, EVENTUALLY, WHENEVER and their shorthands; a property has a single scope: AFTER is the second; REQUIRES is used only in an ASSUME: in a GUARANTEE write ALWAYS (requested(X) IMPLIES c) |
21, 23 |
| E28 | DEFINEs or named types that name one another circularly |
circular DEFINE: A -> B -> A |
— |
| E29 | the type of an index is not finite; an index on a name that has none; an indexed state written without an index; an index of an inconsistent type | the type of the index of s is not finite: Real; accesa has no index; accesa has an index: write accesa[value of Piano]; index of clipCount not of type Ch: X |
23 |
| E30 | in a scenario, a repetition that does not conform to the expected form | REPEAT repeated in the scenario: the first is at line 6; the step @60 s is not shorter than the period of REPEAT: every repeated step has a time smaller than EVERY 60 s; REPEAT without steps: the repeated steps are written after the REPEAT line |
22 |
| E31 | in a BINDING or in a verification plan whose bound CSC has been found, an element or a scenario that the CSC does not declare |
spia is not an element of CSC UsoLuce VERSION 0.3; TRANSLATES names a scenario that CSC UsoLuce VERSION 0.3 does not have: s9 |
25, 26 |
| E32 | an extension outside a profile | EXTENSION outside a PROFILE: an extension is declared in a profile |
27 |
| E33 | a missing or repeated field of an extension, or one with a value that is not admitted; a non-conforming FORM; KIND FUNCTION without the type of the result; in VERIFY V1, a code other than C1 … C8 |
field SOURCE is missing in EXTENSION FADE; value of KIND not admitted: pattern; the parameter d must appear once in FORM |
27 |
| E34 | two extensions with the same name in the same profile; an extension with the name of a word of the language | extension name already used at line 3: FADE; the name of the extension is a word of the language: ALWAYS |
— |
| E35 | REDUCES TO names what is not a word of the language, a parameter or an extension of the same profile; extensions that name one another circularly with REDUCES TO |
REDUCES TO names X: it is not a word of the language, a parameter or an extension of PROFILE P; circular REDUCES TO: A -> B -> A |
— |
| E36 | REDUCES TO repeats a single form of the language or another extension |
EXTENSION MAI repeats a form that the language already has: NEVER |
27 |
| E37 | a use of an extension that does not respect its FORM, its KIND or its LEVEL |
use of FADE that does not respect FORM "FADE s WITHIN d" |
27 |
| E38 | a BINDING or a verification plan imports a profile in a version different from that of the bound CSC |
PROFILE Protocollo imported with VERSION 0.2, but CSC Comando imports it with VERSION 0.3 |
— |
| E39 | a STATUS in a verification plan |
STATUS cannot appear in a VERIFICATION: a verification plan is not approved |
26 |
| E40 | two BINDINGs for the same CSC and the same version without a distinguishing name, or with the same distinguishing name, in the same file |
second BINDING without a name for CSC Comando VERSION 0.1: the first is at line 13. With two or more BINDINGs, each has a name: AS name |
25 |
In its messages bcdd uses the term “connector” for a CSC cited by an entity and “id” for the short name; the
manual uses “boundary” and “short name”. In the errors of an entity with several
compositions the suffix (in: …) indicates the compositions in which the error applies (chapter 19).
Some errors also make the line in which they occur unrecognised, which is therefore also listed in section 5: E06, E08, E09, E15, E18, E21 and E32; with E32 the lines of the misplaced extension are also unrecognised. The errors from E24 to E31 and from E33 to E40, by contrast, leave the line recognised: the form is read in full, and the error indicates what is not correct.
bcdd reports an error only when it can establish it with certainty. If a check depends on a cited file that is not found (a bound
CSC, the CSC of a qualified name, an imported profile), the check is suspended and the citation appears in
section 7.
What appears in the report without being an error
| Section | What it lists | Ch. |
|---|---|---|
| 2. DEGREE OF THE CONTRACTUAL LINES | for each contractual line, the degree: verbal, formal, declared extension or unrecognised | 2, 21, 27 |
| 3. UNDECIDED | the undecided numbers | 8 |
| 4. PENDING APPROVAL, NOT CONTRACT | the lines pending approval: contractual lines, details of DEFINEs and of scenarios, BIND lines, extensions of a profile pending approval |
2, 7, 25, 27 |
| 5. UNRECOGNISED LINES | the lines that bcdd does not recognise, with the reason if it depends on a profile not found; with --strict they make the check fail |
2, 27 |
| 6. UNDECLARED TYPES | the types used without a TYPE line |
6 |
| 7. CSCs NAMED BUT NOT CHECKED | the CSCs, parts, BINDING blocks and profiles cited that bcdd has not found |
12, 13, 27 |
| 8. USES WITHIN ENTITIES | for each part, what provides each boundary that the part uses | 13 |
| 9. COMPOSITIONS | the compositions of an entity that has more than one | 19, 20 |
| 10. DECLARED ABSENCES | what is missing only because an optional part is missing | 19 |
| 12. MISSING CONCRETE FORMS | for each BINDING, the elements of the bound CSC without a BIND line |
25 |
| 13. VERIFICATION PLAN COVERAGE | for each verification plan, the formal guarantees observed by each instrument and those not executed | 26 |
| 14. TO BE JUDGED | the rules that require human judgement: the consistency of a detail with a line in words, the meaning rules of extensions | 8, 21, 27 |
| 15. CHECKS NOT EXECUTED | the checks on formulas that bcdd does not execute, with the lines to which they would apply |
21, 24 |
Sections 8, 9, 10 and 12-15 appear only when they are needed. Number 11 is not used.
With the option --json, bcdd check writes instead of the report a JSON object, with "forma": "bcdd-check" and
"versione": 5, which contains the same information.
The messages of the commands
In the following cases the command stops with a single-line message, without an error code in square brackets
such as [E03], ends with an exit code other than 0 and does not modify any file:
| Message | When | Ch. |
|---|---|---|
bcdd check: file not found: nessuno.csc |
the file indicated does not exist | — |
bcdd new: UsoLuce.csc already exists: I am not overwriting it |
a file with the same name already exists | 7 |
bcdd ratify: the file does not pass bcdd check --strict (errors: 1, unrecognised lines: 0): I am not approving |
the file has errors or unrecognised lines | 7 |
bcdd ratify: g1 is already part of the contract (line 11): I am changing nothing |
the line indicated is already approved | 7 |
bcdd ratify: invalid decision: D7 (D-number is needed) |
the decision reference does not have the form D- followed by digits |
7 |
bcdd ratify: in a BINDING the header or --all is approved, not a line |
a line of a BINDING is indicated; for a profile the message indicates that the whole profile is approved |
25 |
bcdd ratify: the BINDING Comando VERSION 0.1 is already approved (D-21): I am changing nothing |
the chosen BINDING or profile is already approved |
25 |
bcdd ratify: no block to approve with the name NAME in the file |
no CSC, entity, profile or BINDING has the name indicated with --csc |
— |
bcdd ratify: the file contains no block to approve: a VERIFICATION is not approved |
the file contains only verification plans | 26 |
What bcdd does not check
- the meaning of formulas: it does not establish whether a scenario has the outcome it declares, whether every trigger occurs in a scenario, whether guarantees and assumptions can hold together, whether a formal detail is consistent with the line it specifies; these are the checks of section 15 (chapters 21 and 24);
- the rules by judgement: the consistency of a detail with a line in words and the meaning rules of extensions; these are the entries of section 14 (chapters 8 and 27);
- recordings:
bcdddoes not read recorded traces, and section 13 indicates which guarantees an instrument observes, not whether they are satisfied (chapter 26); - the values of constants, and whether the name of a constant cited in the text of a guarantee exists (chapter 8);
- the limits of an interval, which it does not compare with each other (chapter 6);
- unknown types: a value of a type described in words, of an undeclared type or of an
UNDECIDEDconstant; in entity scenarios a value that is a name; in entity formulas the type of the elements of the cited CSCs (chapters 18 and 21); - the uses of extensions of
KIND RELATIONandKIND SCENARIO-FORM, which it leaves unrecognised (chapter 27); - what changes between two versions of the same CSC (chapter 10).
Lines with keywords written in lower case (chapter 2) and the line
STATUS RATIFIED BY in the header of an entity (chapter 12) also remain unrecognised. A duration with a unit other than s and ms,
for example 1 min, does not belong to the language (chapters 6 and 8): the line that contains it is an unrecognised
line.
No program described in the manual executes recording verification (chapter 24) or a verification plan (chapter 26).

