From a8cabca8551818222dcb1f4713d8896e3525ad1a Mon Sep 17 00:00:00 2001
From: Franck Dary <franck.dary@lis-lab.fr>
Date: Sat, 7 Dec 2019 12:31:26 +0100
Subject: [PATCH] Removed test for tape size in simplebufferwrite because it
 prevented the model from predicting splitword actions

---
 transition_machine/src/ActionBank.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/transition_machine/src/ActionBank.cpp b/transition_machine/src/ActionBank.cpp
index 81cf71e..4f56170 100644
--- a/transition_machine/src/ActionBank.cpp
+++ b/transition_machine/src/ActionBank.cpp
@@ -1273,10 +1273,10 @@ bool ActionBank::simpleBufferWriteAppliable(Config & config,
 
   int index = config.getHead() + relativeIndex;
 
-  if (!checkEmptyness)
-    return !(index < 0) && index < tape.size();
+  if (!checkEmptyness || index >= tape.size())
+    return !(index < 0);
 
-  return !(index < 0) && index < tape.size() && tape.getHyp(relativeIndex).empty();
+  return !(index < 0) && tape.getHyp(relativeIndex).empty();
 }
 
 bool ActionBank::isRuleAppliable(Config & config,
-- 
GitLab