
(********************************************************************)
(*                                                                  *)
(*  chkbool.sd7   Checks boolean operations                         *)
(*  Copyright (C) 1992, 1993, 1994, 2004  Thomas Mertes             *)
(*                                                                  *)
(*  This program is free software; you can redistribute it and/or   *)
(*  modify it under the terms of the GNU General Public License as  *)
(*  published by the Free Software Foundation; either version 2 of  *)
(*  the License, or (at your option) any later version.             *)
(*                                                                  *)
(*  This program is distributed in the hope that it will be useful, *)
(*  but WITHOUT ANY WARRANTY; without even the implied warranty of  *)
(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   *)
(*  GNU General Public License for more details.                    *)
(*                                                                  *)
(*  You should have received a copy of the GNU General Public       *)
(*  License along with this program; if not, write to the           *)
(*  Free Software Foundation, Inc., 51 Franklin Street,             *)
(*  Fifth Floor, Boston, MA  02110-1301, USA.                       *)
(*                                                                  *)
(********************************************************************)


$ include "seed7_05.s7i";
  include "stdio.s7i";

const boolean: true_const is TRUE;
const boolean: false_const is FALSE;

var boolean: true_var is TRUE;
var boolean: false_var is FALSE;

var integer: counter is 0;


const proc: check_not is func
  begin
    if TRUE then
      if FALSE then
        writeln(" ***** FALSE evaluates to TRUE");
      else
        if not TRUE then
          writeln(" ***** not TRUE evaluates to TRUE");
        else
          if not FALSE then
            if true_var then
              if false_var then
                writeln(" ***** FALSE with variables evaluates to TRUE");
              else
                if not true_var then
                  writeln(" ***** not TRUE with variables evaluates to TRUE");
                else
                  if not false_var then
                    if (1 = 1) then
                      if (1 <> 1) then
                        writeln(" ***** FALSE with expressions evaluates to TRUE");
                      else
                        if not (1 = 1) then
                          writeln(" ***** not TRUE with expressions evaluates to TRUE");
                        else
                          if not (1 <> 1) then
                            writeln("Boolean not works correct.");
                          else
                            writeln(" ***** not FALSE with expressions evaluates to FALSE");
                          end if;
                        end if;
                      end if;
                    else
                      writeln(" ***** TRUE with expressions evaluates to FALSE");
                    end if;
                  else
                    writeln(" ***** not FALSE with variables evaluates to FALSE");
                  end if;
                end if;
              end if;
            else
              writeln(" ***** TRUE with variables evaluates to FALSE");
            end if;
          else
            writeln(" ***** not FALSE evaluates to FALSE");
          end if;
        end if;
      end if;
    else
      writeln(" ***** TRUE evaluates to FALSE");
    end if;
  end func;


const proc: check_and is func
  begin
    if TRUE and TRUE then
      if TRUE and FALSE then
        writeln(" ***** TRUE and FALSE evaluates to TRUE");
      else
        if FALSE and TRUE then
          writeln(" ***** FALSE and TRUE evaluates to TRUE");
        else
          if FALSE and FALSE then
            writeln(" ***** FALSE and FALSE evaluates to TRUE");
          else
            if true_var and true_var then
              if true_var and false_var then
                writeln(" ***** TRUE and FALSE with variables evaluates to TRUE");
              else
                if false_var and true_var then
                  writeln(" ***** FALSE and TRUE with variables evaluates to TRUE");
                else
                  if false_var and false_var then
                    writeln(" ***** FALSE and FALSE with variables evaluates to TRUE");
                  else
                    if (1 = 1) and (1 = 1) then
                      if (1 = 1) and (1 <> 1) then
                        writeln(" ***** TRUE and FALSE with expressions evaluates to TRUE");
                      else
                        if (1 <> 1) and (1 = 1) then
                          writeln(" ***** FALSE and TRUE with expressions evaluates to TRUE");
                        else
                          if (1 <> 1) and (1 <> 1) then
                            writeln(" ***** FALSE and FALSE with expressions evaluates to TRUE");
                          else
                            writeln("Boolean and works correct.");
                          end if;
                        end if;
                      end if;
                    else
                      writeln(" ***** TRUE and TRUE with expressions evaluates to FALSE");
                    end if;
                  end if;
                end if;
              end if;
            else
              writeln(" ***** TRUE and TRUE with variables evaluates to FALSE");
            end if;
          end if;
        end if;
      end if;
    else
      writeln(" ***** TRUE and TRUE evaluates to FALSE");
    end if;
  end func;


const proc: check_or is func
  begin
    if TRUE or TRUE then
      if TRUE or FALSE then
        if FALSE or TRUE then
          if FALSE or FALSE then
            writeln(" ***** FALSE or FALSE evaluates to TRUE");
          else
            if true_var or true_var then
              if true_var or false_var then
                if false_var or true_var then
                  if false_var or false_var then
                    writeln(" ***** FALSE or FALSE with variables evaluates to TRUE");
                  else
                    if (1 = 1) or (1 = 1) then
                      if (1 = 1) or (1 <> 1) then
                        if (1 <> 1) or (1 = 1) then
                          if (1 <> 1) or (1 <> 1) then
                            writeln(" ***** FALSE or FALSE with expressions evaluates to TRUE");
                          else
                            writeln("Boolean or works correct.");
                          end if;
                        else
                          writeln(" ***** FALSE or TRUE with expressions evaluates to FALSE");
                        end if;
                      else
                        writeln(" ***** TRUE or FALSE with expressions evaluates to FALSE");
                      end if;
                    else
                      writeln(" ***** TRUE or TRUE with expressions evaluates to FALSE");
                    end if;
                  end if;
                else
                  writeln(" ***** FALSE or TRUE with variables evaluates to FALSE");
                end if;
              else
                writeln(" ***** TRUE or FALSE with variables evaluates to FALSE");
              end if;
            else
              writeln(" ***** TRUE or TRUE with variables evaluates to FALSE");
            end if;
          end if;
        else
          writeln(" ***** FALSE or TRUE evaluates to FALSE");
        end if;
      else
        writeln(" ***** TRUE or FALSE evaluates to FALSE");
      end if;
    else
      writeln(" ***** TRUE or TRUE evaluates to FALSE");
    end if;
  end func;


const proc: check_eq_expr is func
  begin
    if (1 = 1) = (1 = 1) then
      if (1 <> 1) = (1 <> 1) then
        if (1 = 1) = (1 <> 1) then
          writeln(" ***** TRUE = FALSE with expressions evaluates to TRUE");
        else
          if (1 <> 1) = (1 = 1) then
            writeln(" ***** FALSE = TRUE with expressions evaluates to TRUE");
          else
            incr(counter);
          end if;
        end if;
      else
        writeln(" ***** FALSE = FALSE with expressions evaluates to FALSE");
      end if;
    else
      writeln(" ***** TRUE = TRUE with expressions evaluates to FALSE");
    end if;
  end func;


const proc: check_eq_ref_param (ref boolean: true_param, ref boolean: false_param) is func
  begin
    if true_param = true_param then
      if false_param = false_param then
        if true_param = false_param then
          writeln(" ***** TRUE = FALSE with ref parameters evaluates to TRUE");
        else
          if false_param = true_param then
            writeln(" ***** FALSE = TRUE with ref parameters evaluates to TRUE");
          else
            incr(counter);
          end if;
        end if;
      else
        writeln(" ***** FALSE = FALSE with ref parameters evaluates to FALSE");
      end if;
    else
      writeln(" ***** TRUE = TRUE with ref parameters evaluates to FALSE");
    end if;
  end func;


const proc: check_eq_in_param (in boolean: true_param, in boolean: false_param) is func
  begin
    if true_param = true_param then
      if false_param = false_param then
        if true_param = false_param then
          writeln(" ***** TRUE = FALSE with in parameters evaluates to TRUE");
        else
          if false_param = true_param then
            writeln(" ***** FALSE = TRUE with in parameters evaluates to TRUE");
          else
            incr(counter);
          end if;
        end if;
      else
        writeln(" ***** FALSE = FALSE with in parameters evaluates to FALSE");
      end if;
    else
      writeln(" ***** TRUE = TRUE with in parameters evaluates to FALSE");
    end if;
  end func;


const proc: check_eq_local_var is func
  local
    var boolean: local_true_var is TRUE;
    var boolean: local_false_var is FALSE;
  begin
    if local_true_var = local_true_var then
      if local_false_var = local_false_var then
        if local_true_var = local_false_var then
          writeln(" ***** TRUE = FALSE with local variables evaluates to TRUE");
        else
          if local_false_var = local_true_var then
            writeln(" ***** FALSE = TRUE with local variables evaluates to TRUE");
          else
            incr(counter);
          end if;
        end if;
      else
        writeln(" ***** FALSE = FALSE with local variables evaluates to FALSE");
      end if;
    else
      writeln(" ***** TRUE = TRUE with local variables evaluates to FALSE");
    end if;
  end func;


const proc: check_eq_global_var is func
  begin
    if true_var = true_var then
      if false_var = false_var then
        if true_var = false_var then
          writeln(" ***** TRUE = FALSE with global variables evaluates to TRUE");
        else
          if false_var = true_var then
            writeln(" ***** FALSE = TRUE with global variables evaluates to TRUE");
          else
            incr(counter);
          end if;
        end if;
      else
        writeln(" ***** FALSE = FALSE with global variables evaluates to FALSE");
      end if;
    else
      writeln(" ***** TRUE = TRUE with global variables evaluates to FALSE");
    end if;
  end func;


const proc: check_eq_global_const is func
  begin
    if true_const = true_const then
      if false_const = false_const then
        if true_const = false_const then
          writeln(" ***** TRUE = FALSE with global constants evaluates to TRUE");
        else
          if false_const = true_const then
            writeln(" ***** FALSE = TRUE with global constants evaluates to TRUE");
          else
            incr(counter);
          end if;
        end if;
      else
        writeln(" ***** FALSE = FALSE with global constants evaluates to FALSE");
      end if;
    else
      writeln(" ***** TRUE = TRUE with global constants evaluates to FALSE");
    end if;
  end func;


const proc: check_eq_literal is func
  begin
    if TRUE = TRUE then
      if FALSE = FALSE then
        if TRUE = FALSE then
          writeln(" ***** TRUE = FALSE evaluates to TRUE");
        else
          if FALSE = TRUE then
            writeln(" ***** FALSE = TRUE evaluates to TRUE");
          else
            incr(counter);
          end if;
        end if;
      else
        writeln(" ***** FALSE = FALSE evaluates to FALSE");
      end if;
    else
      writeln(" ***** TRUE = TRUE evaluates to FALSE");
    end if;
  end func;


const proc: check_eq is func
  begin
    counter := 0;
    check_eq_literal();
    check_eq_global_const();
    check_eq_global_var();
    check_eq_local_var();
    check_eq_in_param(TRUE, FALSE);
    check_eq_ref_param(TRUE, FALSE);
    check_eq_expr();
    if counter = 7 then
      writeln("Boolean = works correct.");
    else
      writeln(" ***** Boolean = does not work correct.");
    end if;
  end func;


const proc: check_ne_expr is func
  begin
    if (1 = 1) <> (1 = 1) then
      writeln(" ***** TRUE <> TRUE with expressions evaluates to TRUE");
    else
      if (1 <> 1) <> (1 <> 1) then
        writeln(" ***** FALSE <> FALSE with expressions evaluates to TRUE");
      else
        if (1 = 1) <> (1 <> 1) then
          if (1 <> 1) <> (1 = 1) then
            incr(counter);
          else
            writeln(" ***** FALSE <> TRUE with expressions evaluates to FALSE");
          end if;
        else
          writeln(" ***** TRUE <> FALSE with expressions evaluates to FALSE");
        end if;
      end if;
    end if;
  end func;


const proc: check_ne_ref_param (ref boolean: true_param, ref boolean: false_param) is func
  begin
    if true_param <> true_param then
      writeln(" ***** TRUE <> TRUE with ref parameters evaluates to TRUE");
    else
      if false_param <> false_param then
        writeln(" ***** FALSE <> FALSE with ref parameters evaluates to TRUE");
      else
        if true_param <> false_param then
          if false_param <> true_param then
            incr(counter);
          else
            writeln(" ***** FALSE <> TRUE with ref parameters evaluates to FALSE");
          end if;
        else
          writeln(" ***** TRUE <> FALSE with ref parameters evaluates to FALSE");
        end if;
      end if;
    end if;
  end func;


const proc: check_ne_in_param (in boolean: true_param, in boolean: false_param) is func
  begin
    if true_param <> true_param then
      writeln(" ***** TRUE <> TRUE with in parameters evaluates to TRUE");
    else
      if false_param <> false_param then
        writeln(" ***** FALSE <> FALSE with in parameters evaluates to TRUE");
      else
        if true_param <> false_param then
          if false_param <> true_param then
            incr(counter);
          else
            writeln(" ***** FALSE <> TRUE with in parameters evaluates to FALSE");
          end if;
        else
          writeln(" ***** TRUE <> FALSE with in parameters evaluates to FALSE");
        end if;
      end if;
    end if;
  end func;


const proc: check_ne_local_var is func
  local
    var boolean: local_true_var is TRUE;
    var boolean: local_false_var is FALSE;
  begin
    if local_true_var <> local_true_var then
      writeln(" ***** TRUE <> TRUE with local variables evaluates to TRUE");
    else
      if local_false_var <> local_false_var then
        writeln(" ***** FALSE <> FALSE with local variables evaluates to TRUE");
      else
        if local_true_var <> local_false_var then
          if local_false_var <> local_true_var then
            incr(counter);
          else
            writeln(" ***** FALSE <> TRUE with local variables evaluates to FALSE");
          end if;
        else
          writeln(" ***** TRUE <> FALSE with local variables evaluates to FALSE");
        end if;
      end if;
    end if;
  end func;


const proc: check_ne_global_var is func
  begin
    if true_var <> true_var then
      writeln(" ***** TRUE <> TRUE with global variables evaluates to TRUE");
    else
      if false_var <> false_var then
        writeln(" ***** FALSE <> FALSE with global variables evaluates to TRUE");
      else
        if true_var <> false_var then
          if false_var <> true_var then
            incr(counter);
          else
            writeln(" ***** FALSE <> TRUE with global variables evaluates to FALSE");
          end if;
        else
          writeln(" ***** TRUE <> FALSE with global variables evaluates to FALSE");
        end if;
      end if;
    end if;
  end func;


const proc: check_ne_global_const is func
  begin
    if true_const <> true_const then
      writeln(" ***** TRUE <> TRUE with global constants evaluates to TRUE");
    else
      if false_const <> false_const then
        writeln(" ***** FALSE <> FALSE with global constants evaluates to TRUE");
      else
        if true_const <> false_const then
          if false_const <> true_const then
            incr(counter);
          else
            writeln(" ***** FALSE <> TRUE with global constants evaluates to FALSE");
          end if;
        else
          writeln(" ***** TRUE <> FALSE with global constants evaluates to FALSE");
        end if;
      end if;
    end if;
  end func;


const proc: check_ne_literal is func
  begin
    if TRUE <> TRUE then
      writeln(" ***** TRUE <> TRUE evaluates to TRUE");
    else
      if FALSE <> FALSE then
        writeln(" ***** FALSE <> FALSE evaluates to TRUE");
      else
        if TRUE <> FALSE then
          if FALSE <> TRUE then
            incr(counter);
          else
            writeln(" ***** FALSE <> TRUE evaluates to FALSE");
          end if;
        else
          writeln(" ***** TRUE <> FALSE evaluates to FALSE");
        end if;
      end if;
    end if;
  end func;


const proc: check_ne is func
  begin
    counter := 0;
    check_ne_literal();
    check_ne_global_const();
    check_ne_global_var();
    check_ne_local_var();
    check_ne_in_param(TRUE, FALSE);
    check_ne_ref_param(TRUE, FALSE);
    check_ne_expr();
    if counter = 7 then
      writeln("Boolean <> works correct.");
    else
      writeln(" ***** Boolean <> does not work correct.");
    end if;
  end func;


const proc: check_gt_expr is func
  begin
    if (1 = 1) > (1 = 1) then
      writeln(" ***** TRUE > TRUE with expressions evaluates to TRUE");
    else
      if (1 <> 1) > (1 <> 1) then
        writeln(" ***** FALSE > FALSE with expressions evaluates to TRUE");
      else
        if (1 = 1) > (1 <> 1) then
          if (1 <> 1) > (1 = 1) then
            writeln(" ***** FALSE > TRUE with expressions evaluates to TRUE");
          else
            incr(counter);
          end if;
        else
          writeln(" ***** TRUE > FALSE with expressions evaluates to FALSE");
        end if;
      end if;
    end if;
  end func;


const proc: check_gt_ref_param (ref boolean: true_param, ref boolean: false_param) is func
  begin
    if true_param > true_param then
      writeln(" ***** TRUE > TRUE with ref parameters evaluates to TRUE");
    else
      if false_param > false_param then
        writeln(" ***** FALSE > FALSE with ref parameters evaluates to TRUE");
      else
        if true_param > false_param then
          if false_param > true_param then
            writeln(" ***** FALSE > TRUE with ref parameters evaluates to TRUE");
          else
            incr(counter);
          end if;
        else
          writeln(" ***** TRUE > FALSE with ref parameters evaluates to FALSE");
        end if;
      end if;
    end if;
  end func;


const proc: check_gt_in_param (in boolean: true_param, in boolean: false_param) is func
  begin
    if true_param > true_param then
      writeln(" ***** TRUE > TRUE with in parameters evaluates to TRUE");
    else
      if false_param > false_param then
        writeln(" ***** FALSE > FALSE with in parameters evaluates to TRUE");
      else
        if true_param > false_param then
          if false_param > true_param then
            writeln(" ***** FALSE > TRUE with in parameters evaluates to TRUE");
          else
            incr(counter);
          end if;
        else
          writeln(" ***** TRUE > FALSE with in parameters evaluates to FALSE");
        end if;
      end if;
    end if;
  end func;


const proc: check_gt_local_var is func
  local
    var boolean: local_true_var is TRUE;
    var boolean: local_false_var is FALSE;
  begin
    if local_true_var > local_true_var then
      writeln(" ***** TRUE > TRUE with local variables evaluates to TRUE");
    else
      if local_false_var > local_false_var then
        writeln(" ***** FALSE > FALSE with local variables evaluates to TRUE");
      else
        if local_true_var > local_false_var then
          if local_false_var > local_true_var then
            writeln(" ***** FALSE > TRUE with local variables evaluates to TRUE");
          else
            incr(counter);
          end if;
        else
          writeln(" ***** TRUE > FALSE with local variables evaluates to FALSE");
        end if;
      end if;
    end if;
  end func;


const proc: check_gt_global_var is func
  begin
    if true_var > true_var then
      writeln(" ***** TRUE > TRUE with global variables evaluates to TRUE");
    else
      if false_var > false_var then
        writeln(" ***** FALSE > FALSE with global variables evaluates to TRUE");
      else
        if true_var > false_var then
          if false_var > true_var then
            writeln(" ***** FALSE > TRUE with global variables evaluates to TRUE");
          else
            incr(counter);
          end if;
        else
          writeln(" ***** TRUE > FALSE with global variables evaluates to FALSE");
        end if;
      end if;
    end if;
  end func;


const proc: check_gt_global_const is func
  begin
    if true_const > true_const then
      writeln(" ***** TRUE > TRUE with global constants evaluates to TRUE");
    else
      if false_const > false_const then
        writeln(" ***** FALSE > FALSE with global constants evaluates to TRUE");
      else
        if true_const > false_const then
          if false_const > true_const then
            writeln(" ***** FALSE > TRUE with global constants evaluates to TRUE");
          else
            incr(counter);
          end if;
        else
          writeln(" ***** TRUE > FALSE with global constants evaluates to FALSE");
        end if;
      end if;
    end if;
  end func;


const proc: check_gt_literal is func
  begin
    if TRUE > TRUE then
      writeln(" ***** TRUE > TRUE evaluates to TRUE");
    else
      if FALSE > FALSE then
        writeln(" ***** FALSE > FALSE evaluates to TRUE");
      else
        if TRUE > FALSE then
          if FALSE > TRUE then
            writeln(" ***** FALSE > TRUE evaluates to TRUE");
          else
            incr(counter);
          end if;
        else
          writeln(" ***** TRUE > FALSE evaluates to FALSE");
        end if;
      end if;
    end if;
  end func;


const proc: check_gt is func
  begin
    counter := 0;
    check_gt_literal();
    check_gt_global_const();
    check_gt_global_var();
    check_gt_local_var();
    check_gt_in_param(TRUE, FALSE);
    check_gt_ref_param(TRUE, FALSE);
    check_gt_expr();
    if counter = 7 then
      writeln("Boolean > works correct.");
    else
      writeln(" ***** Boolean > does not work correct.");
    end if;
  end func;


const proc: check_ge_expr is func
  begin
    if (1 = 1) >= (1 = 1) then
      if (1 <> 1) >= (1 <> 1) then
        if (1 = 1) >= (1 <> 1) then
          if (1 <> 1) >= (1 = 1) then
            writeln(" ***** FALSE >= TRUE with expressions evaluates to TRUE");
          else
            incr(counter);
          end if;
        else
          writeln(" ***** TRUE >= FALSE with expressions evaluates to FALSE");
        end if;
      else
        writeln(" ***** FALSE >= FALSE with expressions evaluates to FALSE");
      end if;
    else
      writeln(" ***** TRUE >= TRUE with expressions evaluates to FALSE");
    end if;
  end func;


const proc: check_ge_ref_param (ref boolean: true_param, ref boolean: false_param) is func
  begin
    if true_param >= true_param then
      if false_param >= false_param then
        if true_param >= false_param then
          if false_param >= true_param then
            writeln(" ***** FALSE >= TRUE with ref parameters evaluates to TRUE");
          else
            incr(counter);
          end if;
        else
          writeln(" ***** TRUE >= FALSE with ref parameters evaluates to FALSE");
        end if;
      else
        writeln(" ***** FALSE >= FALSE with ref parameters evaluates to FALSE");
      end if;
    else
      writeln(" ***** TRUE >= TRUE with ref parameters evaluates to FALSE");
    end if;
  end func;


const proc: check_ge_in_param (in boolean: true_param, in boolean: false_param) is func
  begin
    if true_param >= true_param then
      if false_param >= false_param then
        if true_param >= false_param then
          if false_param >= true_param then
            writeln(" ***** FALSE >= TRUE with in parameters evaluates to TRUE");
          else
            incr(counter);
          end if;
        else
          writeln(" ***** TRUE >= FALSE with in parameters evaluates to FALSE");
        end if;
      else
        writeln(" ***** FALSE >= FALSE with in parameters evaluates to FALSE");
      end if;
    else
      writeln(" ***** TRUE >= TRUE with in parameters evaluates to FALSE");
    end if;
  end func;


const proc: check_ge_local_var is func
  local
    var boolean: local_true_var is TRUE;
    var boolean: local_false_var is FALSE;
  begin
    if local_true_var >= local_true_var then
      if local_false_var >= local_false_var then
        if local_true_var >= local_false_var then
          if local_false_var >= local_true_var then
            writeln(" ***** FALSE >= TRUE with local variables evaluates to TRUE");
          else
            incr(counter);
          end if;
        else
          writeln(" ***** TRUE >= FALSE with local variables evaluates to FALSE");
        end if;
      else
        writeln(" ***** FALSE >= FALSE with local variables evaluates to FALSE");
      end if;
    else
      writeln(" ***** TRUE >= TRUE with local variables evaluates to FALSE");
    end if;
  end func;


const proc: check_ge_global_var is func
  begin
    if true_var >= true_var then
      if false_var >= false_var then
        if true_var >= false_var then
          if false_var >= true_var then
            writeln(" ***** FALSE >= TRUE with global variables evaluates to TRUE");
          else
            incr(counter);
          end if;
        else
          writeln(" ***** TRUE >= FALSE with global variables evaluates to FALSE");
        end if;
      else
        writeln(" ***** FALSE >= FALSE with global variables evaluates to FALSE");
      end if;
    else
      writeln(" ***** TRUE >= TRUE with global variables evaluates to FALSE");
    end if;
  end func;


const proc: check_ge_global_const is func
  begin
    if true_const >= true_const then
      if false_const >= false_const then
        if true_const >= false_const then
          if false_const >= true_const then
            writeln(" ***** FALSE >= TRUE with global constants evaluates to TRUE");
          else
            incr(counter);
          end if;
        else
          writeln(" ***** TRUE >= FALSE with global constants evaluates to FALSE");
        end if;
      else
        writeln(" ***** FALSE >= FALSE with global constants evaluates to FALSE");
      end if;
    else
      writeln(" ***** TRUE >= TRUE with global constants evaluates to FALSE");
    end if;
  end func;


const proc: check_ge_literal is func
  begin
    if TRUE >= TRUE then
      if FALSE >= FALSE then
        if TRUE >= FALSE then
          if FALSE >= TRUE then
            writeln(" ***** FALSE >= TRUE evaluates to TRUE");
          else
            incr(counter);
          end if;
        else
          writeln(" ***** TRUE >= FALSE evaluates to FALSE");
        end if;
      else
        writeln(" ***** FALSE >= FALSE evaluates to FALSE");
      end if;
    else
      writeln(" ***** TRUE >= TRUE evaluates to FALSE");
    end if;
  end func;


const proc: check_ge is func
  begin
    counter := 0;
    check_ge_literal();
    check_ge_global_const();
    check_ge_global_var();
    check_ge_local_var();
    check_ge_in_param(TRUE, FALSE);
    check_ge_ref_param(TRUE, FALSE);
    check_ge_expr();
    if counter = 7 then
      writeln("Boolean >= works correct.");
    else
      writeln(" ***** Boolean >= does not work correct.");
    end if;
  end func;


const proc: check_lt_expr is func
  begin
    if (1 = 1) < (1 = 1) then
      writeln(" ***** TRUE < TRUE with expressions evaluates to TRUE");
    else
      if (1 <> 1) < (1 <> 1) then
        writeln(" ***** FALSE < FALSE with expressions evaluates to TRUE");
      else
        if (1 = 1) < (1 <> 1) then
          writeln(" ***** TRUE < FALSE with expressions evaluates to TRUE");
        else
          if (1 <> 1) < (1 = 1) then
            incr(counter);
          else
            writeln(" ***** FALSE < TRUE with expressions evaluates to FALSE");
          end if;
        end if;
      end if;
    end if;
  end func;


const proc: check_lt_ref_param (ref boolean: true_param, ref boolean: false_param) is func
  begin
    if true_param < true_param then
      writeln(" ***** TRUE < TRUE with ref parameters evaluates to TRUE");
    else
      if false_param < false_param then
        writeln(" ***** FALSE < FALSE with ref parameters evaluates to TRUE");
      else
        if true_param < false_param then
          writeln(" ***** TRUE < FALSE with ref parameters evaluates to TRUE");
        else
          if false_param < true_param then
            incr(counter);
          else
            writeln(" ***** FALSE < TRUE with ref parameters evaluates to FALSE");
          end if;
        end if;
      end if;
    end if;
  end func;


const proc: check_lt_in_param (in boolean: true_param, in boolean: false_param) is func
  begin
    if true_param < true_param then
      writeln(" ***** TRUE < TRUE with in parameters evaluates to TRUE");
    else
      if false_param < false_param then
        writeln(" ***** FALSE < FALSE with in parameters evaluates to TRUE");
      else
        if true_param < false_param then
          writeln(" ***** TRUE < FALSE with in parameters evaluates to TRUE");
        else
          if false_param < true_param then
            incr(counter);
          else
            writeln(" ***** FALSE < TRUE with in parameters evaluates to FALSE");
          end if;
        end if;
      end if;
    end if;
  end func;


const proc: check_lt_local_var is func
  local
    var boolean: local_true_var is TRUE;
    var boolean: local_false_var is FALSE;
  begin
    if local_true_var < local_true_var then
      writeln(" ***** TRUE < TRUE with local variables evaluates to TRUE");
    else
      if local_false_var < local_false_var then
        writeln(" ***** FALSE < FALSE with local variables evaluates to TRUE");
      else
        if local_true_var < local_false_var then
          writeln(" ***** TRUE < FALSE with local variables evaluates to TRUE");
        else
          if local_false_var < local_true_var then
            incr(counter);
          else
            writeln(" ***** FALSE < TRUE with local variables evaluates to FALSE");
          end if;
        end if;
      end if;
    end if;
  end func;


const proc: check_lt_global_var is func
  begin
    if true_var < true_var then
      writeln(" ***** TRUE < TRUE with global variables evaluates to TRUE");
    else
      if false_var < false_var then
        writeln(" ***** FALSE < FALSE with global variables evaluates to TRUE");
      else
        if true_var < false_var then
          writeln(" ***** TRUE < FALSE with global variables evaluates to TRUE");
        else
          if false_var < true_var then
            incr(counter);
          else
            writeln(" ***** FALSE < TRUE with global variables evaluates to FALSE");
          end if;
        end if;
      end if;
    end if;
  end func;


const proc: check_lt_global_const is func
  begin
    if true_const < true_const then
      writeln(" ***** TRUE < TRUE with global constants evaluates to TRUE");
    else
      if false_const < false_const then
        writeln(" ***** FALSE < FALSE with global constants evaluates to TRUE");
      else
        if true_const < false_const then
          writeln(" ***** TRUE < FALSE with global constants evaluates to TRUE");
        else
          if false_const < true_const then
            incr(counter);
          else
            writeln(" ***** FALSE < TRUE with global constants evaluates to FALSE");
          end if;
        end if;
      end if;
    end if;
  end func;


const proc: check_lt_literal is func
  begin
    if TRUE < TRUE then
      writeln(" ***** TRUE < TRUE evaluates to TRUE");
    else
      if FALSE < FALSE then
        writeln(" ***** FALSE < FALSE evaluates to TRUE");
      else
        if TRUE < FALSE then
          writeln(" ***** TRUE < FALSE evaluates to TRUE");
        else
          if FALSE < TRUE then
            incr(counter);
          else
            writeln(" ***** FALSE < TRUE evaluates to FALSE");
          end if;
        end if;
      end if;
    end if;
  end func;


const proc: check_lt is func
  begin
    counter := 0;
    check_lt_literal();
    check_lt_global_const();
    check_lt_global_var();
    check_lt_local_var();
    check_lt_in_param(TRUE, FALSE);
    check_lt_ref_param(TRUE, FALSE);
    check_lt_expr();
    if counter = 7 then
      writeln("Boolean < works correct.");
    else
      writeln(" ***** Boolean < does not work correct.");
    end if;
  end func;


const proc: check_le_expr is func
  begin
    if (1 = 1) <= (1 = 1) then
      if (1 <> 1) <= (1 <> 1) then
        if (1 = 1) <= (1 <> 1) then
          writeln(" ***** TRUE <= FALSE with expressions evaluates to TRUE");
        else
          if (1 <> 1) <= (1 = 1) then
            incr(counter);
          else
            writeln(" ***** FALSE <= TRUE with expressions evaluates to FALSE");
          end if;
        end if;
      else
        writeln(" ***** FALSE <= FALSE with expressions evaluates to FALSE");
      end if;
    else
      writeln(" ***** TRUE <= TRUE with expressions evaluates to FALSE");
    end if;
  end func;


const proc: check_le_ref_param (ref boolean: true_param, ref boolean: false_param) is func
  begin
    if true_param <= true_param then
      if false_param <= false_param then
        if true_param <= false_param then
          writeln(" ***** TRUE <= FALSE with ref parameters evaluates to TRUE");
        else
          if false_param <= true_param then
            incr(counter);
          else
            writeln(" ***** FALSE <= TRUE with ref parameters evaluates to FALSE");
          end if;
        end if;
      else
        writeln(" ***** FALSE <= FALSE with ref parameters evaluates to FALSE");
      end if;
    else
      writeln(" ***** TRUE <= TRUE with ref parameters evaluates to FALSE");
    end if;
  end func;


const proc: check_le_in_param (in boolean: true_param, in boolean: false_param) is func
  begin
    if true_param <= true_param then
      if false_param <= false_param then
        if true_param <= false_param then
          writeln(" ***** TRUE <= FALSE with in parameters evaluates to TRUE");
        else
          if false_param <= true_param then
            incr(counter);
          else
            writeln(" ***** FALSE <= TRUE with in parameters evaluates to FALSE");
          end if;
        end if;
      else
        writeln(" ***** FALSE <= FALSE with in parameters evaluates to FALSE");
      end if;
    else
      writeln(" ***** TRUE <= TRUE with in parameters evaluates to FALSE");
    end if;
  end func;


const proc: check_le_local_var is func
  local
    var boolean: local_true_var is TRUE;
    var boolean: local_false_var is FALSE;
  begin
    if local_true_var <= local_true_var then
      if local_false_var <= local_false_var then
        if local_true_var <= local_false_var then
          writeln(" ***** TRUE <= FALSE with local variables evaluates to TRUE");
        else
          if local_false_var <= local_true_var then
            incr(counter);
          else
            writeln(" ***** FALSE <= TRUE with local variables evaluates to FALSE");
          end if;
        end if;
      else
        writeln(" ***** FALSE <= FALSE with local variables evaluates to FALSE");
      end if;
    else
      writeln(" ***** TRUE <= TRUE with local variables evaluates to FALSE");
    end if;
  end func;


const proc: check_le_global_var is func
  begin
    if true_var <= true_var then
      if false_var <= false_var then
        if true_var <= false_var then
          writeln(" ***** TRUE <= FALSE with global variables evaluates to TRUE");
        else
          if false_var <= true_var then
            incr(counter);
          else
            writeln(" ***** FALSE <= TRUE with global variables evaluates to FALSE");
          end if;
        end if;
      else
        writeln(" ***** FALSE <= FALSE with global variables evaluates to FALSE");
      end if;
    else
      writeln(" ***** TRUE <= TRUE with global variables evaluates to FALSE");
    end if;
  end func;


const proc: check_le_global_const is func
  begin
    if true_const <= true_const then
      if false_const <= false_const then
        if true_const <= false_const then
          writeln(" ***** TRUE <= FALSE with global constants evaluates to TRUE");
        else
          if false_const <= true_const then
            incr(counter);
          else
            writeln(" ***** FALSE <= TRUE with global constants evaluates to FALSE");
          end if;
        end if;
      else
        writeln(" ***** FALSE <= FALSE with global constants evaluates to FALSE");
      end if;
    else
      writeln(" ***** TRUE <= TRUE with global constants evaluates to FALSE");
    end if;
  end func;


const proc: check_le_literal is func
  begin
    if TRUE <= TRUE then
      if FALSE <= FALSE then
        if TRUE <= FALSE then
          writeln(" ***** TRUE <= FALSE evaluates to TRUE");
        else
          if FALSE <= TRUE then
            incr(counter);
          else
            writeln(" ***** FALSE <= TRUE evaluates to FALSE");
          end if;
        end if;
      else
        writeln(" ***** FALSE <= FALSE evaluates to FALSE");
      end if;
    else
      writeln(" ***** TRUE <= TRUE evaluates to FALSE");
    end if;
  end func;


const proc: check_le is func
  begin
    counter := 0;
    check_le_literal();
    check_le_global_const();
    check_le_global_var();
    check_le_local_var();
    check_le_in_param(TRUE, FALSE);
    check_le_ref_param(TRUE, FALSE);
    check_le_expr();
    if counter = 7 then
      writeln("Boolean <= works correct.");
    else
      writeln(" ***** Boolean <= does not work correct.");
    end if;
  end func;


const proc: check_relations is func
  begin
    check_eq();
    check_ne();
    check_gt();
    check_ge();
    check_lt();
    check_le();
  end func;


const proc: check_compare is func
  begin
    if compare(TRUE, TRUE) <> 0 then
      writeln(" ***** compare(TRUE, TRUE) does not return 0");
    else
      if compare(FALSE, FALSE) <> 0 then
        writeln(" ***** compare(FALSE, FALSE) does not return 0");
      else
        if compare(TRUE, FALSE) <> 1 then
          writeln(" ***** compare(TRUE, FALSE) does not return 1");
        else
          if compare(FALSE, TRUE) <> -1 then
            writeln(" ***** compare(FALSE, TRUE) does not return 0");
          else
            writeln("Boolean compare works correct.");
          end if;
        end if;
      end if;
    end if;
  end func;


const proc: check_ord_expr is func
  begin
    if ord(1 = 1) = 1 then
      if ord(1 <> 1) = 0 then
        incr(counter);
      else
        writeln(" ***** ord(FALSE) with expressions evaluates not to 0");
      end if;
    else
      writeln(" ***** ord(TRUE) with expressions evaluates not to 1");
    end if;
  end func;


const proc: check_ord_ref_param (ref boolean: true_param, ref boolean: false_param) is func
  begin
    if ord(true_param) = 1 then
      if ord(false_param) = 0 then
        incr(counter);
      else
        writeln(" ***** ord(FALSE) with ref parameters evaluates not to 0");
      end if;
    else
      writeln(" ***** ord(TRUE) with ref parameters evaluates not to 1");
    end if;
  end func;


const proc: check_ord_in_param (in boolean: true_param, in boolean: false_param) is func
  begin
    if ord(true_param) = 1 then
      if ord(false_param) = 0 then
        incr(counter);
      else
        writeln(" ***** ord(FALSE) with in parameters evaluates not to 0");
      end if;
    else
      writeln(" ***** ord(TRUE) with in parameters evaluates not to 1");
    end if;
  end func;


const proc: check_ord_local_var is func
  local
    var boolean: local_true_var is TRUE;
    var boolean: local_false_var is FALSE;
  begin
    if ord(local_true_var) = 1 then
      if ord(local_false_var) = 0 then
        incr(counter);
      else
        writeln(" ***** ord(FALSE) with local variables evaluates not to 0");
      end if;
    else
      writeln(" ***** ord(TRUE) with local variables evaluates not to 1");
    end if;
  end func;


const proc: check_ord_global_var is func
  begin
    if ord(true_var) = 1 then
      if ord(false_var) = 0 then
        incr(counter);
      else
        writeln(" ***** ord(FALSE) with global variables evaluates not to 0");
      end if;
    else
      writeln(" ***** ord(TRUE) with global variables evaluates not to 1");
    end if;
  end func;


const proc: check_ord_global_const is func
  begin
    if ord(true_const) = 1 then
      if ord(false_const) = 0 then
        incr(counter);
      else
        writeln(" ***** ord(FALSE) with global variables evaluates not to 0");
      end if;
    else
      writeln(" ***** ord(TRUE) with global variables evaluates not to 1");
    end if;
  end func;


const proc: check_ord_literal is func
  begin
    if ord(TRUE) = 1 then
      if ord(FALSE) = 0 then
        incr(counter);
      else
        writeln(" ***** ord(FALSE) evaluates not to 0");
      end if;
    else
      writeln(" ***** ord(TRUE) evaluates not to 1");
    end if;
  end func;


const proc: check_ord is func
  begin
    counter := 0;
    check_ord_literal();
    check_ord_global_const();
    check_ord_global_var();
    check_ord_local_var();
    check_ord_in_param(TRUE, FALSE);
    check_ord_ref_param(TRUE, FALSE);
    check_ord_expr();
    if counter = 7 then
      writeln("Boolean ord() works correct.");
    else
      writeln(" ***** Boolean ord() does not work correct.");
    end if;
  end func;

(*
const proc: check_rand_literal is func
  begin
    if rand(FALSE, FALSE) = FALSE then
      if rand(TRUE, TRUE) = TRUE then
        incr(counter);
      else
        writeln(" ***** rand(TRUE, TRUE) evaluates not to FALSE");
      end if;
    else
      writeln(" ***** rand(FALSE, FALSE) evaluates not to TRUE");
    end if;
  end func;


const proc: check_rand is func
  begin
    counter := 0;
    check_rand_literal();
    check_rand_global_const();
    check_rand_global_var();
    check_rand_local_var();
    check_rand_in_param(TRUE, FALSE);
    check_rand_ref_param(TRUE, FALSE);
    check_rand_expr();
    if counter = 7 then
      writeln("Boolean rand() works correct.");
    else
      writeln(" ***** Boolean rand() does not work correct.");
    end if;
  end func;
*)

const proc: check_str_expr is func
  begin
    if str(1 = 1) = "TRUE" then
      if str(1 <> 1) = "FALSE" then
        incr(counter);
      else
        writeln(" ***** str(FALSE) with expressions evaluates not to \"FALSE\"");
      end if;
    else
      writeln(" ***** str(TRUE) with expressions evaluates not to \"TRUE\"");
    end if;
  end func;


const proc: check_str_ref_param (ref boolean: true_param, ref boolean: false_param) is func
  begin
    if str(true_param) = "TRUE" then
      if str(false_param) = "FALSE" then
        incr(counter);
      else
        writeln(" ***** str(FALSE) with ref parameters evaluates not to \"FALSE\"");
      end if;
    else
      writeln(" ***** str(TRUE) with ref parameters evaluates not to \"TRUE\"");
    end if;
  end func;


const proc: check_str_in_param (in boolean: true_param, in boolean: false_param) is func
  begin
    if str(true_param) = "TRUE" then
      if str(false_param) = "FALSE" then
        incr(counter);
      else
        writeln(" ***** str(FALSE) with in parameters evaluates not to \"FALSE\"");
      end if;
    else
      writeln(" ***** str(TRUE) with in parameters evaluates not to \"TRUE\"");
    end if;
  end func;


const proc: check_str_local_var is func
  local
    var boolean: local_true_var is TRUE;
    var boolean: local_false_var is FALSE;
  begin
    if str(local_true_var) = "TRUE" then
      if str(local_false_var) = "FALSE" then
        incr(counter);
      else
        writeln(" ***** str(FALSE) with local variables evaluates not to \"FALSE\"");
      end if;
    else
      writeln(" ***** str(TRUE) with local variables evaluates not to \"TRUE\"");
    end if;
  end func;


const proc: check_str_global_var is func
  begin
    if str(true_var) = "TRUE" then
      if str(false_var) = "FALSE" then
        incr(counter);
      else
        writeln(" ***** str(FALSE) with global variables evaluates not to \"FALSE\"");
      end if;
    else
      writeln(" ***** str(TRUE) with global variables evaluates not to \"TRUE\"");
    end if;
  end func;


const proc: check_str_global_const is func
  begin
    if str(true_const) = "TRUE" then
      if str(false_const) = "FALSE" then
        incr(counter);
      else
        writeln(" ***** str(FALSE) with global variables evaluates not to \"FALSE\"");
      end if;
    else
      writeln(" ***** str(TRUE) with global variables evaluates not to \"TRUE\"");
    end if;
  end func;


const proc: check_str_literal is func
  begin
    if str(TRUE) = "TRUE" then
      if str(FALSE) = "FALSE" then
        incr(counter);
      else
        writeln(" ***** str(FALSE) evaluates not to \"FALSE\"");
      end if;
    else
      writeln(" ***** str(TRUE) evaluates not to \"TRUE\"");
    end if;
  end func;


const proc: check_str is func
  begin
    counter := 0;
    check_str_literal();
    check_str_global_const();
    check_str_global_var();
    check_str_local_var();
    check_str_in_param(TRUE, FALSE);
    check_str_ref_param(TRUE, FALSE);
    check_str_expr();
    if counter = 7 then
      writeln("Boolean str() works correct.");
    else
      writeln(" ***** Boolean str() does not work correct.");
    end if;
  end func;


const proc: check_ternary is func
  local
    var boolean: okay is TRUE;
  begin
    if  not ( TRUE ?  TRUE : FALSE) or
            ( TRUE ? FALSE :  TRUE) or
            (FALSE ?  TRUE : FALSE) or
        not (FALSE ? FALSE :  TRUE) or
        not ( TRUE ?  TRUE : false_var) or
            ( TRUE ? FALSE :  true_var) or
            (FALSE ?  TRUE : false_var) or
        not (FALSE ? FALSE :  true_var) or
        not ( TRUE ?  TRUE : false_const) or
            ( TRUE ? FALSE :  true_const) or
            (FALSE ?  TRUE : false_const) or
        not (FALSE ? FALSE :  true_const) or
        not ( TRUE ?  TRUE : FALSE or FALSE) or
            ( TRUE ? FALSE :  TRUE and TRUE) or
            (FALSE ?  TRUE : FALSE or FALSE) or
        not (FALSE ? FALSE :  TRUE and TRUE) or
        not ( TRUE ?  TRUE : false_var or false_var) or
            ( TRUE ? FALSE :  true_var and true_var) or
            (FALSE ?  TRUE : false_var or false_var) or
        not (FALSE ? FALSE :  true_var and true_var) or
        not ( TRUE ?  true_var : FALSE) or
            ( TRUE ? false_var :  TRUE) or
            (FALSE ?  true_var : FALSE) or
        not (FALSE ? false_var :  TRUE) or
        not ( TRUE ?  true_var : false_var) or
            ( TRUE ? false_var :  true_var) or
            (FALSE ?  true_var : false_var) or
        not (FALSE ? false_var :  true_var) or
        not ( TRUE ?  true_var : false_const) or
            ( TRUE ? false_var :  true_const) or
            (FALSE ?  true_var : false_const) or
        not (FALSE ? false_var :  true_const) or
        not ( TRUE ?  true_var : FALSE or FALSE) or
            ( TRUE ? false_var :  TRUE and TRUE) or
            (FALSE ?  true_var : FALSE or FALSE) or
        not (FALSE ? false_var :  TRUE and TRUE) or
        not ( TRUE ?  true_var : false_var or false_var) or
            ( TRUE ? false_var :  true_var and true_var) or
            (FALSE ?  true_var : false_var or false_var) or
        not (FALSE ? false_var :  true_var and true_var) or
        not ( TRUE ?  true_const : FALSE) or
            ( TRUE ? false_const :  TRUE) or
            (FALSE ?  true_const : FALSE) or
        not (FALSE ? false_const :  TRUE) or
        not ( TRUE ?  true_const : false_var) or
            ( TRUE ? false_const :  true_var) or
            (FALSE ?  true_const : false_var) or
        not (FALSE ? false_const :  true_var) or
        not ( TRUE ?  true_const : false_const) or
            ( TRUE ? false_const :  true_const) or
            (FALSE ?  true_const : false_const) or
        not (FALSE ? false_const :  true_const) or
        not ( TRUE ?  true_const : FALSE or FALSE) or
            ( TRUE ? false_const :  TRUE and TRUE) or
            (FALSE ?  true_const : FALSE or FALSE) or
        not (FALSE ? false_const :  TRUE and TRUE) or
        not ( TRUE ?  true_const : false_var or false_var) or
            ( TRUE ? false_const :  true_var and true_var) or
            (FALSE ?  true_const : false_var or false_var) or
        not (FALSE ? false_const :  true_var and true_var) or
        not ( TRUE ?  TRUE and TRUE : FALSE) or
            ( TRUE ? FALSE or FALSE :  TRUE) or
            (FALSE ?  TRUE and TRUE : FALSE) or
        not (FALSE ? FALSE or FALSE :  TRUE) or
        not ( TRUE ?  TRUE and TRUE : false_var) or
            ( TRUE ? FALSE or FALSE :  true_var) or
            (FALSE ?  TRUE and TRUE : false_var) or
        not (FALSE ? FALSE or FALSE :  true_var) or
        not ( TRUE ?  TRUE and TRUE : false_const) or
            ( TRUE ? FALSE or FALSE :  true_const) or
            (FALSE ?  TRUE and TRUE : false_const) or
        not (FALSE ? FALSE or FALSE :  true_const) or
        not ( TRUE ?  TRUE and TRUE : FALSE or FALSE) or
            ( TRUE ? FALSE or FALSE :  TRUE and TRUE) or
            (FALSE ?  TRUE and TRUE : FALSE or FALSE) or
        not (FALSE ? FALSE or FALSE :  TRUE and TRUE) or
        not ( TRUE ?  TRUE and TRUE : false_var or false_var) or
            ( TRUE ? FALSE or FALSE :  true_var and true_var) or
            (FALSE ?  TRUE and TRUE : false_var or false_var) or
        not (FALSE ? FALSE or FALSE :  true_var and true_var) or
        not ( TRUE ?  true_var and true_var : FALSE) or
            ( TRUE ? false_var or false_var :  TRUE) or
            (FALSE ?  true_var and true_var : FALSE) or
        not (FALSE ? false_var or false_var :  TRUE) or
        not ( TRUE ?  true_var and true_var : false_var) or
            ( TRUE ? false_var or false_var :  true_var) or
            (FALSE ?  true_var and true_var : false_var) or
        not (FALSE ? false_var or false_var :  true_var) or
        not ( TRUE ?  true_var and true_var : false_const) or
            ( TRUE ? false_var or false_var :  true_const) or
            (FALSE ?  true_var and true_var : false_const) or
        not (FALSE ? false_var or false_var :  true_const) or
        not ( TRUE ?  true_var and true_var : FALSE or FALSE) or
            ( TRUE ? false_var or false_var :  TRUE and TRUE) or
            (FALSE ?  true_var and true_var : FALSE or FALSE) or
        not (FALSE ? false_var or false_var :  TRUE and TRUE) or
        not ( TRUE ?  true_var and true_var : false_var or false_var) or
            ( TRUE ? false_var or false_var :  true_var and true_var) or
            (FALSE ?  true_var and true_var : false_var or false_var) or
        not (FALSE ? false_var or false_var :  true_var and true_var) then
      writeln(" ***** The ternary operator ? : does not work correct. (1)");
      okay := FALSE;
    end if;

    if  not ( true_var ?  TRUE : FALSE) or
            ( true_var ? FALSE :  TRUE) or
            (false_var ?  TRUE : FALSE) or
        not (false_var ? FALSE :  TRUE) or
        not ( true_var ?  TRUE : false_var) or
            ( true_var ? FALSE :  true_var) or
            (false_var ?  TRUE : false_var) or
        not (false_var ? FALSE :  true_var) or
        not ( true_var ?  TRUE : false_const) or
            ( true_var ? FALSE :  true_const) or
            (false_var ?  TRUE : false_const) or
        not (false_var ? FALSE :  true_const) or
        not ( true_var ?  TRUE : FALSE or FALSE) or
            ( true_var ? FALSE :  TRUE and TRUE) or
            (false_var ?  TRUE : FALSE or FALSE) or
        not (false_var ? FALSE :  TRUE and TRUE) or
        not ( true_var ?  TRUE : false_var or false_var) or
            ( true_var ? FALSE :  true_var and true_var) or
            (false_var ?  TRUE : false_var or false_var) or
        not (false_var ? FALSE :  true_var and true_var) or
        not ( true_var ?  true_var : FALSE) or
            ( true_var ? false_var :  TRUE) or
            (false_var ?  true_var : FALSE) or
        not (false_var ? false_var :  TRUE) or
        not ( true_var ?  true_var : false_var) or
            ( true_var ? false_var :  true_var) or
            (false_var ?  true_var : false_var) or
        not (false_var ? false_var :  true_var) or
        not ( true_var ?  true_var : false_const) or
            ( true_var ? false_var :  true_const) or
            (false_var ?  true_var : false_const) or
        not (false_var ? false_var :  true_const) or
        not ( true_var ?  true_var : FALSE or FALSE) or
            ( true_var ? false_var :  TRUE and TRUE) or
            (false_var ?  true_var : FALSE or FALSE) or
        not (false_var ? false_var :  TRUE and TRUE) or
        not ( true_var ?  true_var : false_var or false_var) or
            ( true_var ? false_var :  true_var and true_var) or
            (false_var ?  true_var : false_var or false_var) or
        not (false_var ? false_var :  true_var and true_var) or
        not ( true_var ?  true_const : FALSE) or
            ( true_var ? false_const :  TRUE) or
            (false_var ?  true_const : FALSE) or
        not (false_var ? false_const :  TRUE) or
        not ( true_var ?  true_const : false_var) or
            ( true_var ? false_const :  true_var) or
            (false_var ?  true_const : false_var) or
        not (false_var ? false_const :  true_var) or
        not ( true_var ?  true_const : false_const) or
            ( true_var ? false_const :  true_const) or
            (false_var ?  true_const : false_const) or
        not (false_var ? false_const :  true_const) or
        not ( true_var ?  true_const : FALSE or FALSE) or
            ( true_var ? false_const :  TRUE and TRUE) or
            (false_var ?  true_const : FALSE or FALSE) or
        not (false_var ? false_const :  TRUE and TRUE) or
        not ( true_var ?  true_const : false_var or false_var) or
            ( true_var ? false_const :  true_var and true_var) or
            (false_var ?  true_const : false_var or false_var) or
        not (false_var ? false_const :  true_var and true_var) or
        not ( true_var ?  TRUE and TRUE : FALSE) or
            ( true_var ? FALSE or FALSE :  TRUE) or
            (false_var ?  TRUE and TRUE : FALSE) or
        not (false_var ? FALSE or FALSE :  TRUE) or
        not ( true_var ?  TRUE and TRUE : false_var) or
            ( true_var ? FALSE or FALSE :  true_var) or
            (false_var ?  TRUE and TRUE : false_var) or
        not (false_var ? FALSE or FALSE :  true_var) or
        not ( true_var ?  TRUE and TRUE : false_const) or
            ( true_var ? FALSE or FALSE :  true_const) or
            (false_var ?  TRUE and TRUE : false_const) or
        not (false_var ? FALSE or FALSE :  true_const) or
        not ( true_var ?  TRUE and TRUE : FALSE or FALSE) or
            ( true_var ? FALSE or FALSE :  TRUE and TRUE) or
            (false_var ?  TRUE and TRUE : FALSE or FALSE) or
        not (false_var ? FALSE or FALSE :  TRUE and TRUE) or
        not ( true_var ?  TRUE and TRUE : false_var or false_var) or
            ( true_var ? FALSE or FALSE :  true_var and true_var) or
            (false_var ?  TRUE and TRUE : false_var or false_var) or
        not (false_var ? FALSE or FALSE :  true_var and true_var) or
        not ( true_var ?  true_var and true_var : FALSE) or
            ( true_var ? false_var or false_var :  TRUE) or
            (false_var ?  true_var and true_var : FALSE) or
        not (false_var ? false_var or false_var :  TRUE) or
        not ( true_var ?  true_var and true_var : false_var) or
            ( true_var ? false_var or false_var :  true_var) or
            (false_var ?  true_var and true_var : false_var) or
        not (false_var ? false_var or false_var :  true_var) or
        not ( true_var ?  true_var and true_var : false_const) or
            ( true_var ? false_var or false_var :  true_const) or
            (false_var ?  true_var and true_var : false_const) or
        not (false_var ? false_var or false_var :  true_const) or
        not ( true_var ?  true_var and true_var : FALSE or FALSE) or
            ( true_var ? false_var or false_var :  TRUE and TRUE) or
            (false_var ?  true_var and true_var : FALSE or FALSE) or
        not (false_var ? false_var or false_var :  TRUE and TRUE) or
        not ( true_var ?  true_var and true_var : false_var or false_var) or
            ( true_var ? false_var or false_var :  true_var and true_var) or
            (false_var ?  true_var and true_var : false_var or false_var) or
        not (false_var ? false_var or false_var :  true_var and true_var) then
      writeln(" ***** The ternary operator ? : does not work correct. (2)");
      okay := FALSE;
    end if;

    if  not ( true_const ?  TRUE : FALSE) or
            ( true_const ? FALSE :  TRUE) or
            (false_const ?  TRUE : FALSE) or
        not (false_const ? FALSE :  TRUE) or
        not ( true_const ?  TRUE : false_var) or
            ( true_const ? FALSE :  true_var) or
            (false_const ?  TRUE : false_var) or
        not (false_const ? FALSE :  true_var) or
        not ( true_const ?  TRUE : false_const) or
            ( true_const ? FALSE :  true_const) or
            (false_const ?  TRUE : false_const) or
        not (false_const ? FALSE :  true_const) or
        not ( true_const ?  TRUE : FALSE or FALSE) or
            ( true_const ? FALSE :  TRUE and TRUE) or
            (false_const ?  TRUE : FALSE or FALSE) or
        not (false_const ? FALSE :  TRUE and TRUE) or
        not ( true_const ?  TRUE : false_var or false_var) or
            ( true_const ? FALSE :  true_var and true_var) or
            (false_const ?  TRUE : false_var or false_var) or
        not (false_const ? FALSE :  true_var and true_var) or
        not ( true_const ?  true_var : FALSE) or
            ( true_const ? false_var :  TRUE) or
            (false_const ?  true_var : FALSE) or
        not (false_const ? false_var :  TRUE) or
        not ( true_const ?  true_var : false_var) or
            ( true_const ? false_var :  true_var) or
            (false_const ?  true_var : false_var) or
        not (false_const ? false_var :  true_var) or
        not ( true_const ?  true_var : false_const) or
            ( true_const ? false_var :  true_const) or
            (false_const ?  true_var : false_const) or
        not (false_const ? false_var :  true_const) or
        not ( true_const ?  true_var : FALSE or FALSE) or
            ( true_const ? false_var :  TRUE and TRUE) or
            (false_const ?  true_var : FALSE or FALSE) or
        not (false_const ? false_var :  TRUE and TRUE) or
        not ( true_const ?  true_var : false_var or false_var) or
            ( true_const ? false_var :  true_var and true_var) or
            (false_const ?  true_var : false_var or false_var) or
        not (false_const ? false_var :  true_var and true_var) or
        not ( true_const ?  true_const : FALSE) or
            ( true_const ? false_const :  TRUE) or
            (false_const ?  true_const : FALSE) or
        not (false_const ? false_const :  TRUE) or
        not ( true_const ?  true_const : false_var) or
            ( true_const ? false_const :  true_var) or
            (false_const ?  true_const : false_var) or
        not (false_const ? false_const :  true_var) or
        not ( true_const ?  true_const : false_const) or
            ( true_const ? false_const :  true_const) or
            (false_const ?  true_const : false_const) or
        not (false_const ? false_const :  true_const) or
        not ( true_const ?  true_const : FALSE or FALSE) or
            ( true_const ? false_const :  TRUE and TRUE) or
            (false_const ?  true_const : FALSE or FALSE) or
        not (false_const ? false_const :  TRUE and TRUE) or
        not ( true_const ?  true_const : false_var or false_var) or
            ( true_const ? false_const :  true_var and true_var) or
            (false_const ?  true_const : false_var or false_var) or
        not (false_const ? false_const :  true_var and true_var) or
        not ( true_const ?  TRUE and TRUE : FALSE) or
            ( true_const ? FALSE or FALSE :  TRUE) or
            (false_const ?  TRUE and TRUE : FALSE) or
        not (false_const ? FALSE or FALSE :  TRUE) or
        not ( true_const ?  TRUE and TRUE : false_var) or
            ( true_const ? FALSE or FALSE :  true_var) or
            (false_const ?  TRUE and TRUE : false_var) or
        not (false_const ? FALSE or FALSE :  true_var) or
        not ( true_const ?  TRUE and TRUE : false_const) or
            ( true_const ? FALSE or FALSE :  true_const) or
            (false_const ?  TRUE and TRUE : false_const) or
        not (false_const ? FALSE or FALSE :  true_const) or
        not ( true_const ?  TRUE and TRUE : FALSE or FALSE) or
            ( true_const ? FALSE or FALSE :  TRUE and TRUE) or
            (false_const ?  TRUE and TRUE : FALSE or FALSE) or
        not (false_const ? FALSE or FALSE :  TRUE and TRUE) or
        not ( true_const ?  TRUE and TRUE : false_var or false_var) or
            ( true_const ? FALSE or FALSE :  true_var and true_var) or
            (false_const ?  TRUE and TRUE : false_var or false_var) or
        not (false_const ? FALSE or FALSE :  true_var and true_var) or
        not ( true_const ?  true_var and true_var : FALSE) or
            ( true_const ? false_var or false_var :  TRUE) or
            (false_const ?  true_var and true_var : FALSE) or
        not (false_const ? false_var or false_var :  TRUE) or
        not ( true_const ?  true_var and true_var : false_var) or
            ( true_const ? false_var or false_var :  true_var) or
            (false_const ?  true_var and true_var : false_var) or
        not (false_const ? false_var or false_var :  true_var) or
        not ( true_const ?  true_var and true_var : false_const) or
            ( true_const ? false_var or false_var :  true_const) or
            (false_const ?  true_var and true_var : false_const) or
        not (false_const ? false_var or false_var :  true_const) or
        not ( true_const ?  true_var and true_var : FALSE or FALSE) or
            ( true_const ? false_var or false_var :  TRUE and TRUE) or
            (false_const ?  true_var and true_var : FALSE or FALSE) or
        not (false_const ? false_var or false_var :  TRUE and TRUE) or
        not ( true_const ?  true_var and true_var : false_var or false_var) or
            ( true_const ? false_var or false_var :  true_var and true_var) or
            (false_const ?  true_var and true_var : false_var or false_var) or
        not (false_const ? false_var or false_var :  true_var and true_var) then
      writeln(" ***** The ternary operator ? : does not work correct. (3)");
      okay := FALSE;
    end if;

    if  not ( TRUE and TRUE ?  TRUE : FALSE) or
            ( TRUE and TRUE ? FALSE :  TRUE) or
            (FALSE or FALSE ?  TRUE : FALSE) or
        not (FALSE or FALSE ? FALSE :  TRUE) or
        not ( TRUE and TRUE ?  TRUE : false_var) or
            ( TRUE and TRUE ? FALSE :  true_var) or
            (FALSE or FALSE ?  TRUE : false_var) or
        not (FALSE or FALSE ? FALSE :  true_var) or
        not ( TRUE and TRUE ?  TRUE : false_const) or
            ( TRUE and TRUE ? FALSE :  true_const) or
            (FALSE or FALSE ?  TRUE : false_const) or
        not (FALSE or FALSE ? FALSE :  true_const) or
        not ( TRUE and TRUE ?  TRUE : FALSE or FALSE) or
            ( TRUE and TRUE ? FALSE :  TRUE and TRUE) or
            (FALSE or FALSE ?  TRUE : FALSE or FALSE) or
        not (FALSE or FALSE ? FALSE :  TRUE and TRUE) or
        not ( TRUE and TRUE ?  TRUE : false_var or false_var) or
            ( TRUE and TRUE ? FALSE :  true_var and true_var) or
            (FALSE or FALSE ?  TRUE : false_var or false_var) or
        not (FALSE or FALSE ? FALSE :  true_var and true_var) or
        not ( TRUE and TRUE ?  true_var : FALSE) or
            ( TRUE and TRUE ? false_var :  TRUE) or
            (FALSE or FALSE ?  true_var : FALSE) or
        not (FALSE or FALSE ? false_var :  TRUE) or
        not ( TRUE and TRUE ?  true_var : false_var) or
            ( TRUE and TRUE ? false_var :  true_var) or
            (FALSE or FALSE ?  true_var : false_var) or
        not (FALSE or FALSE ? false_var :  true_var) or
        not ( TRUE and TRUE ?  true_var : false_const) or
            ( TRUE and TRUE ? false_var :  true_const) or
            (FALSE or FALSE ?  true_var : false_const) or
        not (FALSE or FALSE ? false_var :  true_const) or
        not ( TRUE and TRUE ?  true_var : FALSE or FALSE) or
            ( TRUE and TRUE ? false_var :  TRUE and TRUE) or
            (FALSE or FALSE ?  true_var : FALSE or FALSE) or
        not (FALSE or FALSE ? false_var :  TRUE and TRUE) or
        not ( TRUE and TRUE ?  true_var : false_var or false_var) or
            ( TRUE and TRUE ? false_var :  true_var and true_var) or
            (FALSE or FALSE ?  true_var : false_var or false_var) or
        not (FALSE or FALSE ? false_var :  true_var and true_var) or
        not ( TRUE and TRUE ?  true_const : FALSE) or
            ( TRUE and TRUE ? false_const :  TRUE) or
            (FALSE or FALSE ?  true_const : FALSE) or
        not (FALSE or FALSE ? false_const :  TRUE) or
        not ( TRUE and TRUE ?  true_const : false_var) or
            ( TRUE and TRUE ? false_const :  true_var) or
            (FALSE or FALSE ?  true_const : false_var) or
        not (FALSE or FALSE ? false_const :  true_var) or
        not ( TRUE and TRUE ?  true_const : false_const) or
            ( TRUE and TRUE ? false_const :  true_const) or
            (FALSE or FALSE ?  true_const : false_const) or
        not (FALSE or FALSE ? false_const :  true_const) or
        not ( TRUE and TRUE ?  true_const : FALSE or FALSE) or
            ( TRUE and TRUE ? false_const :  TRUE and TRUE) or
            (FALSE or FALSE ?  true_const : FALSE or FALSE) or
        not (FALSE or FALSE ? false_const :  TRUE and TRUE) or
        not ( TRUE and TRUE ?  true_const : false_var or false_var) or
            ( TRUE and TRUE ? false_const :  true_var and true_var) or
            (FALSE or FALSE ?  true_const : false_var or false_var) or
        not (FALSE or FALSE ? false_const :  true_var and true_var) or
        not ( TRUE and TRUE ?  TRUE and TRUE : FALSE) or
            ( TRUE and TRUE ? FALSE or FALSE :  TRUE) or
            (FALSE or FALSE ?  TRUE and TRUE : FALSE) or
        not (FALSE or FALSE ? FALSE or FALSE :  TRUE) or
        not ( TRUE and TRUE ?  TRUE and TRUE : false_var) or
            ( TRUE and TRUE ? FALSE or FALSE :  true_var) or
            (FALSE or FALSE ?  TRUE and TRUE : false_var) or
        not (FALSE or FALSE ? FALSE or FALSE :  true_var) or
        not ( TRUE and TRUE ?  TRUE and TRUE : false_const) or
            ( TRUE and TRUE ? FALSE or FALSE :  true_const) or
            (FALSE or FALSE ?  TRUE and TRUE : false_const) or
        not (FALSE or FALSE ? FALSE or FALSE :  true_const) or
        not ( TRUE and TRUE ?  TRUE and TRUE : FALSE or FALSE) or
            ( TRUE and TRUE ? FALSE or FALSE :  TRUE and TRUE) or
            (FALSE or FALSE ?  TRUE and TRUE : FALSE or FALSE) or
        not (FALSE or FALSE ? FALSE or FALSE :  TRUE and TRUE) or
        not ( TRUE and TRUE ?  TRUE and TRUE : false_var or false_var) or
            ( TRUE and TRUE ? FALSE or FALSE :  true_var and true_var) or
            (FALSE or FALSE ?  TRUE and TRUE : false_var or false_var) or
        not (FALSE or FALSE ? FALSE or FALSE :  true_var and true_var) or
        not ( TRUE and TRUE ?  true_var and true_var : FALSE) or
            ( TRUE and TRUE ? false_var or false_var :  TRUE) or
            (FALSE or FALSE ?  true_var and true_var : FALSE) or
        not (FALSE or FALSE ? false_var or false_var :  TRUE) or
        not ( TRUE and TRUE ?  true_var and true_var : false_var) or
            ( TRUE and TRUE ? false_var or false_var :  true_var) or
            (FALSE or FALSE ?  true_var and true_var : false_var) or
        not (FALSE or FALSE ? false_var or false_var :  true_var) or
        not ( TRUE and TRUE ?  true_var and true_var : false_const) or
            ( TRUE and TRUE ? false_var or false_var :  true_const) or
            (FALSE or FALSE ?  true_var and true_var : false_const) or
        not (FALSE or FALSE ? false_var or false_var :  true_const) or
        not ( TRUE and TRUE ?  true_var and true_var : FALSE or FALSE) or
            ( TRUE and TRUE ? false_var or false_var :  TRUE and TRUE) or
            (FALSE or FALSE ?  true_var and true_var : FALSE or FALSE) or
        not (FALSE or FALSE ? false_var or false_var :  TRUE and TRUE) or
        not ( TRUE and TRUE ?  true_var and true_var : false_var or false_var) or
            ( TRUE and TRUE ? false_var or false_var :  true_var and true_var) or
            (FALSE or FALSE ?  true_var and true_var : false_var or false_var) or
        not (FALSE or FALSE ? false_var or false_var :  true_var and true_var) then
      writeln(" ***** The ternary operator ? : does not work correct. (4)");
      okay := FALSE;
    end if;

    if  not ( true_var and true_var ?  TRUE : FALSE) or
            ( true_var and true_var ? FALSE :  TRUE) or
            (false_var or false_var ?  TRUE : FALSE) or
        not (false_var or false_var ? FALSE :  TRUE) or
        not ( true_var and true_var ?  TRUE : false_var) or
            ( true_var and true_var ? FALSE :  true_var) or
            (false_var or false_var ?  TRUE : false_var) or
        not (false_var or false_var ? FALSE :  true_var) or
        not ( true_var and true_var ?  TRUE : false_const) or
            ( true_var and true_var ? FALSE :  true_const) or
            (false_var or false_var ?  TRUE : false_const) or
        not (false_var or false_var ? FALSE :  true_const) or
        not ( true_var and true_var ?  TRUE : FALSE or FALSE) or
            ( true_var and true_var ? FALSE :  TRUE and TRUE) or
            (false_var or false_var ?  TRUE : FALSE or FALSE) or
        not (false_var or false_var ? FALSE :  TRUE and TRUE) or
        not ( true_var and true_var ?  TRUE : false_var or false_var) or
            ( true_var and true_var ? FALSE :  true_var and true_var) or
            (false_var or false_var ?  TRUE : false_var or false_var) or
        not (false_var or false_var ? FALSE :  true_var and true_var) or
        not ( true_var and true_var ?  true_var : FALSE) or
            ( true_var and true_var ? false_var :  TRUE) or
            (false_var or false_var ?  true_var : FALSE) or
        not (false_var or false_var ? false_var :  TRUE) or
        not ( true_var and true_var ?  true_var : false_var) or
            ( true_var and true_var ? false_var :  true_var) or
            (false_var or false_var ?  true_var : false_var) or
        not (false_var or false_var ? false_var :  true_var) or
        not ( true_var and true_var ?  true_var : false_const) or
            ( true_var and true_var ? false_var :  true_const) or
            (false_var or false_var ?  true_var : false_const) or
        not (false_var or false_var ? false_var :  true_const) or
        not ( true_var and true_var ?  true_var : FALSE or FALSE) or
            ( true_var and true_var ? false_var :  TRUE and TRUE) or
            (false_var or false_var ?  true_var : FALSE or FALSE) or
        not (false_var or false_var ? false_var :  TRUE and TRUE) or
        not ( true_var and true_var ?  true_var : false_var or false_var) or
            ( true_var and true_var ? false_var :  true_var and true_var) or
            (false_var or false_var ?  true_var : false_var or false_var) or
        not (false_var or false_var ? false_var :  true_var and true_var) or
        not ( true_var and true_var ?  true_const : FALSE) or
            ( true_var and true_var ? false_const :  TRUE) or
            (false_var or false_var ?  true_const : FALSE) or
        not (false_var or false_var ? false_const :  TRUE) or
        not ( true_var and true_var ?  true_const : false_var) or
            ( true_var and true_var ? false_const :  true_var) or
            (false_var or false_var ?  true_const : false_var) or
        not (false_var or false_var ? false_const :  true_var) or
        not ( true_var and true_var ?  true_const : false_const) or
            ( true_var and true_var ? false_const :  true_const) or
            (false_var or false_var ?  true_const : false_const) or
        not (false_var or false_var ? false_const :  true_const) or
        not ( true_var and true_var ?  true_const : FALSE or FALSE) or
            ( true_var and true_var ? false_const :  TRUE and TRUE) or
            (false_var or false_var ?  true_const : FALSE or FALSE) or
        not (false_var or false_var ? false_const :  TRUE and TRUE) or
        not ( true_var and true_var ?  true_const : false_var or false_var) or
            ( true_var and true_var ? false_const :  true_var and true_var) or
            (false_var or false_var ?  true_const : false_var or false_var) or
        not (false_var or false_var ? false_const :  true_var and true_var) or
        not ( true_var and true_var ?  TRUE and TRUE : FALSE) or
            ( true_var and true_var ? FALSE or FALSE :  TRUE) or
            (false_var or false_var ?  TRUE and TRUE : FALSE) or
        not (false_var or false_var ? FALSE or FALSE :  TRUE) or
        not ( true_var and true_var ?  TRUE and TRUE : false_var) or
            ( true_var and true_var ? FALSE or FALSE :  true_var) or
            (false_var or false_var ?  TRUE and TRUE : false_var) or
        not (false_var or false_var ? FALSE or FALSE :  true_var) or
        not ( true_var and true_var ?  TRUE and TRUE : false_const) or
            ( true_var and true_var ? FALSE or FALSE :  true_const) or
            (false_var or false_var ?  TRUE and TRUE : false_const) or
        not (false_var or false_var ? FALSE or FALSE :  true_const) or
        not ( true_var and true_var ?  TRUE and TRUE : FALSE or FALSE) or
            ( true_var and true_var ? FALSE or FALSE :  TRUE and TRUE) or
            (false_var or false_var ?  TRUE and TRUE : FALSE or FALSE) or
        not (false_var or false_var ? FALSE or FALSE :  TRUE and TRUE) or
        not ( true_var and true_var ?  TRUE and TRUE : false_var or false_var) or
            ( true_var and true_var ? FALSE or FALSE :  true_var and true_var) or
            (false_var or false_var ?  TRUE and TRUE : false_var or false_var) or
        not (false_var or false_var ? FALSE or FALSE :  true_var and true_var) or
        not ( true_var and true_var ?  true_var and true_var : FALSE) or
            ( true_var and true_var ? false_var or false_var :  TRUE) or
            (false_var or false_var ?  true_var and true_var : FALSE) or
        not (false_var or false_var ? false_var or false_var :  TRUE) or
        not ( true_var and true_var ?  true_var and true_var : false_var) or
            ( true_var and true_var ? false_var or false_var :  true_var) or
            (false_var or false_var ?  true_var and true_var : false_var) or
        not (false_var or false_var ? false_var or false_var :  true_var) or
        not ( true_var and true_var ?  true_var and true_var : false_const) or
            ( true_var and true_var ? false_var or false_var :  true_const) or
            (false_var or false_var ?  true_var and true_var : false_const) or
        not (false_var or false_var ? false_var or false_var :  true_const) or
        not ( true_var and true_var ?  true_var and true_var : FALSE or FALSE) or
            ( true_var and true_var ? false_var or false_var :  TRUE and TRUE) or
            (false_var or false_var ?  true_var and true_var : FALSE or FALSE) or
        not (false_var or false_var ? false_var or false_var :  TRUE and TRUE) or
        not ( true_var and true_var ?  true_var and true_var : false_var or false_var) or
            ( true_var and true_var ? false_var or false_var :  true_var and true_var) or
            (false_var or false_var ?  true_var and true_var : false_var or false_var) or
        not (false_var or false_var ? false_var or false_var :  true_var and true_var) then
      writeln(" ***** The ternary operator ? : does not work correct. (5)");
      okay := FALSE;
    end if;

    if okay then
      writeln("The ternary operator ? : works correct for boolean.");
    else
      writeln(" ***** The ternary operator ? : does not work correct.");
    end if;
  end func;


const proc: main is func

  begin
    writeln;
    check_not();
    check_and();
    check_or();
    check_relations;
    check_compare;
    check_ord();
    check_str();
    check_ternary();
  end func;
