4.26 Logical Analysis

Logical analysis of a formula

Syntax

  la
  la(n)
  la(f)
  la(f | n)

with:

Use

This command enables to analyse a B formula according to various modes:

When the formula to analyse has a depth greater than the analysis depth, expressions and predicates that cannot be detailed are replaced by terms of form t.i. This notation gives a global display of the formula. The term value is not automatically displayed so that display is not overloaded with complex terms. Command dt(see chapter 4.15 page §) enables to display some or all of theses terms.

Example

Let us consider the following situation:


 
        "‘SEARCH_MAX_EQL_RGE preconditions in this component’" &  
        rng: minrge..maxrge &  
        jj: 0..maxidx &  
        ii: 0..maxidx &  
        ii<=jj &  
        vv: VALUE &  
  



 
      "‘Local hypotheses’" &  
        nrr: INTEGER &  
        0<=nrr &  
        nrr<=2147483647 &  
        nbb: BOOL &  
        sol = (ii..jj<|arr_rge$1(rng))~[{vv}] &  
        not(sol = {}) => nrr = max(sol) &  
        nbb = bool(not(sol = {})) &  
        not((ii..jj<|arr_rge$1(rng))~[{vv}] = {}) &  
        "‘Check operation refinement - ref 4.4, 5.5’" &  
        =>  
        nrr = max((ii..jj<|arr_rge$1(rng))~[{vv}])  
 


Applying the la(3) command breaks down the formula as follows:


 
Parsing formula  
"‘SEARCH_MAX_EQL_RGE preconditions in this component’" &  
rng: t.1..t.2 &  
jj: t.3..t.4 &  
ii: t.3..t.4 &  
ii <= jj &  
vv: VALUE &  
"‘Local hypotheses’" &  
nrr: INTEGER &  
0 <= nrr &  
nrr <= 2147483647 &  
nbb: BOOL &  
sol = t.5[t.6] &  
(not(t.7)=>t.8 = t.9) &  
nbb = bool(t.10) &  
not(t.11 = t.12) &  
"‘Check operation refinement - ref 4.4, 5.5’"  
=>  
nrr = max(t.11)  
End of analysis