TPTP Problem File: SWX018_1.p

View Solutions - Solve Problem

%------------------------------------------------------------------------------
% File     : SWX018_1 : TPTP v9.1.0. Released v9.1.0.
% Domain   : Software Verification
% Problem  : two-way-sort-2
% Version  : Especial.
% English  :

% Refs     : [Kot17] Kotelnikov (2017), Email to Geoff Sutcliffe
% Source   : [Kot17]
% Names    : two-way-sort-2 [Kot17]

% Status   : Theorem
% Rating   : ? v9.1.0
% Syntax   : Number of formulae    :   17 (   1 unt;   9 typ;   0 def)
%            Number of atoms       :   33 (   6 equ)
%            Maximal formula atoms :   12 (   4 avg)
%            Number of connectives :   23 (   3   ~;   3   |;  10   &)
%                                         (   0 <=>;   7  =>;   0  <=;   0 <~>)
%            Maximal formula depth :    7 (   5 avg)
%            Maximal term depth    :    2 (   1 avg)
%            Number of FOOLs       :    8 (   5 fml;   3 var)
%            Number of X terms     :    4 (   0  [];   0 ite;   4 let)
%            Number arithmetic     :   37 (  15 atm;   4 fun;   9 num;   9 var)
%            Number of types       :    3 (   1 usr;   1 ari)
%            Number of type conns  :    5 (   2   >;   3   *;   0   +;   0  <<)
%            Number of predicates  :    8 (   3 usr;   3 prp; 0-2 aty)
%            Number of functors    :    9 (   5 usr;   6 con; 0-3 aty)
%            Number of variables   :   15 (  15   !;   0   ?;  15   :)
% SPC      : TX0_THM_EQU_ARI

% Comments : This file was generated by Voogie.
%------------------------------------------------------------------------------
tff(array_int_bool,type,
    array_int_bool: $tType ).

tff(select_int_bool,type,
    select_int_bool: ( array_int_bool * $int ) > $o ).

tff(store_int_bool,type,
    store_int_bool: ( array_int_bool * $int * $o ) > array_int_bool ).

tff(a,type,
    a: array_int_bool ).

tff(bad,type,
    bad: $o ).

tff(i,type,
    i: $int ).

tff(j,type,
    j: $int ).

tff(n,type,
    n: $int ).

tff(t,type,
    t: $o ).

tff(voogie_precondition_1,axiom,
    ! [A: array_int_bool,V: $o,I: $int,J: $int] :
      ( ( I = J )
     => ( select_int_bool(store_int_bool(A,I,(V)),J) = (V) ) ) ).

tff(voogie_precondition_2,axiom,
    ! [A: array_int_bool,V: $o,I: $int,J: $int] :
      ( ( I != J )
     => ( select_int_bool(store_int_bool(A,I,(V)),J) = select_int_bool(A,J) ) ) ).

tff(voogie_precondition_3,axiom,
    ! [A: array_int_bool,B: array_int_bool] :
      ( ! [I: $int] : ( select_int_bool(A,I) = select_int_bool(B,I) )
     => ( A = B ) ) ).

tff(voogie_precondition_4,axiom,
    $greater(n,0) ).

tff(voogie_precondition_5,axiom,
    ( $lesseq(0,i)
    & $lesseq(i,$sum(j,1))
    & $lesseq($sum(j,1),n) ) ).

tff(voogie_precondition_6,axiom,
    ! [M: $int] :
      ( ( $lesseq(0,M)
        & $less(M,i) )
     => ~ select_int_bool(a,M) ) ).

tff(voogie_precondition_7,axiom,
    ! [K: $int] :
      ( ( $less(j,K)
        & $less(K,n) )
     => select_int_bool(a,K) ) ).

tff(voogie_conjecture,conjecture,
    $let(
      bad: $o,
      bad:= 
        $ite(~ $lesseq(i,j),$true,bad),
      $let(
        [ j: $int,
          i: $int,
          a: array_int_bool,
          t: $o ],
        [j,i,a,t]:= 
          $ite(
            ~ select_int_bool(a,i),
            $let(
              i: $int,
              i:= $sum(i,1),
              [j,i,a,t] ),
            $ite(
              select_int_bool(a,j),
              $let(
                j: $int,
                j:= $difference(j,1),
                [j,i,a,t] ),
              $let(
                t: $o,
                t:= select_int_bool(a,i),
                $let(
                  a: array_int_bool,
                  a:= store_int_bool(a,i,select_int_bool(a,j)),
                  $let(
                    a: array_int_bool,
                    a:= store_int_bool(a,j,t),
                    $let(
                      i: $int,
                      i:= $sum(i,1),
                      $let(
                        j: $int,
                        j:= $difference(j,1),
                        [j,i,a,t] ) ) ) ) ) ) ),
        $let(
          bad: $o,
          bad:= 
            $ite(~ $lesseq(i,j),$true,bad),
          $let(
            [ j: $int,
              i: $int,
              a: array_int_bool,
              t: $o ],
            [j,i,a,t]:= 
              $ite(
                ~ select_int_bool(a,i),
                $let(
                  i: $int,
                  i:= $sum(i,1),
                  [j,i,a,t] ),
                $ite(
                  select_int_bool(a,j),
                  $let(
                    j: $int,
                    j:= $difference(j,1),
                    [j,i,a,t] ),
                  $let(
                    t: $o,
                    t:= select_int_bool(a,i),
                    $let(
                      a: array_int_bool,
                      a:= store_int_bool(a,i,select_int_bool(a,j)),
                      $let(
                        a: array_int_bool,
                        a:= store_int_bool(a,j,t),
                        $let(
                          i: $int,
                          i:= $sum(i,1),
                          $let(
                            j: $int,
                            j:= $difference(j,1),
                            [j,i,a,t] ) ) ) ) ) ) ),
            ( ( bad
              | ( $lesseq(0,i)
                & $lesseq(i,$sum(j,1))
                & $lesseq($sum(j,1),n) ) )
            & ( bad
              | ! [M: $int] :
                  ( ( $lesseq(0,M)
                    & $less(M,i) )
                 => ~ select_int_bool(a,M) ) )
            & ( bad
              | ! [K: $int] :
                  ( ( $less(j,K)
                    & $less(K,n) )
                 => select_int_bool(a,K) ) ) ) ) ) ) ) ).

%------------------------------------------------------------------------------