10.2 Help tool

The source code of a program allowing to equip automatically rules of a file with the trace mechanism is provided in appendix.

To use this program, do the following:

  1. The program must be compiled (file equipe.src)
        krt -c equipe.src equipe.kin

    before this, copy the symbol table from AB/press/lib/Bsym/B_ST to the directory containing equipe.src.

  2. A equipe.ex file must be created, containing the Equipe formula, parameterized by the name of the file to be equipped, and, possibly, the list of Forward theories (By default, it is considered that all theories contain Backward rules).

    For example, if the equipe.ex file contains:

        Equipe(‘‘test.src’’)

    the rules contained in the file “test.src” will be equipped with the backward mode trace system.

    If the equipe.ex file contains:

        Equipe(‘‘test.src’’ | (foo , foobar, gnu))

    The rules contained in the “test.src” file will be equipped with the trace system in backward mode, except those of the foo, foobar and gnu theories, which will be equipped with the system in forward mode.

  3. The program is to be executed
        krt -b equipe.kin equipe.ex

Example of Use

If the equipe.ex file contains:

    Equipe(‘‘test.src’’ | ForwardDirection)

and the test.src file contains:

THEORY stuff IS  
 
 foo  
 =>  
 gnat;  
 
 foobar  
 =>  
 machin;  
 
 foo;  
 
 foobar  
 
END  
 
&  
 
THEORY ForwardDirection IS  
 
 foobar  
 =>  
 foo;  
 
 gnu  
 =>  
 gnat  
 
END

the launching of the equipe program

    krt -b equipe.kin equipe.ex

will result in:

THEORY stuff IS  
bcall1(BackwardRule(stuff.1)) &  
foo  
=>  
gnat  
 
;  
bcall1(BackwardRule(stuff.2)) &  
foobar  
=>  
machin  
 
;  
bcall1(AtomicRule(stuff.3))  
=>  
foo  
 
;  
bcall1(AtomicRule(stuff.4))  
=>  
foobar  
 
END  
 
&  
 
THEORY ForwardDirection IS  
foobar  
=>  
foo &  
 bcall1(ForwardRule(ForwardDirection.1))  
 
;  
gnu  
=>  
gnat &  
 bcall1(ForwardRule(ForwardDirection.2))  
 
END