Skip to content
find_parents.m 1.03 KiB
Newer Older
%% find_parents
% function will find all the parents of a cell, used to determine what
% preconditions must be true.
%
% inputs:
%   cell:Cell - cell to find the parents of
%
% outputs;
%   code:string - string of conjunction of all parent cells.
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification

function [ code ] = find_parents( cell )
% assumption, initial input will be grid we want to find parents for not
%  cell itself

code = '';
if isempty(cell)
    % current cell is empty
    code = '';
else
    if isempty(cell.parent_grid.parent_cell)
        % no parent cell
        
    else
        % there is a parent cell
        top = char(CVC_checker.find_parents(cell.parent_grid.parent_cell));
        code = char(cell.parent_grid.parent_cell.cond_text);
        if isempty(top);
            % there were no more above this cell
            
        else
            % there were more above this cell
            code = [code ' AND ' top];
        end
        
        
    end
    
    
end




end