Commit c87dc6bb authored by Colin Eles's avatar Colin Eles
Browse files

added support to look for known functions and import their associated pvs...

added support to look for known functions and import their associated pvs libraries automatically, currently only have sqrt, but can add more as they come up

git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/trunk/TableTool@6742 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
parent 300c339d
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -14,6 +14,9 @@
% Organization: McMaster Centre for Software Certification
function [string,found] = pvs_check_for_imports_g(object,grid,found)
string = [];

hashtable = {{'sqrt', 'reals@sqrt'} {'test', 'my_import'}};

for i=1:size(grid.cells,2)
    % recurse through
    if (~isempty(grid.cells(i).subgrid))
@@ -23,6 +26,9 @@ for i=1:size(grid.cells,2)
    
    vars = regexp(text,'([a-zA-Z][a-zA-Z0-9_]*)','match');
    
    
    
    
    for j=1:size(vars,2)
        if(exist(vars{j},'file')==2 && ~strcmp(vars{j},'otherwise'))
            %check if already imported file
@@ -31,6 +37,15 @@ for i=1:size(grid.cells,2)
                found = [found vars{j}];
            end
        end
        
        for k=1:size(hashtable,2)
            if strcmp(vars{j},hashtable{k}(1))
                if (~any(ismember(found,vars{j})))
                string = [string 'IMPORTING ' char(hashtable{k}(2)) sprintf('\n')];
                found = [found vars{j}];
                end
            end    
        end
    end
end
end