%% genereate_cvc_grid
% generate the queries for cvc for the inputted grid.
%
% inputs:
%   grid:Grid - grid to generate conditions for.
%   level:int - count of the queries generated.
%   var_def:VariableParser - Parsed input of the variables, available in
%   the MATLAB2SMT java package.
%
% outputs;
%   code:string - string representing code to generate including comments
%   query:cell array - contains string representing both the disjoint and
%   complete without the comments, used for validation report.
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification

function [ code , query] = generate_cvc_grid( object, grid , level, var_def)

% New Junk
% First build grid in java
HGrid = ca.mcscert.jtet.tablularexpression.HierarchicalGrid
TableBlock.convert_hierarchical_grid_to_java(grid.cells, HGrid.getSubHiearchy());
% generate the formulas for the main grid

gridGenerator = ca.mcscert.jtet.cvc3generator.HierarchicalGridCVC3Generator(var_def, level);
code = char(ca.mcscert.jtet.tablularexpression.HierarchcialGridCheckerWalkerGenerator.GenerateCheckerFromGrid(HGrid, gridGenerator));
query = gridGenerator.getFinalQueries();




end

