<commit_before>#include <iostream>

template <int N>
struct Int {
	static const int value = N;
};

struct Nil {
	typedef Nil Head;
	typedef Nil Tail;
	static const int value = 0; // HACK
};

template <typename H, typename T>
struct List {
	typedef H Head;
	typedef T Tail;
};

template <typename L, int N>
struct Get {
	typedef typename L::Tail Tail;
	typedef typename Get<Tail, N-1>::result result;
};

template <typename L>
struct Get<L, 0> {
	typedef typename L::Head result;
};

template <class A, class B, class C>
struct StateOut {
	static const int result = 1;
};

template <class B>
struct StateOut<Nil, B, Int<0> > {
	static const int result = 0;
};

template <class B>
struct StateOut<Nil, B, Int<1> > {
	static const int result = 1;
};

template <class A, class B>
struct StateOut<A, B, A> {
	static const int result = 0;
};

template <class L, class P>
struct Step {
	typedef typename L::Head CHead;
	typedef typename L::Tail CTail;

	typedef typename Step<CTail, CHead>::result Next;
	typedef List<Int<StateOut<Int<CTail::Head::value>, Int<CHead::value>, Int<P::value> >::result >, Next> result;
};

template <class P>
struct Step<Nil, P> {
	typedef Nil result;
};

int main() {
	typedef List<Int<0>,
		List<Int<0>,
		List<Int<0>,
		List<Int<0>,
		List<Int<0>,
		List<Int<1>,
		List<Int<0>,
		List<Int<0>,
		List<Int<0>,
		List<Int<0>,
		List<Int<0>,
		Nil>>>>>>>>>>> testlist;

	typedef Step<testlist, Int<0> >::result next;
	std::cout << Get<next, 0 >::result::value;
	std::cout << Get<next, 1 >::result::value;
	std::cout << Get<next, 2 >::result::value;
	std::cout << Get<next, 3 >::result::value;
	std::cout << Get<next, 4 >::result::value;
	std::cout << Get<next, 5 >::result::value;
	std::cout << Get<next, 6 >::result::value;
	std::cout << Get<next, 7 >::result::value;
	std::cout << Get<next, 8 >::result::value;
	std::cout << Get<next, 9 >::result::value;
	std::cout << Get<next, 10 >::result::value << std::endl;<commit_msg>Change Int type to Val type in meta_automata<commit_after>#include <iostream>

template <bool N>
struct Val {
	static const bool value = N;
};

struct Nil {
	typedef Nil Head;
	typedef Nil Tail;
	static const int value = 0; // HACK
};

template <typename H, typename T>
struct List {
	typedef H Head;
	typedef T Tail;
};

template <typename L, int N>
struct Get {
	typedef typename L::Tail Tail;
	typedef typename Get<Tail, N-1>::result result;
};

template <typename L>
struct Get<L, 0> {
	typedef typename L::Head result;
};

template <class A, class B, class C>
struct StateOut {
	static const int result = 1;
};

template <class B>
struct StateOut<Nil, B, Val<false> > {
	static const int result = 0;
};

template <class B>
struct StateOut<Nil, B, Val<true> > {
	static const int result = 1;
};

template <class A, class B>
struct StateOut<A, B, A> {
	static const int result = 0;
};

template <class L, class P>
struct Step {
	typedef typename L::Head CHead;
	typedef typename L::Tail CTail;

	typedef typename Step<CTail, CHead>::result Next;
	typedef List<Val<StateOut<Val<CTail::Head::value>, Val<CHead::value>, Val<P::value> >::result >, Next> result;
};

template <class P>
struct Step<Nil, P> {
	typedef Nil result;
};

int main() {
	typedef List<Val<0>,
		List<Val<0>,
		List<Val<0>,
		List<Val<0>,
		List<Val<0>,
		List<Val<1>,
		List<Val<0>,
		List<Val<0>,
		List<Val<0>,
		List<Val<0>,
		List<Val<0>,
		Nil>>>>>>>>>>> testlist;

	typedef Step<testlist, Val<0> >::result next;
	std::cout << Get<next, 0 >::result::value;
	std::cout << Get<next, 1 >::result::value;
	std::cout << Get<next, 2 >::result::value;
	std::cout << Get<next, 3 >::result::value;
	std::cout << Get<next, 4 >::result::value;
	std::cout << Get<next, 5 >::result::value;
	std::cout << Get<next, 6 >::result::value;
	std::cout << Get<next, 7 >::result::value;
	std::cout << Get<next, 8 >::result::value;
	std::cout << Get<next, 9 >::result::value;
	std::cout << Get<next, 10 >::result::value << std::endl;
{'fraction_non_alphanumeric': 0.18292682926829268, 'fraction_numerical': 0.016260162601626018, 'mean_word_length': 4.841246290801187, 'pattern_counts': {'":': 0, '<': 173, '<?xml version=': 0, '>': 125, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2094165', 'n_tokens_mistral': 1603, 'n_tokens_neox': 1431, 'n_words': 444}