diff --git a/@CVC_checker/matlab_to_cvc_syntax_translation.m b/@CVC_checker/matlab_to_cvc_syntax_translation.m index 341c96200e49fab36d795cc36ae38bd2dcfa547c..38dde35c889cae5966ca8d7b79c937c59a4959bc 100644 --- a/@CVC_checker/matlab_to_cvc_syntax_translation.m +++ b/@CVC_checker/matlab_to_cvc_syntax_translation.m @@ -12,6 +12,13 @@ % Author: Colin Eles elesc@mcmaster.ca % Organization: McMaster Centre for Software Certification function cvc_string = matlab_to_cvc_syntax_translation(matlab_string) + +s = [matlab_string(1,:)]; +for j = 2:size(matlab_string,1) + s = [s ' ' matlab_string(j,:)]; +end +matlab_string = s; + cvc_string = regexprep(matlab_string,'&&',' AND '); cvc_string = regexprep(cvc_string,'~(?!=)',' NOT '); cvc_string = regexprep(cvc_string,'~=',' /= '); diff --git a/@GUI/check_grid_condition.m b/@GUI/check_grid_condition.m index fa211fbb807febb380b7ddcc4077ec9fac34710d..8b0fb7ca1f316b122bcc6e4ffe5585069aa91c4a 100644 --- a/@GUI/check_grid_condition.m +++ b/@GUI/check_grid_condition.m @@ -16,6 +16,12 @@ for i = 1:size(grid.cells,2) error = ''; string = get(grid.cells(i).cond,'String'); + + s = [string(1,:)]; + for j = 2:size(string,1) + s = [s ' ' string(j,:)]; + end + string = s; if ( strcmp(string,'') || isempty(string)) && i == 1 && isempty(grid.parent_grid) && size(grid.cells,2) == 1 break; diff --git a/@GUI/check_matlab_syntax_condition.m b/@GUI/check_matlab_syntax_condition.m index dc602838cf2b9e1c50cd712620092030acbfe4e9..78f40a200d5831c8e138794e40c7ed73d6b85397 100644 --- a/@GUI/check_matlab_syntax_condition.m +++ b/@GUI/check_matlab_syntax_condition.m @@ -28,6 +28,7 @@ for i=1:size(parsed_input,2) end + if ~result % the string is a condition we need to evaulate it as it % will be used in the code, as in order for an if statement diff --git a/@GUI/evaluate_counter_grid.m b/@GUI/evaluate_counter_grid.m index b8930df30357bbb8f80474671350a23e6e52065b..c73c2ce5be7caf02630715595882de5c8ab48c85 100644 --- a/@GUI/evaluate_counter_grid.m +++ b/@GUI/evaluate_counter_grid.m @@ -40,6 +40,13 @@ end check_string = [check_string counter sprintf('\n')]; for i=1:size(grid.cells,2) condition_string = get(grid.cells(i).cond,'string'); + + s = [condition_string(1,:)]; + for j = 2:size(condition_string,1) + s = [s ' ' condition_string(j,:)]; + end + condition_string = s; + if(~isempty(condition_string)) eval([check_string 'result =(' char(condition_string) ');'])