🧑‍🎓
Training Resources for Atelier B
  • Introduction
  • Guides and Tutorials
    • Installation
    • Training Videos
    • Training Slides
    • Applying the B Method
      • Project Creation
      • Code Generation
      • Mathematical Proof
        • 🔥Writing Mathematical Rules
          • Introduction
          • Introduction to the Theory Language
          • How to write mathematical rules
          • Using Automatic Prover Mechanisms
          • Guards in a nutshell
          • Normalisation of Expressions
          • Common pitfall
          • All guards in the theory language
    • Extending Atelier B
      • Syntax
      • Examples
    • Programming the CLEARSY Safety Platform
  • Examples and Case-studies
    • Fuel Level
    • Switch
    • Security Policy
    • Verified Software Competitions
  • Additional Resources
    • Glossary
    • References
    • Frequently Asked Questions
Powered by GitBook
On this page
  • Trying a proof
  • Difference
  • Order relation
  • Positive value
  • Non membership
  • Membership to INTEGER

Was this helpful?

  1. Guides and Tutorials
  2. Applying the B Method
  3. Mathematical Proof
  4. Writing Mathematical Rules

Using Automatic Prover Mechanisms

This section presents different mechanisms of the prover that may be referred to and employed in the mathematical rules. These mechanisms have been validated and may simplify the conception phase of these rules. For each mechanism, the following points will be presented:

  • syntax to use the mechanism

  • semantics associated with the mechanism

  • a textual description of the mechanism

  • an illustrating example.

Trying a proof

Syntax: bguard(attempt_to_prove: a_t_t_e_m_p_t__t_o__p_r_o_v_e(P | Curr))

Translation: P

Description: This mechanism triggers a sub-proof on P. It is successful if P can be demonstrated by the prover. P must be correctly typed.

Examples

band(binhyp(f: s +-> (t --> u)) ,
bguard(attempt_to_prove: a_t_t_e_m_p_t__t_o__p_r_o_v_e(
(t: POW(a) & u: POW(b)) | Curr)))
=>
(f(x): a +-> b)
bguard(attempt_to_prove: a_t_t_e_m_p_t__t_o__p_r_o_v_e(
(not(b) => a) | Curr))
=>
(a or b)
(n: a) &
not(n: b) &
bguard(attempt_to_prove: a_t_t_e_m_p_t__t_o__p_r_o_v_e(
(a: POW(b))| Curr))
=>
bfalse

This last rule is a forward rule. If an hypothesis matching n: a has just been generated, if there is an hypothesis not(n: b) and if the prover is able to show that a: POW(b) is true, then the hypothesis bfalse is generated.

Difference

Syntax: bguard(Fast_Prove_Difference: not(a = b)

Translation: not(a = b)

Description: This mechanism may be employed to prove that two terms are not equal. If the call succeeds, then a and b are not equal.

Examples :

bguard(Fast_Prove_Difference: not(a = b)) &
blvar(Q) &
Qnot(a = b)
=>
({a}<<|{b|->c} == {b|->c})
bguard(Fast_Prove_Difference: not(a = c)) &
blvar(Q) &
Q(a = c)
=>
({a|->b}<+{c|->d} == {a|->b}/{c|->d})

Order relation

Syntax: bguard(Fast_Prove_Order: m<=n)

Translation: m<=n

Description: If the call to this mechanism is successful , then the relation m <= n is true.

Example:

bguard(Fast_Prove_Order: c<=d) &
(a = c) &
(b = d)
=>
(a..b = c..d)

Positive value

Syntax: bguard(Fast_Prove_Positif: a)

Translation: 0<=a

Description: If the call to this mechanism succeeds, then the value of the arithmetic expression a is positive or zero.

Example :

binhyp(s: POW(a..b)) &
bguard(Fast_Prove_Positif: a)
=>
(s: POW(NATURAL))

Non membership

Syntax: bguard(Fast_Prove_Distinction: not(x: s))

Translation: not(x: s)

Description: If the call to this mechanism is successful , then x does no belong to s.

Example :

Fast_Prove_Distinction(not(a: dom({c|->d})))
=>
not({a|->b} = {c|->d})

Membership to INTEGER

Syntax: bguard(Fast_Prove_Num: n)

Translation: n: INTEGER

Description: A call to this mechanism is successful entails that n is an integer.

Example :

bguard(Fast_Prove_Num:(x))
=>
(succ(x) == x+1 )

PreviousHow to write mathematical rulesNextGuards in a nutshell

Last updated 3 years ago

Was this helpful?

🔥