TLA + "Specifying Systems" draft translation --Section 14.7 The Fine Print (appendix)

And precise definition of the syntax values ​​in TLC profile: This section will TLC two aspects outlined above in the detailed description.

14.7.1 The Grammar of the Configuration File (configuration file syntax)

In the next figure 14.6, TLA + ConfigFileGrammar module describes the syntax of TLC profile. More precisely, it is the definition of a set of modules statement ConfigFileGrammar ConfigGrammar.File describes the configuration file (without comments) correct syntax.

ConfigFileGrammar module extends BNFGrammars modules (see Section 11.1.4, p. 179). Here are some other restrictions profiles, these restrictions are not mentioned in the ConfigFileGrammar module:

  • You can only have a maximum of INIT and a NEXT statement;
  • At most one SPECIFICATION statement, but only if there is no INIT or NEXT statement.
    (About when the conditions of these statements must appear, see page 243 of Section 14.3.1);
  • Up to a VIEW statement;
  • Up to a SYMMETRY statement;
  • It allows multiple instances of other statements. For example, the following two statements
    INVARIANT    I n v 1 INVARIANT    I n v 2 , I n v 3 \\\textrm{INVARIANT} \;Inv1\\ \textrm{INVARIANT} \;Inv2, Inv3
    specifies three invariant TLC checks Inv1, Inv2, and Inv3, equivalent to the following statement
    INVARIANT    I n v 1 , I n v 2 , I n v 3 \textrm{INVARIANT} \;Inv1,Inv2, Inv3

14.7.2 Comparable TLC Values ​​(numeric comparison)

Section 14.2.1 (page 230) describes the TLC value. This description is incomplete because it does not define when exactly comparable value. Precise definition is, if and only if the following rules imply when they are two, two TLC value is comparable:

  1. Two original values ​​can be compared if and only if they have the same value type, this rule means "abc" and "123" are comparable, but the "abc" and 123 are not comparable;
  2. Model value may be compared with any value (which is equal only to itself);
  3. Two sets can be compared, if and only if: the number of different groups of elements, or the same number of elements, and all elements of all the other elements of the group a comparable group. The rule means {1} and { "a", "b"} is comparable, and {1,2} and {2,3} are comparable. However, {1,2} and { "a", "b"} can not be compared.
  4. 两个函数f和g可以比较,当且仅当(i)它们的定义域是可比;(ii)如果它们的定义域是相等的,则f[x]和g[x]对于它们域中的每个元素x都是可比较的。该规则意味着<1,2>和<“a”," b"," c">是可比较的,并且<1," a">和<2,“bc”>是可比较的。但是,<1、2>和<" a"," b">是不可比的。
发布了4 篇原创文章 · 获赞 1 · 访问量 5533

Guess you like

Origin blog.csdn.net/robinhzp/article/details/103523207