From 0f39127393f050d21c4c2f6fbc7dbb469d591b78 Mon Sep 17 00:00:00 2001
From: Michael Leuschel <leuschel@uni-duesseldorf.de>
Date: Fri, 11 Jun 2021 14:47:12 +0200
Subject: [PATCH] improve LTL assertion failure message

problem was not functor but length of values
---
 .../de/prob/core/domainobjects/ltl/CounterExample.java | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/de.prob.core/src/de/prob/core/domainobjects/ltl/CounterExample.java b/de.prob.core/src/de/prob/core/domainobjects/ltl/CounterExample.java
index 43dffabb..165afd98 100644
--- a/de.prob.core/src/de/prob/core/domainobjects/ltl/CounterExample.java
+++ b/de.prob.core/src/de/prob/core/domainobjects/ltl/CounterExample.java
@@ -145,11 +145,15 @@ public class CounterExample {
 				int atomicId = atomic.getValue().intValue();
 
 				final String name = atomicFormulaNames[atomicId];
+				
+				int atomicIdSize = predicateValues.get(atomicId).size();
 
-				Logger.assertProB("CounterExample functor invalid: "+functor,
-						values.length == predicateValues.get(atomicId).size());
+				Logger.assertProB("CounterExampleProposition invalid, expected values.length = " +
+				                  values.length + ", got term with: " + atomicIdSize +
+				                   " values; Prolog term = " + term.toString(),
+						values.length == atomicIdSize);
 
-				for (int i = 0; i < predicateValues.get(atomicId).size(); i++) {
+				for (int i = 0; i < atomicIdSize; i++) {
 					values[i] = predicateValues.get(atomicId).get(i) ? CounterExampleValueType.TRUE
 							: CounterExampleValueType.FALSE;
 				}
-- 
GitLab