# 1 "error.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "error.c"
# 14 "error.c"
static char vcid[] = "$Id: error.c,v 1.3 1995/07/11 01:53:03 duchier Exp $";


# 1 "extern.h" 1
# 9 "extern.h"
# 1 "/usr/include/stdio.h" 1 3 4
# 29 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/_ansi.h" 1 3 4
# 15 "/usr/include/_ansi.h" 3 4
# 1 "/usr/include/newlib.h" 1 3 4
# 16 "/usr/include/_ansi.h" 2 3 4
# 1 "/usr/include/sys/config.h" 1 3 4



# 1 "/usr/include/machine/ieeefp.h" 1 3 4
# 5 "/usr/include/sys/config.h" 2 3 4
# 151 "/usr/include/sys/config.h" 3 4
# 1 "/usr/include/cygwin/config.h" 1 3 4
# 152 "/usr/include/sys/config.h" 2 3 4
# 17 "/usr/include/_ansi.h" 2 3 4
# 30 "/usr/include/stdio.h" 2 3 4




# 1 "/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/include/stddef.h" 1 3 4
# 220 "/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/include/stddef.h" 3 4
typedef unsigned int size_t;
# 35 "/usr/include/stdio.h" 2 3 4


# 1 "/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/include/stdarg.h" 1 3 4
# 44 "/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 38 "/usr/include/stdio.h" 2 3 4







# 1 "/usr/include/sys/reent.h" 1 3 4
# 14 "/usr/include/sys/reent.h" 3 4
# 1 "/usr/include/sys/_types.h" 1 3 4
# 12 "/usr/include/sys/_types.h" 3 4
typedef long _off_t;
__extension__ typedef long long _off64_t;


typedef int _ssize_t;





# 1 "/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/include/stddef.h" 1 3 4
# 361 "/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/include/stddef.h" 3 4
typedef unsigned int wint_t;
# 23 "/usr/include/sys/_types.h" 2 3 4


typedef struct
{
  int __count;
  union
  {
    wint_t __wch;
    unsigned char __wchb[4];
  } __value;
} _mbstate_t;

typedef int _flock_t;
# 15 "/usr/include/sys/reent.h" 2 3 4




typedef unsigned long __ULong;
# 40 "/usr/include/sys/reent.h" 3 4
struct _Bigint
{
  struct _Bigint *_next;
  int _k, _maxwds, _sign, _wds;
  __ULong _x[1];
};


struct __tm
{
  int __tm_sec;
  int __tm_min;
  int __tm_hour;
  int __tm_mday;
  int __tm_mon;
  int __tm_year;
  int __tm_wday;
  int __tm_yday;
  int __tm_isdst;
};







struct _on_exit_args {
        void * _fnargs[32];
        __ULong _fntypes;

};
# 80 "/usr/include/sys/reent.h" 3 4
struct _atexit {
        struct _atexit *_next;
        int _ind;
        void (*_fns[32])(void);
        struct _on_exit_args _on_exit_args;
};
# 95 "/usr/include/sys/reent.h" 3 4
struct __sbuf {
        unsigned char *_base;
        int _size;
};






typedef long _fpos_t;



typedef _off64_t _fpos64_t;
# 160 "/usr/include/sys/reent.h" 3 4
struct __sFILE {
  unsigned char *_p;
  int _r;
  int _w;
  short _flags;
  short _file;
  struct __sbuf _bf;
  int _lbfsize;






  void * _cookie;

  _ssize_t __attribute__((__cdecl__)) (*_read) (void * _cookie, char *_buf, int _n);
  _ssize_t __attribute__((__cdecl__)) (*_write) (void * _cookie, const char *_buf, int _n);

  _fpos_t __attribute__((__cdecl__)) (*_seek) (void * _cookie, _fpos_t _offset, int _whence);
  int __attribute__((__cdecl__)) (*_close) (void * _cookie);


  struct __sbuf _ub;
  unsigned char *_up;
  int _ur;


  unsigned char _ubuf[3];
  unsigned char _nbuf[1];


  struct __sbuf _lb;


  int _blksize;
  int _offset;


  struct _reent *_data;



  _flock_t _lock;

};


struct __sFILE64 {
  unsigned char *_p;
  int _r;
  int _w;
  short _flags;
  short _file;
  struct __sbuf _bf;
  int _lbfsize;

  struct _reent *_data;


  void * _cookie;

  _ssize_t __attribute__((__cdecl__)) (*_read) (void * _cookie, char *_buf, int _n);
  _ssize_t __attribute__((__cdecl__)) (*_write) (void * _cookie, const char *_buf, int _n);

  _fpos_t __attribute__((__cdecl__)) (*_seek) (void * _cookie, _fpos_t _offset, int _whence);
  int __attribute__((__cdecl__)) (*_close) (void * _cookie);


  struct __sbuf _ub;
  unsigned char *_up;
  int _ur;


  unsigned char _ubuf[3];
  unsigned char _nbuf[1];


  struct __sbuf _lb;


  int _blksize;
  int _flags2;

  _off64_t _offset;
  _fpos64_t __attribute__((__cdecl__)) (*_seek64) (void * _cookie, _fpos64_t _offset, int _whence);


  _flock_t _lock;

};
typedef struct __sFILE64 __FILE;




struct _glue
{
  struct _glue *_next;
  int _niobs;
  __FILE *_iobs;
};
# 284 "/usr/include/sys/reent.h" 3 4
struct _rand48 {
  unsigned short _seed[3];
  unsigned short _mult[3];
  unsigned short _add;




};
# 533 "/usr/include/sys/reent.h" 3 4
struct _reent
{
  int _errno;




  __FILE *_stdin, *_stdout, *_stderr;

  int _inc;
  char _emergency[25];

  int _current_category;
  const char *_current_locale;

  int __sdidinit;

  void __attribute__((__cdecl__)) (*__cleanup) (struct _reent *);


  struct _Bigint *_result;
  int _result_k;
  struct _Bigint *_p5s;
  struct _Bigint **_freelist;


  int _cvtlen;
  char *_cvtbuf;

  union
    {
      struct
        {
          unsigned int _unused_rand;
          char * _strtok_last;
          char _asctime_buf[26];
          struct __tm _localtime_buf;
          int _gamma_signgam;
          __extension__ unsigned long long _rand_next;
          struct _rand48 _r48;
          _mbstate_t _mblen_state;
          _mbstate_t _mbtowc_state;
          _mbstate_t _wctomb_state;
          char _l64a_buf[8];
          char _signal_buf[24];
          int _getdate_err;
          _mbstate_t _mbrlen_state;
          _mbstate_t _mbrtowc_state;
          _mbstate_t _mbsrtowcs_state;
          _mbstate_t _wcrtomb_state;
          _mbstate_t _wcsrtombs_state;
        } _reent;



      struct
        {

          unsigned char * _nextf[30];
          unsigned int _nmalloc[30];
        } _unused;
    } _new;


  struct _atexit *_atexit;
  struct _atexit _atexit0;


  void (**(_sig_func))(int);




  struct _glue __sglue;
  __FILE __sf[3];
};
# 730 "/usr/include/sys/reent.h" 3 4
extern struct _reent *_impure_ptr ;

void _reclaim_reent (struct _reent *);






  struct _reent * __attribute__((__cdecl__)) __getreent (void);
# 46 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/sys/types.h" 1 3 4
# 24 "/usr/include/sys/types.h" 3 4
typedef short int __int16_t;
typedef unsigned short int __uint16_t;





typedef int __int32_t;
typedef unsigned int __uint32_t;



typedef long int __int64_t;
typedef unsigned long int __uint64_t;
# 55 "/usr/include/sys/types.h" 3 4
# 1 "/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/include/stddef.h" 1 3 4
# 158 "/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/include/stddef.h" 3 4
typedef int ptrdiff_t;
# 332 "/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/include/stddef.h" 3 4
typedef short unsigned int wchar_t;
# 56 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/machine/types.h" 1 3 4
# 36 "/usr/include/machine/types.h" 3 4
typedef long int __off_t;
typedef int __pid_t;



typedef long int __loff_t;
# 57 "/usr/include/sys/types.h" 2 3 4
# 78 "/usr/include/sys/types.h" 3 4
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;



typedef unsigned short ushort;
typedef unsigned int uint;



typedef unsigned long clock_t;




typedef long time_t;




struct timespec {
  time_t tv_sec;
  long tv_nsec;
};

struct itimerspec {
  struct timespec it_interval;
  struct timespec it_value;
};


typedef long daddr_t;
typedef char * caddr_t;
# 166 "/usr/include/sys/types.h" 3 4
typedef int pid_t;



typedef _ssize_t ssize_t;
# 189 "/usr/include/sys/types.h" 3 4
typedef unsigned short nlink_t;
# 211 "/usr/include/sys/types.h" 3 4
typedef long fd_mask;







typedef struct _types_fd_set {
        fd_mask fds_bits[(((64)+(((sizeof (fd_mask) * 8))-1))/((sizeof (fd_mask) * 8)))];
} _types_fd_set;
# 247 "/usr/include/sys/types.h" 3 4
typedef unsigned long clockid_t;




typedef unsigned long timer_t;




typedef long useconds_t;


# 1 "/usr/include/sys/features.h" 1 3 4
# 261 "/usr/include/sys/types.h" 2 3 4
# 365 "/usr/include/sys/types.h" 3 4
# 1 "/usr/include/cygwin/types.h" 1 3 4
# 20 "/usr/include/cygwin/types.h" 3 4
# 1 "/usr/include/sys/sysmacros.h" 1 3 4
# 21 "/usr/include/cygwin/types.h" 2 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 18 "/usr/include/stdint.h" 3 4
typedef signed char int8_t;
typedef short int16_t;
typedef long int32_t;
typedef long long int64_t;


typedef unsigned char uint8_t;
typedef unsigned short uint16_t;


typedef unsigned long uint32_t;

typedef unsigned long long uint64_t;



typedef signed char int_least8_t;
typedef short int_least16_t;
typedef long int_least32_t;
typedef long long int_least64_t;

typedef unsigned char uint_least8_t;
typedef unsigned short uint_least16_t;
typedef unsigned long uint_least32_t;
typedef unsigned long long uint_least64_t;



typedef signed char int_fast8_t;
typedef long int_fast16_t;
typedef long int_fast32_t;
typedef long long int_fast64_t;

typedef unsigned char uint_fast8_t;
typedef unsigned long uint_fast16_t;
typedef unsigned long uint_fast32_t;
typedef unsigned long long uint_fast64_t;





typedef long intptr_t;

typedef unsigned long uintptr_t;



typedef long long intmax_t;
typedef unsigned long long uintmax_t;
# 22 "/usr/include/cygwin/types.h" 2 3 4



typedef struct timespec timespec_t;




typedef struct timespec timestruc_t;





typedef _off64_t off_t;







typedef short __dev16_t;
typedef unsigned long __dev32_t;

typedef __dev32_t dev_t;







typedef long blksize_t;




typedef long __blkcnt32_t;
typedef long long __blkcnt64_t;

typedef __blkcnt64_t blkcnt_t;







typedef unsigned short __uid16_t;
typedef unsigned long __uid32_t;

typedef __uid32_t uid_t;







typedef unsigned short __gid16_t;
typedef unsigned long __gid32_t;

typedef __gid32_t gid_t;







typedef unsigned long __ino32_t;
typedef unsigned long long __ino64_t;

typedef __ino64_t ino_t;







typedef long long key_t;







typedef unsigned long vm_offset_t;




typedef unsigned long vm_size_t;




typedef unsigned char u_int8_t;



typedef __uint16_t u_int16_t;



typedef __uint32_t u_int32_t;



typedef __uint64_t u_int64_t;




typedef __int32_t register_t;




typedef char *addr_t;




typedef unsigned mode_t;





typedef struct __pthread_t {char __dummy;} *pthread_t;
typedef struct __pthread_mutex_t {char __dummy;} *pthread_mutex_t;

typedef struct __pthread_key_t {char __dummy;} *pthread_key_t;
typedef struct __pthread_attr_t {char __dummy;} *pthread_attr_t;
typedef struct __pthread_mutexattr_t {char __dummy;} *pthread_mutexattr_t;
typedef struct __pthread_condattr_t {char __dummy;} *pthread_condattr_t;
typedef struct __pthread_cond_t {char __dummy;} *pthread_cond_t;


typedef struct
{
  pthread_mutex_t mutex;
  int state;
}
pthread_once_t;
typedef struct __pthread_rwlock_t {char __dummy;} *pthread_rwlock_t;
typedef struct __pthread_rwlockattr_t {char __dummy;} *pthread_rwlockattr_t;
# 366 "/usr/include/sys/types.h" 2 3 4
# 47 "/usr/include/stdio.h" 2 3 4



typedef __FILE FILE;



typedef _fpos64_t fpos_t;
# 65 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/sys/stdio.h" 1 3 4
# 66 "/usr/include/stdio.h" 2 3 4
# 170 "/usr/include/stdio.h" 3 4
FILE * __attribute__((__cdecl__)) tmpfile (void);
char * __attribute__((__cdecl__)) tmpnam (char *);
int __attribute__((__cdecl__)) fclose (FILE *);
int __attribute__((__cdecl__)) fflush (FILE *);
FILE * __attribute__((__cdecl__)) freopen (const char *, const char *, FILE *);
void __attribute__((__cdecl__)) setbuf (FILE *, char *);
int __attribute__((__cdecl__)) setvbuf (FILE *, char *, int, size_t);
int __attribute__((__cdecl__)) fprintf (FILE *, const char *, ...);
int __attribute__((__cdecl__)) fscanf (FILE *, const char *, ...);
int __attribute__((__cdecl__)) printf (const char *, ...);
int __attribute__((__cdecl__)) scanf (const char *, ...);
int __attribute__((__cdecl__)) sscanf (const char *, const char *, ...);
int __attribute__((__cdecl__)) vfprintf (FILE *, const char *, char*);
int __attribute__((__cdecl__)) vprintf (const char *, char*);
int __attribute__((__cdecl__)) vsprintf (char *, const char *, char*);
int __attribute__((__cdecl__)) fgetc (FILE *);
char * __attribute__((__cdecl__)) fgets (char *, int, FILE *);
int __attribute__((__cdecl__)) fputc (int, FILE *);
int __attribute__((__cdecl__)) fputs (const char *, FILE *);
int __attribute__((__cdecl__)) getc (FILE *);
int __attribute__((__cdecl__)) getchar (void);
char * __attribute__((__cdecl__)) gets (char *);
int __attribute__((__cdecl__)) putc (int, FILE *);
int __attribute__((__cdecl__)) putchar (int);
int __attribute__((__cdecl__)) puts (const char *);
int __attribute__((__cdecl__)) ungetc (int, FILE *);
size_t __attribute__((__cdecl__)) fread (void *, size_t _size, size_t _n, FILE *);
size_t __attribute__((__cdecl__)) fwrite (const void * , size_t _size, size_t _n, FILE *);



int __attribute__((__cdecl__)) fgetpos (FILE *, fpos_t *);

int __attribute__((__cdecl__)) fseek (FILE *, long, int);



int __attribute__((__cdecl__)) fsetpos (FILE *, const fpos_t *);

long __attribute__((__cdecl__)) ftell ( FILE *);
void __attribute__((__cdecl__)) rewind (FILE *);
void __attribute__((__cdecl__)) clearerr (FILE *);
int __attribute__((__cdecl__)) feof (FILE *);
int __attribute__((__cdecl__)) ferror (FILE *);
void __attribute__((__cdecl__)) perror (const char *);

FILE * __attribute__((__cdecl__)) fopen (const char *_name, const char *_type);
int __attribute__((__cdecl__)) sprintf (char *, const char *, ...);
int __attribute__((__cdecl__)) remove (const char *);
int __attribute__((__cdecl__)) rename (const char *, const char *);


int __attribute__((__cdecl__)) asprintf (char **, const char *, ...);




int __attribute__((__cdecl__)) fseeko (FILE *, off_t, int);
off_t __attribute__((__cdecl__)) ftello ( FILE *);

int __attribute__((__cdecl__)) vfiprintf (FILE *, const char *, char*);
int __attribute__((__cdecl__)) iprintf (const char *, ...);
int __attribute__((__cdecl__)) fiprintf (FILE *, const char *, ...);
int __attribute__((__cdecl__)) siprintf (char *, const char *, ...);
char * __attribute__((__cdecl__)) tempnam (const char *, const char *);
int __attribute__((__cdecl__)) vasprintf (char **, const char *, char*);
int __attribute__((__cdecl__)) vsnprintf (char *, size_t, const char *, char*);
int __attribute__((__cdecl__)) vfscanf (FILE *, const char *, char*);
int __attribute__((__cdecl__)) vscanf (const char *, char*);
int __attribute__((__cdecl__)) vsscanf (const char *, const char *, char*);

int __attribute__((__cdecl__)) fcloseall (void);
int __attribute__((__cdecl__)) snprintf (char *, size_t, const char *, ...);
# 252 "/usr/include/stdio.h" 3 4
FILE * __attribute__((__cdecl__)) fdopen (int, const char *);

int __attribute__((__cdecl__)) fileno (FILE *);
int __attribute__((__cdecl__)) getw (FILE *);
int __attribute__((__cdecl__)) pclose (FILE *);
FILE * __attribute__((__cdecl__)) popen (const char *, const char *);
int __attribute__((__cdecl__)) putw (int, FILE *);
void __attribute__((__cdecl__)) setbuffer (FILE *, char *, int);
int __attribute__((__cdecl__)) setlinebuf (FILE *);
int __attribute__((__cdecl__)) getc_unlocked (FILE *);
int __attribute__((__cdecl__)) getchar_unlocked (void);
void __attribute__((__cdecl__)) flockfile (FILE *);
int __attribute__((__cdecl__)) ftrylockfile (FILE *);
void __attribute__((__cdecl__)) funlockfile (FILE *);
int __attribute__((__cdecl__)) putc_unlocked (int, FILE *);
int __attribute__((__cdecl__)) putchar_unlocked (int);






int __attribute__((__cdecl__)) _asprintf_r (struct _reent *, char **, const char *, ...);
int __attribute__((__cdecl__)) _fcloseall_r (struct _reent *);
FILE * __attribute__((__cdecl__)) _fdopen_r (struct _reent *, int, const char *);
FILE * __attribute__((__cdecl__)) _fopen_r (struct _reent *, const char *, const char *);
int __attribute__((__cdecl__)) _fscanf_r (struct _reent *, FILE *, const char *, ...);
int __attribute__((__cdecl__)) _getchar_r (struct _reent *);
char * __attribute__((__cdecl__)) _gets_r (struct _reent *, char *);
int __attribute__((__cdecl__)) _iprintf_r (struct _reent *, const char *, ...);
int __attribute__((__cdecl__)) _mkstemp_r (struct _reent *, char *);
char * __attribute__((__cdecl__)) _mktemp_r (struct _reent *, char *);
void __attribute__((__cdecl__)) _perror_r (struct _reent *, const char *);
int __attribute__((__cdecl__)) _printf_r (struct _reent *, const char *, ...);
int __attribute__((__cdecl__)) _putchar_r (struct _reent *, int);
int __attribute__((__cdecl__)) _puts_r (struct _reent *, const char *);
int __attribute__((__cdecl__)) _remove_r (struct _reent *, const char *);
int __attribute__((__cdecl__)) _rename_r (struct _reent *, const char *_old, const char *_new);

int __attribute__((__cdecl__)) _scanf_r (struct _reent *, const char *, ...);
int __attribute__((__cdecl__)) _sprintf_r (struct _reent *, char *, const char *, ...);
int __attribute__((__cdecl__)) _snprintf_r (struct _reent *, char *, size_t, const char *, ...);
int __attribute__((__cdecl__)) _sscanf_r (struct _reent *, const char *, const char *, ...);
char * __attribute__((__cdecl__)) _tempnam_r (struct _reent *, const char *, const char *);
FILE * __attribute__((__cdecl__)) _tmpfile_r (struct _reent *);
char * __attribute__((__cdecl__)) _tmpnam_r (struct _reent *, char *);
int __attribute__((__cdecl__)) _vasprintf_r (struct _reent *, char **, const char *, char*);
int __attribute__((__cdecl__)) _vfprintf_r (struct _reent *, FILE *, const char *, char*);
int __attribute__((__cdecl__)) _vprintf_r (struct _reent *, const char *, char*);
int __attribute__((__cdecl__)) _vsprintf_r (struct _reent *, char *, const char *, char*);
int __attribute__((__cdecl__)) _vsnprintf_r (struct _reent *, char *, size_t, const char *, char*);
int __attribute__((__cdecl__)) _vfscanf_r (struct _reent *, FILE *, const char *, char*);
int __attribute__((__cdecl__)) _vscanf_r (struct _reent *, const char *, char*);
int __attribute__((__cdecl__)) _vsscanf_r (struct _reent *, const char *, const char *, char*);

ssize_t __attribute__((__cdecl__)) __getdelim (char **, size_t *, int, FILE *);
ssize_t __attribute__((__cdecl__)) __getline (char **, size_t *, FILE *);
# 334 "/usr/include/stdio.h" 3 4
int __attribute__((__cdecl__)) __srget (FILE *);
int __attribute__((__cdecl__)) __swbuf (int, FILE *);






FILE *__attribute__((__cdecl__)) funopen (const void * _cookie, int (*readfn)(void * _cookie, char *_buf, int _n), int (*writefn)(void * _cookie, const char *_buf, int _n), fpos_t (*seekfn)(void * _cookie, fpos_t _off, int _whence), int (*closefn)(void * _cookie));
# 359 "/usr/include/stdio.h" 3 4
static __inline__ int __sgetc(FILE *__p)
  {
    int __c = (--(__p)->_r < 0 ? __srget(__p) : (int)(*(__p)->_p++));
    if ((__p->_flags & 0x4000) && (__c == '\r'))
      {
      int __c2 = (--(__p)->_r < 0 ? __srget(__p) : (int)(*(__p)->_p++));
      if (__c2 == '\n')
        __c = __c2;
      else
        ungetc(__c2, __p);
      }
    return __c;
  }
# 441 "/usr/include/stdio.h" 3 4

# 10 "extern.h" 2
# 1 "/usr/include/string.h" 1 3 4
# 14 "/usr/include/string.h" 3 4
# 1 "/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/include/stddef.h" 1 3 4
# 15 "/usr/include/string.h" 2 3 4







void * __attribute__((__cdecl__)) memchr (const void *, int, size_t);
int __attribute__((__cdecl__)) memcmp (const void *, const void *, size_t);
void * __attribute__((__cdecl__)) memcpy (void *, const void *, size_t);
void * __attribute__((__cdecl__)) memmove (void *, const void *, size_t);
void * __attribute__((__cdecl__)) memset (void *, int, size_t);
char *__attribute__((__cdecl__)) strcat (char *, const char *);
char *__attribute__((__cdecl__)) strchr (const char *, int);
int __attribute__((__cdecl__)) strcmp (const char *, const char *);
int __attribute__((__cdecl__)) strcoll (const char *, const char *);
char *__attribute__((__cdecl__)) strcpy (char *, const char *);
size_t __attribute__((__cdecl__)) strcspn (const char *, const char *);
char *__attribute__((__cdecl__)) strerror (int);
size_t __attribute__((__cdecl__)) strlen (const char *);
char *__attribute__((__cdecl__)) strncat (char *, const char *, size_t);
int __attribute__((__cdecl__)) strncmp (const char *, const char *, size_t);
char *__attribute__((__cdecl__)) strncpy (char *, const char *, size_t);
char *__attribute__((__cdecl__)) strpbrk (const char *, const char *);
char *__attribute__((__cdecl__)) strrchr (const char *, int);
size_t __attribute__((__cdecl__)) strspn (const char *, const char *);
char *__attribute__((__cdecl__)) strstr (const char *, const char *);


char *__attribute__((__cdecl__)) strtok (char *, const char *);


size_t __attribute__((__cdecl__)) strxfrm (char *, const char *, size_t);


char *__attribute__((__cdecl__)) strtok_r (char *, const char *, char **);

int __attribute__((__cdecl__)) bcmp (const void *, const void *, size_t);
void __attribute__((__cdecl__)) bcopy (const void *, void *, size_t);
void __attribute__((__cdecl__)) bzero (void *, size_t);
int __attribute__((__cdecl__)) ffs (int);
char *__attribute__((__cdecl__)) index (const char *, int);
void * __attribute__((__cdecl__)) memccpy (void *, const void *, int, size_t);
void * __attribute__((__cdecl__)) mempcpy (void *, const void *, size_t);
char *__attribute__((__cdecl__)) rindex (const char *, int);
int __attribute__((__cdecl__)) strcasecmp (const char *, const char *);
char *__attribute__((__cdecl__)) strdup (const char *);
char *__attribute__((__cdecl__)) _strdup_r (struct _reent *, const char *);
char *__attribute__((__cdecl__)) strndup (const char *, size_t);
char *__attribute__((__cdecl__)) _strndup_r (struct _reent *, const char *, size_t);
char *__attribute__((__cdecl__)) strerror_r (int, char *, size_t);
size_t __attribute__((__cdecl__)) strlcat (char *, const char *, size_t);
size_t __attribute__((__cdecl__)) strlcpy (char *, const char *, size_t);
int __attribute__((__cdecl__)) strncasecmp (const char *, const char *, size_t);
size_t __attribute__((__cdecl__)) strnlen (const char *, size_t);
char *__attribute__((__cdecl__)) strsep (char **, const char *);
char *__attribute__((__cdecl__)) strlwr (char *);
char *__attribute__((__cdecl__)) strupr (char *);


const char *__attribute__((__cdecl__)) strsignal (int __signo);

int __attribute__((__cdecl__)) strtosigno (const char *__name);
# 98 "/usr/include/string.h" 3 4

# 11 "extern.h" 2
# 1 "/usr/include/math.h" 1 3 4






# 1 "/usr/include/machine/ieeefp.h" 1 3 4
# 8 "/usr/include/math.h" 2 3 4









union __dmath
{
  __ULong i[2];
  double d;
};




extern __attribute__((dllimport)) const union __dmath __infinity[];
# 35 "/usr/include/math.h" 3 4
extern double atan (double);
extern double cos (double);
extern double sin (double);
extern double tan (double);
extern double tanh (double);
extern double frexp (double, int *);
extern double modf (double, double *);
extern double ceil (double);
extern double fabs (double);
extern double floor (double);






extern double acos (double);
extern double asin (double);
extern double atan2 (double, double);
extern double cosh (double);
extern double sinh (double);
extern double exp (double);
extern double ldexp (double, int);
extern double log (double);
extern double log10 (double);
extern double pow (double, double);
extern double sqrt (double);
extern double fmod (double, double);
# 72 "/usr/include/math.h" 3 4
typedef float float_t;
typedef double double_t;
# 82 "/usr/include/math.h" 3 4
extern int __fpclassifyf (float x);
extern int __fpclassifyd (double x);
extern int __signbitf (float x);
extern int __signbitd (double x);
# 123 "/usr/include/math.h" 3 4
extern double infinity (void);
extern double nan (const char *);
extern int isnan (double);
extern int isinf (double);
extern int finite (double);
extern double copysign (double, double);
extern int ilogb (double);

extern double asinh (double);
extern double cbrt (double);
extern double nextafter (double, double);
extern double rint (double);
extern double scalbn (double, int);

extern double exp2 (double);
extern double scalbln (double, long int);
extern double tgamma (double);
extern double nearbyint (double);
extern long int lrint (double);
extern double round (double);
extern long int lround (double);
extern double trunc (double);
extern double remquo (double, double, int *);
extern double copysign (double, double);
extern double fdim (double, double);
extern double fmax (double, double);
extern double fmin (double, double);
extern double fma (double, double, double);
extern void sincos (double, double *, double *);


extern double log1p (double);
extern double expm1 (double);



extern double acosh (double);
extern double atanh (double);
extern double remainder (double, double);
extern double gamma (double);
extern double gamma_r (double, int *);
extern double lgamma (double);
extern double lgamma_r (double, int *);
extern double erf (double);
extern double erfc (double);
extern double y0 (double);
extern double y1 (double);
extern double yn (int, double);
extern double j0 (double);
extern double j1 (double);
extern double jn (int, double);



extern double hypot (double, double);


extern double cabs();
extern double drem (double, double);
# 191 "/usr/include/math.h" 3 4
extern float atanf (float);
extern float cosf (float);
extern float sinf (float);
extern float tanf (float);
extern float tanhf (float);
extern float frexpf (float, int *);
extern float modff (float, float *);
extern float ceilf (float);
extern float fabsf (float);
extern float floorf (float);


extern float acosf (float);
extern float asinf (float);
extern float atan2f (float, float);
extern float coshf (float);
extern float sinhf (float);
extern float expf (float);
extern float ldexpf (float, int);
extern float logf (float);
extern float log10f (float);
extern float powf (float, float);
extern float sqrtf (float);
extern float fmodf (float, float);
# 223 "/usr/include/math.h" 3 4
extern float exp2f (float);
extern float scalblnf (float, long int);
extern float tgammaf (float);
extern float nearbyintf (float);
extern long int lrintf (float);
extern float roundf (float);
extern long int lroundf (float);
extern float truncf (float);
extern float remquof (float, float, int *);
extern float copysignf (float, float);
extern float fdimf (float, float);
extern float fmaxf (float, float);
extern float fminf (float, float);
extern float fmaf (float, float, float);

extern float infinityf (void);
extern float nanf (const char *);
extern int isnanf (float);
extern int isinff (float);
extern int finitef (float);
extern float copysignf (float, float);
extern int ilogbf (float);

extern float asinhf (float);
extern float cbrtf (float);
extern float nextafterf (float, float);
extern float rintf (float);
extern float scalbnf (float, int);
extern float log1pf (float);
extern float expm1f (float);
extern void sincosf (float, float *, float *);


extern float acoshf (float);
extern float atanhf (float);
extern float remainderf (float, float);
extern float gammaf (float);
extern float gammaf_r (float, int *);
extern float lgammaf (float);
extern float lgammaf_r (float, int *);
extern float erff (float);
extern float erfcf (float);
extern float y0f (float);
extern float y1f (float);
extern float ynf (int, float);
extern float j0f (float);
extern float j1f (float);
extern float jnf (int, float);

extern float hypotf (float, float);

extern float cabsf();
extern float dremf (float, float);






extern int *__signgam (void);
# 292 "/usr/include/math.h" 3 4
struct exception

{
  int type;
  char *name;
  double arg1;
  double arg2;
  double retval;
  int err;
};




extern int matherr (struct exception *e);
# 347 "/usr/include/math.h" 3 4
enum __fdlibm_version
{
  __fdlibm_ieee = -1,
  __fdlibm_svid,
  __fdlibm_xopen,
  __fdlibm_posix
};




extern __attribute__((dllimport)) const enum __fdlibm_version __fdlib_version;
# 367 "/usr/include/math.h" 3 4

# 12 "extern.h" 2

# 1 "/usr/include/sys/stat.h" 1 3 4
# 9 "/usr/include/sys/stat.h" 3 4
# 1 "/usr/include/time.h" 1 3 4
# 18 "/usr/include/time.h" 3 4
# 1 "/usr/include/machine/time.h" 1 3 4
# 19 "/usr/include/time.h" 2 3 4
# 27 "/usr/include/time.h" 3 4
# 1 "/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/include/stddef.h" 1 3 4
# 28 "/usr/include/time.h" 2 3 4





struct tm
{
  int tm_sec;
  int tm_min;
  int tm_hour;
  int tm_mday;
  int tm_mon;
  int tm_year;
  int tm_wday;
  int tm_yday;
  int tm_isdst;
};

clock_t __attribute__((__cdecl__)) clock (void);
double __attribute__((__cdecl__)) difftime (time_t _time2, time_t _time1);
time_t __attribute__((__cdecl__)) mktime (struct tm *_timeptr);
time_t __attribute__((__cdecl__)) time (time_t *_timer);

char *__attribute__((__cdecl__)) asctime (const struct tm *_tblock);
char *__attribute__((__cdecl__)) ctime (const time_t *_time);
struct tm *__attribute__((__cdecl__)) gmtime (const time_t *_timer);
struct tm *__attribute__((__cdecl__)) localtime (const time_t *_timer);

size_t __attribute__((__cdecl__)) strftime (char *_s, size_t _maxsize, const char *_fmt, const struct tm *_t);

char *__attribute__((__cdecl__)) asctime_r (const struct tm *, char *);
char *__attribute__((__cdecl__)) ctime_r (const time_t *, char *);
struct tm *__attribute__((__cdecl__)) gmtime_r (const time_t *, struct tm *);
struct tm *__attribute__((__cdecl__)) localtime_r (const time_t *, struct tm *);








char *__attribute__((__cdecl__)) strptime (const char *, const char *, struct tm *);
void __attribute__((__cdecl__)) tzset (void);
void __attribute__((__cdecl__)) _tzset_r (struct _reent *);
# 98 "/usr/include/time.h" 3 4
extern __attribute__((dllimport)) time_t _timezone;
extern __attribute__((dllimport)) int _daylight;
extern __attribute__((dllimport)) char *_tzname[2];
# 117 "/usr/include/time.h" 3 4
char *__attribute__((__cdecl__)) timezone (void);
# 171 "/usr/include/time.h" 3 4
int __attribute__((__cdecl__)) nanosleep (const struct timespec *rqtp, struct timespec *rmtp);
# 10 "/usr/include/sys/stat.h" 2 3 4
# 26 "/usr/include/sys/stat.h" 3 4
# 1 "/usr/include/cygwin/stat.h" 1 3 4
# 62 "/usr/include/cygwin/stat.h" 3 4
struct stat
{
  dev_t st_dev;
  ino_t st_ino;
  mode_t st_mode;
  nlink_t st_nlink;
  uid_t st_uid;
  gid_t st_gid;
  dev_t st_rdev;
  off_t st_size;
  timestruc_t st_atim;
  timestruc_t st_mtim;
  timestruc_t st_ctim;
  blksize_t st_blksize;
  blkcnt_t st_blocks;
  long st_spare4[2];
};
# 27 "/usr/include/sys/stat.h" 2 3 4
# 125 "/usr/include/sys/stat.h" 3 4
int __attribute__((__cdecl__)) chmod ( const char *__path, mode_t __mode );
int __attribute__((__cdecl__)) fchmod (int __fd, mode_t __mode);
int __attribute__((__cdecl__)) fstat ( int __fd, struct stat *__sbuf );
int __attribute__((__cdecl__)) mkdir ( const char *_path, mode_t __mode );
int __attribute__((__cdecl__)) mkfifo ( const char *__path, mode_t __mode );
int __attribute__((__cdecl__)) stat ( const char *__path, struct stat *__sbuf );
mode_t __attribute__((__cdecl__)) umask ( mode_t __mask );


int __attribute__((__cdecl__)) lstat ( const char *__path, struct stat *__buf );
int __attribute__((__cdecl__)) mknod ( const char *__path, mode_t __mode, dev_t __dev );





int __attribute__((__cdecl__)) _fstat ( int __fd, struct stat *__sbuf );
int __attribute__((__cdecl__)) _stat ( const char *__path, struct stat *__sbuf );
# 14 "extern.h" 2
# 1 "/usr/include/sys/time.h" 1 3 4
# 16 "/usr/include/sys/time.h" 3 4
struct timeval {
  long tv_sec;
  long tv_usec;
};

struct timezone {
  int tz_minuteswest;
  int tz_dsttime;
};


# 1 "/usr/include/sys/select.h" 1 3 4
# 17 "/usr/include/sys/select.h" 3 4
# 1 "/usr/include/sys/cdefs.h" 1 3 4
# 18 "/usr/include/sys/select.h" 2 3 4





# 1 "/usr/include/sys/time.h" 1 3 4
# 24 "/usr/include/sys/select.h" 2 3 4




int select (int __n, _types_fd_set *__readfds, _types_fd_set *__writefds, _types_fd_set *__exceptfds, struct timeval *__timeout);



# 28 "/usr/include/sys/time.h" 2 3 4
# 36 "/usr/include/sys/time.h" 3 4
struct itimerval {
  struct timeval it_interval;
  struct timeval it_value;
};
# 73 "/usr/include/sys/time.h" 3 4
int __attribute__((__cdecl__)) gettimeofday (struct timeval *__p, struct timezone *__z);
int __attribute__((__cdecl__)) settimeofday (const struct timeval *, const struct timezone *);
int __attribute__((__cdecl__)) utimes (const char *__path, struct timeval *__tvp);
int __attribute__((__cdecl__)) getitimer (int __which, struct itimerval *__value);
int __attribute__((__cdecl__)) setitimer (int __which, const struct itimerval *__value, struct itimerval *__ovalue);
# 15 "extern.h" 2
# 1 "/usr/include/sys/times.h" 1 3 4
# 16 "/usr/include/sys/times.h" 3 4
struct tms {
        clock_t tms_utime;
        clock_t tms_stime;
        clock_t tms_cutime;
        clock_t tms_cstime;
};

clock_t __attribute__((__cdecl__)) times (struct tms *);
# 16 "extern.h" 2
# 1 "/usr/include/assert.h" 1 3 4
# 25 "/usr/include/assert.h" 3 4
void __attribute__((__cdecl__)) __assert (const char *, int, const char *);
# 17 "extern.h" 2
# 1 "/usr/include/errno.h" 1 3 4




typedef int error_t;



# 1 "/usr/include/sys/errno.h" 1 3 4
# 15 "/usr/include/sys/errno.h" 3 4
extern int *__errno (void);




extern __attribute__((dllimport)) const char * const _sys_errlist[];
extern __attribute__((dllimport)) int _sys_nerr;

extern __attribute__((dllimport)) const char * const sys_errlist[];
extern __attribute__((dllimport)) int sys_nerr;
# 10 "/usr/include/errno.h" 2 3 4
# 18 "extern.h" 2
# 1 "/usr/include/setjmp.h" 1 3 4
# 10 "/usr/include/setjmp.h" 3 4
# 1 "/usr/include/machine/setjmp.h" 1 3 4


# 197 "/usr/include/machine/setjmp.h" 3 4
typedef int jmp_buf[(13 * 4)];





# 1 "/usr/include/signal.h" 1 3 4




# 1 "/usr/include/sys/signal.h" 1 3 4
# 19 "/usr/include/sys/signal.h" 3 4
typedef unsigned long sigset_t;
# 109 "/usr/include/sys/signal.h" 3 4
typedef void (*_sig_func_ptr)(int);

struct sigaction
{
        _sig_func_ptr sa_handler;
        sigset_t sa_mask;
        int sa_flags;
};
# 139 "/usr/include/sys/signal.h" 3 4
int __attribute__((__cdecl__)) sigprocmask (int how, const sigset_t *set, sigset_t *oset);


int __attribute__((__cdecl__)) pthread_sigmask (int how, const sigset_t *set, sigset_t *oset);
# 153 "/usr/include/sys/signal.h" 3 4
int __attribute__((__cdecl__)) kill (int, int);
int __attribute__((__cdecl__)) killpg (pid_t, int);
int __attribute__((__cdecl__)) sigaction (int, const struct sigaction *, struct sigaction *);
int __attribute__((__cdecl__)) sigaddset (sigset_t *, const int);
int __attribute__((__cdecl__)) sigdelset (sigset_t *, const int);
int __attribute__((__cdecl__)) sigismember (const sigset_t *, int);
int __attribute__((__cdecl__)) sigfillset (sigset_t *);
int __attribute__((__cdecl__)) sigemptyset (sigset_t *);
int __attribute__((__cdecl__)) sigpending (sigset_t *);
int __attribute__((__cdecl__)) sigsuspend (const sigset_t *);
int __attribute__((__cdecl__)) sigpause (int);







int __attribute__((__cdecl__)) pthread_kill (pthread_t thread, int sig);
# 6 "/usr/include/signal.h" 2 3 4



typedef int sig_atomic_t;





struct _reent;

_sig_func_ptr __attribute__((__cdecl__)) _signal_r (struct _reent *, int, _sig_func_ptr);
int __attribute__((__cdecl__)) _raise_r (struct _reent *, int);


_sig_func_ptr __attribute__((__cdecl__)) signal (int, _sig_func_ptr);
int __attribute__((__cdecl__)) raise (int);



# 204 "/usr/include/machine/setjmp.h" 2 3 4






typedef int sigjmp_buf[(13 * 4)+2];
# 11 "/usr/include/setjmp.h" 2 3 4



void __attribute__((__cdecl__)) longjmp (jmp_buf __jmpb, int __retval);
int __attribute__((__cdecl__)) setjmp (jmp_buf __jmpb);


# 19 "extern.h" 2
# 56 "extern.h"
extern int mem_size;
extern int alloc_words;
# 289 "extern.h"
typedef unsigned long * GENERIC;



typedef char string[10000];
typedef struct wl_operator_data * ptr_operator_data;
typedef struct wl_int_list * ptr_int_list;
typedef struct wl_resid_list * ptr_resid_list;
typedef struct wl_definition * ptr_definition;
typedef struct wl_residuation * ptr_residuation;
typedef struct wl_psi_term * ptr_psi_term;
typedef struct wl_node * ptr_node;
typedef struct wl_pair_list * ptr_pair_list;
typedef struct wl_triple_list * ptr_triple_list;
typedef struct wl_list * ptr_list;
typedef struct wl_stack * ptr_stack;
typedef struct wl_goal * ptr_goal;
typedef struct wl_choice_point * ptr_choice_point;





typedef enum { nop, xf, fx, yf, fy, xfx, xfy, yfx } operator;

typedef struct wl_operator_data {
  operator type;
  long precedence;
  ptr_operator_data next;
} operator_data;


typedef struct wl_int_list {
  GENERIC value;
  ptr_int_list next;
} int_list;


typedef struct wl_resid_list {
  ptr_psi_term var;
  ptr_psi_term othervar;
  ptr_resid_list next;
} resid_list;

typedef enum { undef,
                 predicate,
                 function,
                 type,
                 global



                 } def_type;




typedef struct wl_hash_table * ptr_hash_table;





struct wl_module {
  char *module_name;
  char *source_file;
  ptr_int_list open_modules;
  ptr_int_list inherited_modules;
  ptr_hash_table symbol_table;
};


typedef struct wl_module * ptr_module;

extern ptr_node module_table;
extern ptr_module current_module;


struct wl_keyword {
  ptr_module module;
  char *symbol;
  char *combined_name;
  int public;
  int private_feature;
  ptr_definition definition;
};

typedef struct wl_keyword * ptr_keyword;
# 388 "extern.h"
struct wl_hash_table {
  int size;
  int used;
  ptr_keyword *data;
};
# 403 "extern.h"
void hash_insert();
ptr_keyword hash_lookup();
ptr_hash_table hash_create();
void hash_expand();
int hash_code();
void hash_display();

extern ptr_definition first_definition;
# 420 "extern.h"
typedef struct wl_definition {
  long date;

  ptr_keyword keyword;

  ptr_pair_list rule;
  ptr_triple_list properties;

  ptr_int_list code;
  ptr_int_list parents;
  ptr_int_list children;

  def_type type;
  char always_check;
  char protected;
  char evaluate_args;
  char already_loaded;

  ptr_operator_data op_data;

  ptr_psi_term global_value;
  ptr_psi_term init_value;





  ptr_definition next;
} definition;


typedef struct wl_residuation {
  long sortflag;
  GENERIC bestsort;
  GENERIC value;
  ptr_goal goal;
  ptr_residuation next;
} residuation;


typedef struct wl_psi_term {

  unsigned long time_stamp;

  ptr_definition type;
  long status;


  long flags;
  GENERIC value;
  ptr_node attr_list;
  ptr_psi_term coref;
  ptr_residuation resid;
} psi_term;






typedef struct wl_node {
  char *key;
  ptr_node left;
  ptr_node right;
  GENERIC data;
} node;

typedef struct wl_pair_list {
  ptr_psi_term a;
  ptr_psi_term b;
  ptr_pair_list next;
} pair_list;


typedef struct wl_triple_list {
  ptr_psi_term a;
  ptr_psi_term b;
  ptr_definition c;
  ptr_triple_list next;
} triple_list;
# 516 "extern.h"
typedef long type_ptr;
# 537 "extern.h"
typedef struct wl_stack {
  type_ptr type;
  GENERIC a;
  GENERIC b;
  ptr_stack next;
} stack;

typedef enum {
  fail,
  prove,
  unify,
  unify_noeval,
  disj,
  what_next,
  eval,
  eval_cut,
  freeze_cut,
  implies_cut,
  general_cut,
  match,
  type_disj,
  clause,
  del_clause,
  retract,
  load,
  c_what_next
} goals;

typedef struct wl_goal {
  goals type;
  ptr_psi_term a;
  ptr_psi_term b;
  GENERIC c;
  ptr_goal next;
  long pending;
} goal;

typedef struct wl_choice_point {
  unsigned long time_stamp;
  ptr_stack undo_point;
  ptr_goal goal_stack;
  ptr_choice_point next;
  GENERIC stack_top;
} choice_point;
# 589 "extern.h"
extern int arg_c;
extern char **arg_v;

extern GENERIC mem_base;
extern GENERIC heap_pointer;
extern GENERIC mem_limit;
extern GENERIC stack_pointer;
extern GENERIC stack_alloc();
extern GENERIC heap_alloc();

extern float garbage_time;
extern struct tms life_start,life_end;

extern GENERIC other_base;
extern GENERIC other_limit;
extern GENERIC other_pointer;

extern ptr_psi_term error_psi_term;
extern long parser_stack_index;

extern ptr_node var_tree;
extern ptr_node printed_vars;
extern ptr_node printed_pointers;
extern ptr_node pointer_names;
extern long gen_sym_counter;

extern long warningflag;
extern long verbose;
extern long trace,noisy;
extern long types_done;
extern long interrupted;

extern FILE *input_stream;
extern long line_count;
extern string input_file_name;
extern FILE *output_stream;
extern char *prompt;
extern long page_width;


extern ptr_definition *gamma_table;
extern long type_count;
extern long types_modified;

extern long main_loop_ok;
extern ptr_goal aim;
extern ptr_goal goal_stack;
extern ptr_choice_point choice_stack;

extern ptr_stack undo_stack;

extern unsigned long global_time_stamp;


extern long assert_first;
extern long assert_ok;
extern long file_date;



extern ptr_definition abortsym;
extern ptr_definition aborthooksym;

extern ptr_definition add_module1;
extern ptr_definition add_module2;
extern ptr_definition add_module3;

extern ptr_definition and;
extern ptr_definition apply;
extern ptr_definition boolean;
extern ptr_definition boolpredsym;
extern ptr_definition built_in;
extern ptr_definition colonsym;
extern ptr_definition commasym;
extern ptr_definition comment;

extern ptr_definition constant;
extern ptr_definition cut;
extern ptr_definition disjunction;
extern ptr_definition disj_nil;
extern ptr_definition eof;
extern ptr_definition eqsym;
extern ptr_definition leftarrowsym;
extern ptr_definition false;
extern ptr_definition funcsym;
extern ptr_definition functor;
extern ptr_definition iff;
extern ptr_definition integer;
extern ptr_definition alist;
extern ptr_definition life_or;
extern ptr_definition minus_symbol;
extern ptr_definition nil;
extern ptr_definition nothing;
extern ptr_definition predsym;
extern ptr_definition quote;
extern ptr_definition quoted_string;
extern ptr_definition real;
extern ptr_definition stream;
extern ptr_definition succeed;
extern ptr_definition such_that;
extern ptr_definition top;
extern ptr_definition true;
extern ptr_definition timesym;
extern ptr_definition tracesym;
extern ptr_definition typesym;
extern ptr_definition variable;
extern ptr_definition opsym;
extern ptr_definition loadsym;
extern ptr_definition dynamicsym;
extern ptr_definition staticsym;
extern ptr_definition encodesym;
extern ptr_definition listingsym;
extern ptr_definition delay_checksym;
extern ptr_definition eval_argsym;
extern ptr_definition inputfilesym;
extern ptr_definition call_handlersym;
extern ptr_definition xf_sym;
extern ptr_definition fx_sym;
extern ptr_definition yf_sym;
extern ptr_definition fy_sym;
extern ptr_definition xfx_sym;
extern ptr_definition xfy_sym;
extern ptr_definition yfx_sym;
extern ptr_definition nullsym;
extern ptr_definition sys_bytedata;
extern ptr_definition sys_bitvector;
extern ptr_definition sys_regexp;
extern ptr_definition sys_stream;
extern ptr_definition sys_file_stream;
extern ptr_definition sys_socket_stream;


extern ptr_definition final_dot;
extern ptr_definition final_question;

extern ptr_psi_term null_psi_term;

extern char *one;
extern char *two;
extern char *three;
extern char *year_attr;
extern char *month_attr;
extern char *day_attr;
extern char *hour_attr;
extern char *minute_attr;
extern char *second_attr;
extern char *weekday_attr;


extern ptr_psi_term old_state;



extern void init_system();

extern long (* c_rule[])();

extern ptr_psi_term stack_psi_term();
extern ptr_psi_term real_stack_psi_term();
extern ptr_psi_term heap_psi_term();







# 1 "types.h" 1
# 9 "types.h"
extern long types_modified;
extern long type_count;

extern long redefine();

extern void assert_type();
extern void assert_complicated_type();
extern void print_codes();

extern void assert_protected();
extern void assert_delay_check();
extern void assert_args_not_eval();
extern void clear_already_loaded();
extern void inherit_always_check();

extern long glb();
extern long glb_code();
extern long glb_value();
extern long sub_type();
extern long overlap_type();
extern long matches();

extern ptr_int_list decode();
extern void encode_types();

extern void print_def_type();

ptr_int_list lub();
void or_codes();
ptr_int_list copyTypeCode();
# 757 "extern.h" 2
# 1 "error.h" 1
# 10 "error.h"
extern void stack_info();

extern void init_trace();
extern void reset_step();
extern void tracing();
extern void new_trace();
extern void new_step();
extern void toggle_trace();
extern void toggle_step();
extern void set_trace_to_prove();
extern long quietflag;
extern long trace;
extern long verbose;
extern long stepflag;
extern long steptrace;
extern long stepcount;



extern long warning();
extern long warningx();
extern void perr();
extern void perr_s();
extern void perr_s2();
extern void perr_i();

extern void report_error();
extern void report_warning();
extern void report_error2();
extern void report_warning2();

extern void nonnum_warning();
extern long bit_and_warning();
extern long bit_or_warning();
extern long bit_not_warning();
extern long int_div_warning();
extern long mod_warning();
extern long shift_warning();
# 58 "error.h"
extern void Errorline();
extern void Syntaxerrorline();
extern void warningline();
extern void outputline();
extern void infoline();
extern void traceline();
# 758 "extern.h" 2
# 773 "extern.h"
# 1 "/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/include/stdarg.h" 1 3 4
# 118 "/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 774 "extern.h" 2
# 18 "error.c" 2
# 1 "print.h" 1





typedef struct wl_tab_brk * ptr_tab_brk;
typedef struct wl_item * ptr_item;

typedef struct wl_tab_brk {
  long column;
  long broken;
  long printed;
} tab_brk;

typedef struct wl_item {
  char *str;
  ptr_tab_brk tab;
} item;

extern void init_print();
extern void pred_write();
extern void listing_pred_write();
extern long str_to_int();

extern long print_variables();
extern void print_resid_message();
extern void print_operator_kind();

extern void display_psi();
extern void display_psi_stdout();
extern void display_psi_stream();
extern void display_psi_stderr();

extern void print_code();

extern char *no_name;
extern char *buffer;


extern long print_depth;
extern long indent;
extern long const_quote;
extern long write_stderr;
extern long write_corefs;
extern long write_resids;
extern long write_canon;
# 19 "error.c" 2

# 1 "login.h" 1






extern void assert_clause();
extern void prove_psi_term();


extern void push_goal();
extern void fetch_def();
extern void get_one_arg();
extern void get_one_arg_addr();
extern void get_two_args();
extern void merge_unify();
extern void fetch_def_lazy();


extern void push_choice_point();
extern ptr_stack undo_stack;
extern void push_ptr_value();
extern void push_ptr_value_global();
extern void push2_ptr_value();
extern void push_window();
extern void clean_undo_window();


extern void push_psi_ptr_value();
extern unsigned long global_time_stamp;






extern void undo();
extern void undo_actions();


extern long stepflag;
extern long ignore_eff;
extern long goal_count;
extern void show_count();
extern struct tms start_time,end_time;
# 21 "error.c" 2
# 1 "lefun.h" 1





extern long match_aim();
extern long eval_aim();

extern void residuate_double();
extern void residuate();
extern void residuate2();
extern void residuate3();
extern void curry();
extern long residuateGoalOnVar();

extern long do_residuation();
extern long do_residuation_user();
extern void do_currying();

extern void release_resid();
extern void release_resid_notrail();
# 30 "lefun.h"
extern void check_func();
extern long deref_eval();
extern long deref_rec_eval();
extern long deref_args_eval();
extern void deref2_eval();
extern void deref2_rec_eval();


extern long f_check_out();
extern long i_check_out();
extern long i_eval_args();
# 50 "lefun.h"
extern ptr_goal resid_aim;
extern ptr_resid_list resid_vars;
extern ptr_goal resid_limit;
extern long curried;
extern long can_curry;


extern void save_resid();
extern void restore_resid();

typedef struct wl_resid_block *ptr_resid_block;

typedef struct wl_resid_block {
   long cc_cr;
   ptr_goal ra;


   ptr_resid_list rv;
   ptr_psi_term md;
} resid_block;
# 22 "error.c" 2
# 1 "parser.h" 1





extern long parse_ok;
extern psi_term parse();

extern ptr_psi_term stack_copy_psi_term();
extern ptr_psi_term heap_copy_psi_term();
# 23 "error.c" 2
# 1 "built_ins.h" 1





extern void init_built_in_types();

extern long check_real();
extern long get_real_value();
extern long unify_real_result();
extern void unify_bool_result();

extern void new_built_in();

extern long file_exists();
extern void exit_life();
extern long abort_life();
extern long c_abort();

extern ptr_psi_term stack_nil();
extern ptr_psi_term stack_cons();
extern ptr_psi_term stack_int();
extern ptr_psi_term stack_pair();
extern ptr_psi_term stack_string();
extern ptr_psi_term stack_bytes();

ptr_psi_term collect_symbols();
# 37 "built_ins.h"
ptr_psi_term makePsiTerm (ptr_definition x);
ptr_psi_term makePsiList (GENERIC head, ptr_psi_term (*valueFunc)(), GENERIC (*nextFunc)());




ptr_psi_term intListValue();
GENERIC intListNext();
ptr_psi_term residListGoal();
GENERIC residListNext();
GENERIC unitListNext ();
ptr_psi_term unitListValue ();
void setUnitList (GENERIC x);
# 24 "error.c" 2


long warningflag=1;
long quietflag=0;
long trace=0;
long verbose=0;
long stepflag;
long steptrace;
long stepcount;



static long depth_gs()
{
  long i=0;
  ptr_goal g=goal_stack;

  while (g) { i++; g=g->next; }
  return i;
}



static long depth_cs()
{
  long i=0;
  ptr_choice_point c=choice_stack;

  while (c) { i++; c=c->next; }
  return i;
}



static long depth_ts()
{
  ptr_stack t=undo_stack;
  long i=0;

  while (t) { i++; t=t->next; }
  return i;
}


void stack_info(outfile)
FILE *outfile;
{

  if (verbose) {
    long gn,cn,tn;
    fprintf(outfile,"*** Stack depths [");
    gn=depth_gs();
    cn=depth_cs();
    tn=depth_ts();
    fprintf(outfile,"%ld goal%s, %ld choice point%s, %ld trail entr%s",
            gn,(gn!=1?"s":""),
            cn,(cn!=1?"s":""),
            tn,(tn!=1?"ies":"y"));
    fprintf(outfile,"]\n");
  }
}





void vinfoline();

void outputline(format, va_alist)
char *format;
va_dcl
{
  va_list ___va_lp___;

  __builtin_stdarg_start((___va_lp___),format);
  vinfoline(format,output_stream, ___va_lp___);
}

void traceline(format, va_alist)
char *format;
va_dcl
{
  va_list ___va_lp___;


  __builtin_stdarg_start((___va_lp___),format);

  if ((trace == 2) && (format[0] != 'p')) return;
  tracing();

  vinfoline(format, ((__getreent())->_stdout), ___va_lp___);
}

void infoline(format, va_alist)
char *format;
va_dcl
{
  va_list ___va_lp___;

  __builtin_stdarg_start((___va_lp___),format);
  vinfoline(format, ((__getreent())->_stdout), ___va_lp___);
}

void warningline(format, va_alist)
char *format;
va_dcl
{
  va_list ___va_lp___;


  __builtin_stdarg_start((___va_lp___),format);
  if(quietflag) return;
  fprintf(((__getreent())->_stderr),"*** Warning: ");
  vinfoline(format, ((__getreent())->_stderr), ___va_lp___);
}


void Errorline(format, va_alist)
char *format;
va_dcl
{
  va_list ___va_lp___;

  __builtin_stdarg_start((___va_lp___),format);
  fprintf(((__getreent())->_stderr),"*** Error: ");
  vinfoline(format, ((__getreent())->_stderr), ___va_lp___);




}

void Syntaxerrorline(format, va_alist)
char *format;
va_dcl
{
  va_list ___va_lp___;

  __builtin_stdarg_start((___va_lp___),format);
  if(parse_ok) {
    parse_ok=0;
    fprintf(((__getreent())->_stderr),"*** Syntax error: ");
    vinfoline(format, ((__getreent())->_stderr), ___va_lp___);
  }
}

void vinfoline(format, outfile, ___va_lp___)
char *format;
FILE *outfile;
va_list ___va_lp___;
{
  char *p;
  ptr_psi_term psi;
  char buffer[5];
  ptr_int_list pil;
  operator kind;
  def_type t;

  for (p=format; *p; p++)
  {
    if (*p == '%')
    {
      switch (*++p)
      {
      case 'd':
      case 'x':
      case 's':
        buffer[0] = '%';
        buffer[1] = *p;
        buffer[2] = 0;
        vfprintf(outfile, buffer, ___va_lp___);
        __builtin_va_arg(___va_lp___, unsigned long);
        break;

      case 'C':

        pil = __builtin_va_arg(___va_lp___, ptr_int_list);
        print_code(outfile,pil);
        break;

      case 'P':
        psi = __builtin_va_arg(___va_lp___, ptr_psi_term);
        display_psi(outfile,psi);
        break;

      case 'O':
        kind = __builtin_va_arg(___va_lp___, operator);
        print_operator_kind(outfile,kind);
        break;

      case 'T':
        ((outfile==((__getreent())->_stderr)) ? (void)0 : __assert("error.c", 215, "outfile==stderr"));
        t = __builtin_va_arg(___va_lp___, def_type);
        print_def_type(t);
        break;

      case 'E':
        ((outfile==((__getreent())->_stderr)) ? (void)0 : __assert("error.c", 221, "outfile==stderr"));
        psi_term_error();
        break;

      case '%':
        putc(*p,outfile);
        break;

      default:
        fprintf(outfile,"<%c follows %% : report bug >", *p);
        break;
      }
    }
    else
      putc(*p,outfile);
  }
  __builtin_va_end(___va_lp___);
}






void init_trace()
{
  trace=0;
  stepflag=0;
  stepcount=0;
}



void reset_step()
{
  if (stepcount>0) {
    stepcount=0;
    stepflag=1;
  }
}

void tracing()
{
  long i;
  long indent;

  printf("T%04ld",goal_count);
  printf(" C%02ld",depth_cs());
  indent=depth_gs();
  if (indent>=40) printf(" G%02ld",indent);
  indent = indent % 40;
  for (i=indent; i>=0; i--) printf(" ");
  steptrace=1;
}


void new_trace(newtrace)
long newtrace;
{
  trace = newtrace;
  printf("*** Tracing is turned ");
  printf(trace?"on.":"off.");
  if (trace == 2) printf(" Only for Proves");
  printf("\n");
}

void new_step(newstep)
long newstep;
{
  stepflag = newstep;
  printf("*** Single stepping is turned ");
  printf(stepflag?"on.\n":"off.\n");
  new_trace(stepflag);
  steptrace=0;
}

void set_trace_to_prove()
{
  new_trace(2);
}

void toggle_trace()
{
  new_trace(trace?0:1);
}


void toggle_step()
{
  new_step(!stepflag);
}





void perr(str)
char *str;
{
  fprintf(((__getreent())->_stderr),str);
}

void perr_s(s1,s2)
char *s1,*s2;
{
  fprintf(((__getreent())->_stderr),s1,s2);
}

void perr_s2(s1,s2,s3)
char *s1,*s2,*s3;
{
  fprintf(((__getreent())->_stderr),s1,s2,s3);
}

void perr_i(str,i)
char *str;
long i;
{
  fprintf(((__getreent())->_stderr),str,i);
}


long warning()
{
  if (warningflag) perr("*** Warning: ");
  return warningflag;
}


long warningx()
{
  if (warningflag) perr("*** Warning");
  return warningflag;
}



void report_error_main(g,s,s2)
ptr_psi_term g;
char *s, *s2;
{
  FILE *f;

  perr_s2("*** %s: %s in '",s2,s);
  display_psi_stderr(g);
  perr("'.\n");
}
# 376 "error.c"
void report_error(g,s)
ptr_psi_term g;
char *s;
{
  report_error_main(g,s,"Error");
}
# 390 "error.c"
long reportAndAbort(g,s)
ptr_psi_term g;
char *s;
{
  report_error_main(g,s,"Error");
  return abort_life();
}







void report_warning(g,s)
ptr_psi_term g;
char *s;
{
  if (warningflag) report_error_main(g,s,"Warning");
}



void report_error2_main(g,s,s2)
ptr_psi_term g;
char *s, *s2;
{
  FILE *f;

  perr_s("*** %s: argument '",s2);
  display_psi_stderr(g);
  perr_s("' %s.\n",s);
}







void report_error2(g,s)
ptr_psi_term g;
char *s;
{
  report_error2_main(g,s,"Error");
}







void report_warning2(g,s)
ptr_psi_term g;
char *s;
{
  if (warningflag) report_error2_main(g,s,"Warning");
}





void nonnum_warning(t,arg1,arg2)
ptr_psi_term t,arg1,arg2;
{
  if (!curried &&
      ((arg1 && !overlap_type(arg1->type,real)) ||
       (arg2 && !overlap_type(arg2->type,real)))) {
    report_warning(t,"non-numeric argument(s)");
  }
}





long nonint_warning(arg, val, msg)
ptr_psi_term arg;
double val;
char *msg;
{
  long err=0;

  if (val!=floor(val)) {
    report_warning2(arg, msg);
    err=1;
  }
  return err;
}

long bit_and_warning(arg, val)
ptr_psi_term arg;
double val;
{
  return nonint_warning(arg,val,"of bitwise 'and' operation is not an integer");
}

long bit_or_warning(arg, val)
ptr_psi_term arg;
double val;
{
  return nonint_warning(arg,val,"of bitwise 'or' operation is not an integer");
}

long bit_not_warning(arg, val)
ptr_psi_term arg;
double val;
{
  return nonint_warning(arg,val,"of bitwise 'not' operation is not an integer");
}

long int_div_warning(arg, val)
ptr_psi_term arg;
double val;
{
  return nonint_warning(arg,val,"of integer division is not an integer");
}

long mod_warning(arg, val,zero)
ptr_psi_term arg;
double val;
int zero;
{
  int err;

  err=nonint_warning(arg,val,"of modulo operation is not an integer");
  if(!err && zero && val==0) {
    Errorline("division by 0 in modulo operation\n");
    err=1;
  }
  return err;
}

long shift_warning(dir, arg, val)
long dir;
ptr_psi_term arg;
double val;
{
  if (dir)
    return nonint_warning(arg,val,"of right shift operation is not an integer");
  else
    return nonint_warning(arg,val,"of left shift operation is not an integer");
}
