diff options
Diffstat (limited to 'example/turing/src')
-rw-r--r-- | example/turing/src/state.h | 4 | ||||
-rw-r--r-- | example/turing/src/tape.h | 16 |
2 files changed, 13 insertions, 7 deletions
diff --git a/example/turing/src/state.h b/example/turing/src/state.h index 51fe347..fa3306b 100644 --- a/example/turing/src/state.h +++ b/example/turing/src/state.h @@ -42,8 +42,8 @@ template < struct state_predicate { template <typename State> using function = tav::And< - tav::IsEqualValue<Id, tav::Nth<field::ID, State>>, - tav::IsEqualValue<Read, tav::Nth<field::READ, State>> + tav::IsEqual<Id, tav::Nth<field::ID, State>>, + tav::IsEqual<Read, tav::Nth<field::READ, State>> >; }; diff --git a/example/turing/src/tape.h b/example/turing/src/tape.h index 39814d8..4f79bd9 100644 --- a/example/turing/src/tape.h +++ b/example/turing/src/tape.h @@ -10,6 +10,12 @@ namespace machine { namespace tape { +struct BLANK { + typedef BLANK type; + + static constexpr char value{'\0'}; +}; + // (define (readSymbol position tape) // (if (= (length tape) position) // '() @@ -18,11 +24,11 @@ template < typename Position, typename Tape > -using readSymbol = tav::If< - tav::IsEqualValue<tav::Length<Tape>, Position>, - void, - tav::Nth<Position, Tape> ->; +using readSymbol = tav::Eval<tav::If< + tav::LowerThan<Position, tav::Length<Tape>>, + tav::utility::defer_eval<tav::Nth, Position, Tape>, + BLANK +>>; // (define (writeSymbol position symbol tape) // (if (= (length tape) position) |