Loading @CVC_checker/cvc_check.m +1 −1 Changes for @CVC_checker/cvc_check.m: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ function [ check, seqs ] = cvc_check( object ) waitbar(.10,box,'Running Proof'); %tic % run the cvc command [status, result] = system(['cvc3 ' filename ' +model']); [status, result] = safe_execute_external_command(['cvc3 ' filename ' +model']); %toc % check return status for errors if (status ~= 0) Loading @PVS_checker/pvs_check.m +1 −1 Changes for @PVS_checker/pvs_check.m: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ elseif (exists == 0 || strcmp(button,'Attempt to prove')) % call pvs in batch mode with script % ADD check that pvs actually exists in system % [status, result] = system(['pvs -batch -v 3 -l ' function_name '.el']); [status, result] = safe_execute_external_command(['pvs -batch -v 3 -l ' function_name '.el']); %toc %objectect.msgbox_scroll(result); waitbar(.70,box,'Parsing Results'); Loading safe_execute_external_command.m +36 Changes for safe_execute_external_command.m: 36 added lines, 0 removed lines. Original line number Diff line number Diff line function [ status, results ] = safe_execute_external_command( cmd ) %SAFE_EXECUTE_EXTERNAL_COMMAND Executes a command avoiding various Matlab pitfalls % Exectues the given command using the system function, while avoid % various pitfalls that occur while running the matlab context. % Specifically, it removes matlab related paths from the LB_LIBRARY_PATH. % It restores them on exit. old_path = getenv('LD_LIBRARY_PATH'); new_path = old_path; new_path = regexp(new_path, ':', 'split'); new_new_path = ''; for i=1:size(new_path, 2) finds = strfind(new_path(i), 'matlab'); if size(finds{1}) == [0 0] new_new_path = [new_new_path new_path{i} ':']; %#ok<AGROW> Since size is dynamically found end end setenv('LD_LIBRARY_PATH', new_new_path(1:size(new_new_path,2)-1)) had_error = 0; try [ status, results ] = system( cmd ); catch exception had_error = 1; end setenv('LD_LIBRARY_PATH', old_path); if had_error == 1 throw(exception) end end Loading
@CVC_checker/cvc_check.m +1 −1 Changes for @CVC_checker/cvc_check.m: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ function [ check, seqs ] = cvc_check( object ) waitbar(.10,box,'Running Proof'); %tic % run the cvc command [status, result] = system(['cvc3 ' filename ' +model']); [status, result] = safe_execute_external_command(['cvc3 ' filename ' +model']); %toc % check return status for errors if (status ~= 0) Loading
@PVS_checker/pvs_check.m +1 −1 Changes for @PVS_checker/pvs_check.m: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ elseif (exists == 0 || strcmp(button,'Attempt to prove')) % call pvs in batch mode with script % ADD check that pvs actually exists in system % [status, result] = system(['pvs -batch -v 3 -l ' function_name '.el']); [status, result] = safe_execute_external_command(['pvs -batch -v 3 -l ' function_name '.el']); %toc %objectect.msgbox_scroll(result); waitbar(.70,box,'Parsing Results'); Loading
safe_execute_external_command.m +36 Changes for safe_execute_external_command.m: 36 added lines, 0 removed lines. Original line number Diff line number Diff line function [ status, results ] = safe_execute_external_command( cmd ) %SAFE_EXECUTE_EXTERNAL_COMMAND Executes a command avoiding various Matlab pitfalls % Exectues the given command using the system function, while avoid % various pitfalls that occur while running the matlab context. % Specifically, it removes matlab related paths from the LB_LIBRARY_PATH. % It restores them on exit. old_path = getenv('LD_LIBRARY_PATH'); new_path = old_path; new_path = regexp(new_path, ':', 'split'); new_new_path = ''; for i=1:size(new_path, 2) finds = strfind(new_path(i), 'matlab'); if size(finds{1}) == [0 0] new_new_path = [new_new_path new_path{i} ':']; %#ok<AGROW> Since size is dynamically found end end setenv('LD_LIBRARY_PATH', new_new_path(1:size(new_new_path,2)-1)) had_error = 0; try [ status, results ] = system( cmd ); catch exception had_error = 1; end setenv('LD_LIBRARY_PATH', old_path); if had_error == 1 throw(exception) end end