%% matlab_type_to_pvs_type
%   converts matlab/simulink types to pvs
% inputs: 
%   pvs_type:string - matlab type
% outputs: 
%   matlab_type:string - pvs type
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function matlab_type = matlab_type_to_pvs_type( pvs_type )
if(strcmp(pvs_type,'logical'))
    matlab_type = 'bool';
elseif (strncmp(pvs_type, 'int',3))
    matlab_type = pvs_type;
elseif (strncmp(pvs_type, 'uint', 4))
    matlab_type = pvs_type;
elseif (strcmp(pvs_type,'single') || strcmp(pvs_type,'double'))
    matlab_type = 'real';
elseif (strncmp(pvs_type,'Inherit',7))
    matlab_type = 'real';
elseif (strncmp(pvs_type,'fixdt',5))
    params = regexp(pvs_type,'(?<=\().*(?=\))','match');
    split_params = regexp(params,',','split');
    matlab_type = sprintf('fp2[%d,%d,%d]',eval(char(split_params{1}(2))),eval(char(split_params{1}(2)))-eval(char(split_params{1}(3)))-eval(char(split_params{1}(1))),eval(char(split_params{1}(1))));
else
    matlab_type = 'error';
end



end

