5. Where each declaration holds
A declaration written correctly but in the wrong place is not recognised.
| Where | What is recognised there | Notes |
|---|---|---|
| Outside a block | G1, G31, G40, G48, G49 | END here is error E08; a declaration that begins with REFINEMENT is error E15 and opens a withdrawn block (section 4.8); one that begins with EXTENSION is error E32 (section 4.11); everything else is unrecognised |
Inside CSC … END |
G3, G4, G6, G7, G8, G11, G12, G16, G19, G21, G30, G37, G39, G41, G47, uses of extensions of KIND DECLARATION and LEVEL CSC |
see the three following rows; a declaration that begins with CSC, ENTITY, REFINEMENT, BINDING, VERIFICATION or PROFILE closes the CSC with E07; one that begins with EXTENSION is E32; G32, G33 and G34 are unrecognised there. A qualified name in a scenario is E20 (section 4.6) |
— STATUS, IMPORT PROFILE |
at any point of the header zone, in any order with PURPOSE (section 4.2); STATUS at most once |
a second STATUS in the zone is E10; after the zone they are not recognised |
— PURPOSE |
exactly one per CSC | if it is missing or repeated: E10 |
— @ steps and REPEAT |
only after a line that begins with SCENARIO (even if that line is not recognised), with only steps, REPEAT lines (G47), comments and blank lines between the two |
every other declaration closes the scenario; a REPEAT line outside a scenario is not recognised |
Inside BINDING … END |
G3, G4, G39 in the header zone, G51, uses of extensions of KIND DECLARATION and LEVEL BINDING |
section 4.11; CSC, ENTITY, REFINEMENT, BINDING, VERIFICATION and PROFILE close the block with E07; EXTENSION is E32 |
Inside VERIFICATION … END |
G3, G39 in the header zone, G52, G53 with its steps G21 and the lines G47, uses of extensions of KIND DECLARATION and LEVEL VERIFICATION |
STATUS is E39 at any point; for the rest as in a BINDING |
Inside PROFILE … END |
G3, G4 and G6 in the header zone, G50 which opens an extension | every other declaration is unrecognised; CSC, ENTITY, REFINEMENT, BINDING, VERIFICATION and PROFILE close the profile with E07 |
Inside EXTENSION … END (in a profile) |
G3, G43, G44, G45, G46, G54 | every other declaration is unrecognised; CSC, ENTITY, REFINEMENT, BINDING, VERIFICATION and PROFILE close the extension and the profile, with one E07 on the profile |
Inside a withdrawn block (REFINEMENT … up to END) |
only G3 | every other declaration is unrecognised and registers no names; CSC, ENTITY and REFINEMENT close the block with E07 (section 4.8) |
Inside ENTITY … END |
G3, G4 only with STATUS HYPOTHESIS, G39 in the header zone, G6, G32, G33, a single G28, G34, G16 with GUARANTEE (with every STATUS, as in the CSC, and with the formulas of section 4.9), G19, G21 and G47 with the qualified names (section 4.6), G38 (section 4.10), uses of extensions of KIND RELATION and LEVEL ENTITY |
see the six following rows. OFFERS and USES at any point. The words that open a block close the entity there with E07, as in the CSC; EXTENSION is E32 |
— VARIANT segments |
from a G38 line to the next one or to END: G32, G33, one G28 per segment, G34, G16 with GUARANTEE, G19 and G21 |
PURPOSE is E21; the other cases are in section 4.10. In a CSC block a declaration that begins with VARIANT is E21 |
— STATUS |
only STATUS HYPOTHESIS, at any point of the header zone (section 4.9); a second STATUS HYPOTHESIS in the zone is E10 |
every other STATUS, including a valid STATUS RATIFIED BY D-n and STATUS RATIFIED without a decision, is not recognised, without E04; the status of the block remains without STATUS: the header of an entity is never approved. Inside a GUARANTEE the STATUSes of the CSC hold: STATUS HYPOTHESIS, STATUS RATIFIED BY D-n, and STATUS RATIFIED without a decision with E04 (the guarantee remains recognised and pending approval) |
— PURPOSE |
exactly one per entity | if it is missing or repeated: E10 |
| — G34 parts | at any point of the entity, also without COMPOSED OF |
every declaration that respects G34 is a part; COMPOSED OF is written only once, wherever one wishes, and a second one is not recognised, without effect. The rules, the reasons and the edge cases are immediately below the table |
— SCENARIO, @ steps |
recognised with G19, G21 and the variants G20e, G23e, G24e (section 4.6) | as in the CSC: the steps only after a line that begins with SCENARIO, with only steps, comments and blank lines between the two |
— ASSUME, CAPABILITY, EVENT, STATE, DEFINE, TYPE |
not recognised, and error E18 on the keyword, whatever follows it | an entity has no elements of its own. They register no name, not even ASSUME with a valid line header nor DEFINE Nome :=, and they do not appear in section 2. The VERIFY and VERBAL lines that continue an ASSUME (U4) remain unrecognised with it, without another E18. Cases below the table |
Error E18. An entity has no CAPABILITY, EVENT, STATE, DEFINE, TYPE or ASSUME of its own: bcdd reads
the keyword and knows that it is out of place, so it is an error, like E15. Edge cases:
ASSUMEwith an invalid line header (ASSUME : …), or with a property written as a formula: E18, because the keyword at the head is enough;assumein lower case is not the keyword (2.2): it remains unrecognised, without E18;- inside a withdrawn block no E18: there every declaration is unrecognised (4.8);
- in an entity with an invalid header (E09) E18 holds all the same: the block opens in any case;
- a
DETAILSthat names the short name of anASSUMEwith E18 gives E02: theASSUMEdoes not register its short name; SCENARIOand the steps are not in E18: an entity has scenarios.
What a guarantee of the entity takes for granted about the other side of a boundary is written as an assumption
(ASSUME) in the CSC of that boundary. A guarantee of the entity is written as a GUARANTEE of the entity or in the CSC
that the entity provides.
The parts of an entity. In an entity every declaration that respects G34 is a part, wherever it stands: before or
after COMPOSED OF, among the guarantees, after OFFERS and USES, after unrecognised lines, after a second
COMPOSED OF, and also in an entity that has no COMPOSED OF. There is no list that opens and closes: the parts
stand wherever one wishes, like OFFERS and USES.
COMPOSED OF(G28), the parts list, is written only once: it tells the reader that the entity is made of parts.bcdddoes not need it: a part withoutCOMPOSED OFis checked like the others. The reason: no correctly written part must remain unchecked, and ifCOMPOSED OFwere necessary, forgetting it would remove the check from all the parts of the entity. The other option, an error for a part withoutCOMPOSED OF, would give an error on a line thatbcddreads in full and checks in any case.- A second
COMPOSED OFis not recognised, and has no effect on the parts. It is not an error: it states nothing wrong, it only repeats. - A declaration that does not respect G34 is not a part: if it is not another declaration of the entity
(table above), it is not recognised. It registers no name, it is not looked for, it does not appear under the entity or in
section 7, it does not count among the parts not found (so it does not suspend E14) and it does not change the way in which
any other declaration is read. Of this type are, for example:
pulsante-uno : Pulsante,p : X VERSION v1,pulsante Pulsante,pulsante uno : X,pulsante := X,"pulsante" : X,FOO bar,offers Luce,OFFERS : Pulsante,VERSION 0.1,LINK a b,END X, andVERIFYorVERBALafter a part (U4: they continue only aGUARANTEEor anASSUME).
Why no case remains in which a G34 declaration inside an entity does not become a checked part,
or an unrecognised line removes the check from a part. A declaration is a part if and only if (1) it is a
declaration (section 3), (2) it stands in an ENTITY block (section 5), (3) it respects G34 and (4) its name does not have E01.
None of these four conditions depends on whether another declaration is recognised or not, except in the cases
below, each with a signal outside section 5 or excluded from entities by construction:
| Case | What happens | Signal |
|---|---|---|
the text p : X stands inside a string that breaks across lines |
it is not a declaration (L2, U3): it is text | none, as a matter of principle: a string can contain any text. With a single quotation mark too many or too few in the file, the quotation marks outside comments are odd in number and bcdd signals E06. A stretch of lines becomes a string without errors only with two wrong quotation marks. Known limitation |
| the name of the part is repeated, or is the short name of a guarantee (also of an unrecognised guarantee with a valid G16 line header, section 4.5) | the part is not looked for | E01, code 1 |
an END on its own before the part |
the entity has ended: the line is outside a block | if the END of the entity comes afterwards, E08 |
a CSC, a REFINEMENT or an ENTITY before the part |
it closes the entity and opens another block | E07 (and E09 if the header is badly written; with REFINEMENT, E15) |
| a part not found | it suspends E14 for its entity | it is in section 7, with the reason if there is one |
p : X in a CSC or in a withdrawn block |
it is not an entity: it is not recognised (a CSC has no parts; a withdrawn block has no parts, section 4.8) | outside entities, by construction |
The case that remains: an entity in which no line is a part has no entries in section 8 and no E14, and without
--strict an unrecognised line does not change the code.
Other rules on blocks:
ENDmust stand alone on its line (a comment after it is acceptable).ENDfollowed by anything else is not recognised and the block remains open.- A
CSC, aREFINEMENT, anENTITY, aBINDING, aVERIFICATIONor aPROFILEinside an open block (also inside an extension, which closes with its profile) closes that block with error E07 and opens the new one. - A badly written block header (error E09) opens the block all the same, so the lines that follow
are read normally instead of all becoming foreign. This holds for
ENTITY,BINDING,VERIFICATION,PROFILEandEXTENSIONas forCSC. A declaration that begins withREFINEMENT(E15) opens the withdrawn block, well written or not (section 4.8). - A file can contain several blocks. The names of the
CSC,ENTITYandPROFILEblocks of a file are not repeated, whatever the type: a CSC and an entity with the same name in the same file are E01. A withdrawn block, aBINDINGand aVERIFICATIONdo not register their name (their name is that of the bound CSC). - Names in an entity. The names of the parts and the short names of guarantees and scenarios stand in a single list:
a repeated name is E01. The names of the
OFFERSlines stand in a list of their own, and so do those of theUSESlines. Several versions: twoOFFERSlines with the same name are E01 on the second unless both writeVERSIONand the versions differ as text; the same forUSES. HenceOFFERS Pulsanti VERSION 0.1andOFFERS Pulsanti VERSION 0.2are admitted;OFFERS Pulsanti VERSION 0.1twice is E01;OFFERS PulsantiandOFFERS Pulsanti VERSION 0.2are E01 on the second (the line without a version holds for every version, so it repeats it), in either order. The entity provides each version in full; how the versions coexist is stated by no line.OFFERS XandUSES Xin the same entity are admitted (for example a device on a bus). WithVARIANTsegments (section 4.10): two parts with the same name, and twoOFFERS(or twoUSES) with the same name, are compared with the rules above only if they can stand together, that is if they do not stand in two different choices of the same group:microfonoinsensore = diand insensore = microfonois acceptable,OFFERS Xamong the common lines and again in a segment is E01. The short names of guarantees and scenarios, and a part with the same name as a short name, are E01 in any segment. The message names the first line of the file with that name that can stand together with the line of the error. - A line with E01 in an entity (an
OFFERS, aUSESor a part) neither provides nor requires anything: it is not looked for, it does not appear under the entity, in section 7 or in section 8, and it does not count in the match (section 9.4), either in the checked file or in the found block of a part. The first line with that name always holds. - Rule U4 also holds in the entity:
VERIFYandVERBALcontinue aGUARANTEEor anASSUME(and theASSUMEremains unrecognised with its continuations). - An entity
GUARANTEEwith a valid G16 line header and a non-VERBALproperty registers its short name and is of degreeunrecognised, as in the CSC; E13 also holds in the entity. - The names declared in a block hold only in that block. In a CSC block requests, events, states, constants, types, guarantees, assumptions, scenarios and the values of the lists of values share a single list of names: two different elements with the same name are error E01. The names of the parameters hold only in their line.
- A declaration can name an element declared further on in the block.

