[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[creduce-dev] multifile reduction



If anyone is interested, here's what the current C-Reduce produces for the transitive includes for C++ hello world on OS X, under the criterion that the files compile and the resulting executable prints hello and exits successfully.

Remaining opportunities include:

- resolution of #define

- cross-file resolution of typedefs

- substitution #includes

- elimination of random C++ stuff

John



'/Users/regehr/svn/code/reduce/AvailabilityInternal.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/algorithm.best' reduced to:
#include "memory"

          '/Users/regehr/svn/code/reduce/memory.best' reduced to:
#include "iterator"

          '/Users/regehr/svn/code/reduce/string.best' reduced to:
#include "algorithm"
_LIBCPP_BEGIN_NAMESPACE_STD template <class _CharT> struct char_traits {
  typedef _CharT char_type;
  static bool eq(char_type __c1, char_type __c2) { return __c1 == __c2; }
  static size_t length(const char_type *);
};
template <class _CharT>
size_t char_traits<_CharT>::length(const char_type *__s) {
  size_t __len = 0;
  for (; !eq(*__s, 0); ++__s)
    ++__len;
  return __len;
}
_LIBCPP_END_NAMESPACE_STD
          '/Users/regehr/svn/code/reduce/locale.best' reduced to:
_LIBCPP_BEGIN_NAMESPACE_STD template <class _CharT, class _OutputIterator>
_OutputIterator __pad_and_output(_OutputIterator __s, const _CharT *__ob,
const _CharT *, const _CharT *__oe, ios_base &,
                                 _CharT) {
  for (; __ob < __oe; ++__ob)
    __s = *__ob;
}
_LIBCPP_END_NAMESPACE_STD
          '/Users/regehr/svn/code/reduce/type_traits.best' reduced to:

          '/Users/regehr/svn/code/reduce/functional.best' reduced to:

          '/Users/regehr/svn/code/reduce/__functional_03.best' reduced to:

          '/Users/regehr/svn/code/reduce/iterator.best' reduced to:
#include "__functional_base"
_LIBCPP_BEGIN_NAMESPACE_STD template <class _CharT, class _Traits>
class ostreambuf_iterator {
  typedef basic_streambuf<_CharT, _Traits> streambuf_type;
  typedef basic_ostream<_CharT> ostream_type;
  streambuf_type *__sbuf_;
public:
  ostreambuf_iterator(ostream_type &__s) : __sbuf_(__s.rdbuf()) {}
  ostreambuf_iterator operator=(_CharT __c) { __sbuf_->sputc(__c); }
};
_LIBCPP_END_NAMESPACE_STD
          '/Users/regehr/svn/code/reduce/__bit_reference.best' reduced to:

          '/Users/regehr/svn/code/reduce/istream.best' reduced to:

          '/Users/regehr/svn/code/reduce/__locale.best' reduced to:
#include "string"

          '/Users/regehr/svn/code/reduce/tuple.best' reduced to:

          '/Users/regehr/svn/code/reduce/limits.best' reduced to:

          '/Users/regehr/svn/code/reduce/chrono.best' reduced to:

          '/Users/regehr/svn/code/reduce/bitset.best' reduced to:

          '/Users/regehr/svn/code/reduce/ostream.best' reduced to:
#include "locale"
_LIBCPP_BEGIN_NAMESPACE_STD template <class _CharT, class _Traits>
class basic_ostream : virtual public basic_ios<_CharT, _Traits> {};
template <class _CharT, class _Traits>
_Traits __put_character_sequence(basic_ostream<_CharT, _Traits> &__os,
                                 const _CharT *__str, size_t __len) {
  typedef ostreambuf_iterator<_CharT, _Traits> _Ip;
__pad_and_output(_Ip(__os), __str, __str, __str + __len, __os, __os.fill());
}
template <class _CharT, class _Traits>
_Traits operator<<(basic_ostream<_CharT, _Traits> &__os, const _CharT *__str) {
  __put_character_sequence(__os, __str, _Traits::length(__str));
}
_LIBCPP_END_NAMESPACE_STD
'/Users/regehr/svn/code/reduce/__functional_base_03.best' reduced to:

          '/Users/regehr/svn/code/reduce/unistd.h_1.best' reduced to:

          '/Users/regehr/svn/code/reduce/cdefs.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/ios.best' reduced to:
#include "iosfwd"
#include "__locale"
_LIBCPP_BEGIN_NAMESPACE_STD typedef ptrdiff_t streamsize;
class ios_base {
public:
  typedef int fmtflags;
  fmtflags left;
  typedef int iostate;
  virtual ~ios_base();
  void *rdbuf() const { return __rdbuf_; }
  streamsize __precision_;
  streamsize __width_;
  iostate __rdstate_;
  void *__rdbuf_;
};
template <class _CharT, class _Traits> class basic_ios : public ios_base {
public:
  typedef _CharT char_type;
  typedef _Traits traits_type;
  basic_streambuf<char_type, traits_type> *rdbuf() const;
  char_type fill() const;
};
template <class _CharT, class _Traits>
basic_streambuf<_CharT, _Traits> *basic_ios<_CharT, _Traits>::rdbuf() const {
  return static_cast<basic_streambuf<char_type, traits_type> *>(
      ios_base::rdbuf());
}
template <class _CharT, class _Traits>
_CharT basic_ios<_CharT, _Traits>::fill() const {}
_LIBCPP_END_NAMESPACE_STD
          '/Users/regehr/svn/code/reduce/_structs.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/utility.best' reduced to:

          '/Users/regehr/svn/code/reduce/stdint.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/system_error.best' reduced to:

          '/Users/regehr/svn/code/reduce/__config.best' reduced to:
#define _LIBCPP_ABI_VERSION 1
#define _LIBCPP_CONCAT1(_LIBCPP_X, _LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y
#define _LIBCPP_CONCAT(_LIBCPP_X, _LIBCPP_Y) \
  _LIBCPP_CONCAT1(_LIBCPP_X, _LIBCPP_Y)
#define _LIBCPP_NAMESPACE _LIBCPP_CONCAT(__, _LIBCPP_ABI_VERSION)
#define _LIBCPP_BEGIN_NAMESPACE_STD \ namespace std { \
  namespace _LIBCPP_NAMESPACE {
#define _LIBCPP_END_NAMESPACE_STD \ } \
  }
namespace std {
namespace _LIBCPP_NAMESPACE {}
using namespace _LIBCPP_NAMESPACE;
}

          '/Users/regehr/svn/code/reduce/pthread.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/stdio.h.best' reduced to:

'/Users/regehr/svn/code/reduce/__functional_base.best' reduced to:
#include "typeinfo"

          '/Users/regehr/svn/code/reduce/streambuf.best' reduced to:
_LIBCPP_BEGIN_NAMESPACE_STD template <class _CharT, class _Traits>
class basic_streambuf {
public:
  typedef _CharT char_type;
  typedef _Traits int_type;
  int_type sputc(char_type);
};
_LIBCPP_END_NAMESPACE_STD
          '/Users/regehr/svn/code/reduce/signal.h_2.best' reduced to:

          '/Users/regehr/svn/code/reduce/ratio.best' reduced to:

          '/Users/regehr/svn/code/reduce/mutex.best' reduced to:

          '/Users/regehr/svn/code/reduce/resource.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/stdlib.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/Availability.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/__tuple.best' reduced to:

          '/Users/regehr/svn/code/reduce/__mutex_base.best' reduced to:

          '/Users/regehr/svn/code/reduce/errno.h_1.best' reduced to:

          '/Users/regehr/svn/code/reduce/wchar.h.best' reduced to:
#include "_types.h"
#include "_size_t.h"

          '/Users/regehr/svn/code/reduce/ctype.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/wait.h.best' reduced to:

'/Users/regehr/svn/code/reduce/_symbol_aliasing.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/qos.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/types.h_2.best' reduced to:

          '/Users/regehr/svn/code/reduce/unistd.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/cwchar.best' reduced to:

          '/Users/regehr/svn/code/reduce/iosfwd.best' reduced to:
#include "wchar.h"
_LIBCPP_BEGIN_NAMESPACE_STD template <class> struct char_traits;
template <class, class> class basic_streambuf;
template <class _CharT, class = char_traits<_CharT>> class basic_ostream;
typedef basic_ostream<char> ostream;
_LIBCPP_END_NAMESPACE_STD
          '/Users/regehr/svn/code/reduce/qos.h_1.best' reduced to:

          '/Users/regehr/svn/code/reduce/exception.best' reduced to:
#include "cstddef"

          '/Users/regehr/svn/code/reduce/string.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_endian.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/cwctype.best' reduced to:

          '/Users/regehr/svn/code/reduce/__debug.best' reduced to:

          '/Users/regehr/svn/code/reduce/time.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/limits.h_2.best' reduced to:

          '/Users/regehr/svn/code/reduce/_wchar.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/select.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/stdint.h_1.best' reduced to:

          '/Users/regehr/svn/code/reduce/cstdio.best' reduced to:

          '/Users/regehr/svn/code/reduce/cstdlib.best' reduced to:

          '/Users/regehr/svn/code/reduce/_ctype.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/syslimits.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/new.best' reduced to:

          '/Users/regehr/svn/code/reduce/cerrno.best' reduced to:

          '/Users/regehr/svn/code/reduce/cctype.best' reduced to:

          '/Users/regehr/svn/code/reduce/types.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/typeinfo.best' reduced to:
#include "exception"

          '/Users/regehr/svn/code/reduce/limits.h_1.best' reduced to:

          '/Users/regehr/svn/code/reduce/stdexcept.best' reduced to:

          '/Users/regehr/svn/code/reduce/stddef.h.best' reduced to:
typedef __PTRDIFF_TYPE__ ptrdiff_t;

          '/Users/regehr/svn/code/reduce/_types.h_1.best' reduced to:
typedef __SIZE_TYPE__ __darwin_size_t;

          '/Users/regehr/svn/code/reduce/endian.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/runetype.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_OSByteOrder.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_wctype.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/strings.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_pthread_types.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_types.h_3.best' reduced to:
#include "_types.h_2"

          '/Users/regehr/svn/code/reduce/limits.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/wctype.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/xlocale.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/nl_types.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_mcontext.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/__wctype.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/cstring.best' reduced to:

          '/Users/regehr/svn/code/reduce/_stdio.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_fd_def.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/initializer_list.best' reduced to:

          '/Users/regehr/svn/code/reduce/cstdint.best' reduced to:

'/Users/regehr/svn/code/reduce/_posix_availability.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/cstddef.best' reduced to:
#include "stddef.h"

          '/Users/regehr/svn/code/reduce/_locale.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_OSByteOrder.h_1.best' reduced to:

          '/Users/regehr/svn/code/reduce/_stdlib.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_wctype.h_1.best' reduced to:

          '/Users/regehr/svn/code/reduce/locale.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_select.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/iostream.best' reduced to:
#include "__config"
#include "ios"
#include "streambuf"
#include "ostream"
_LIBCPP_BEGIN_NAMESPACE_STD extern ostream cout;
_LIBCPP_END_NAMESPACE_STD
          '/Users/regehr/svn/code/reduce/_types.h.best' reduced to:
#include "_types.h_3"

          '/Users/regehr/svn/code/reduce/_ucontext.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/stdarg.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/appleapiopts.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_mach_port_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/gethostuuid.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_sigaltstack.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/pthread_impl.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/stdio.h_1.best' reduced to:

          '/Users/regehr/svn/code/reduce/endian.h_1.best' reduced to:

          '/Users/regehr/svn/code/reduce/types.h_1.best' reduced to:

          '/Users/regehr/svn/code/reduce/_uintmax_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/signal.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_intmax_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_seek_set.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_types.h_2.best' reduced to:
#include "_types.h_1"

          '/Users/regehr/svn/code/reduce/signal.h_1.best' reduced to:

          '/Users/regehr/svn/code/reduce/_timeval.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_wchar_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_timespec.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/ctime.best' reduced to:

'/Users/regehr/svn/code/reduce/_pthread_rwlockattr_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_mcontext.h_1.best' reduced to:

'/Users/regehr/svn/code/reduce/_pthread_mutexattr_t.h.best' reduced to:

'/Users/regehr/svn/code/reduce/_pthread_condattr_t.h.best' reduced to:

'/Users/regehr/svn/code/reduce/_pthread_rwlock_t.h.best' reduced to:

'/Users/regehr/svn/code/reduce/_pthread_mutex_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_in_addr_t.h.best' reduced to:

'/Users/regehr/svn/code/reduce/_pthread_attr_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/sched.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_ino64_t.h.best' reduced to:

'/Users/regehr/svn/code/reduce/_pthread_cond_t.h.best' reduced to:

'/Users/regehr/svn/code/reduce/_pthread_once_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/alloca.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_pthread_key_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_id_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_key_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_nlink_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_suseconds_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_blksize_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_dev_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_blkcnt_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_fsblkcnt_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_fsfilcnt_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_useconds_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_ino_t.h.best' reduced to:

'/Users/regehr/svn/code/reduce/_posix_vdisable.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_ssize_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_pthread_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_sigset_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_wctrans_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_clock_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_errno_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_rsize_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_ct_rune_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_mbstate_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_size_t.h.best' reduced to:
typedef __darwin_size_t size_t;

          '/Users/regehr/svn/code/reduce/_uintptr_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_intptr_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_in_port_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_uint64_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_wctype_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_va_list.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_pid_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_uid_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_time_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_mode_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_uint16_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_nl_item.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_uint32_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_fd_isset.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_uuid_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_off_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_uint8_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_rune_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_fd_copy.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_fd_setsize.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_wint_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_int64_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_int8_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_fd_clr.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_fd_set.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_fd_zero.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_int16_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_int32_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_gid_t.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_time.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_string.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_null.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/_xlocale.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/climits.best' reduced to:

          '/Users/regehr/svn/code/reduce/_limits.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/errno.h.best' reduced to:

          '/Users/regehr/svn/code/reduce/__undef_min_max.best' reduced to:

          '/Users/regehr/svn/code/reduce/__tuple_03.best' reduced to:

          '/Users/regehr/svn/code/reduce/limits.h_3.best' reduced to:

          '/Users/regehr/svn/code/reduce/hello.cpp.best' reduced to:
#include "iostream"
int main() { std::cout << "Hello World"; }

elapsed time: 8851 seconds