verifier/Verifier.cpp
// recursively build the full navigation set
recursively build the full navigation set
recursively build the full navigation set
void Verifier::build_tree(Node*& res, int taskid, int varid, int par_expr_id,
		int type, string prefix, int& num_expr) {
	DBSchema& schema = art.db;
	NaviNode* node = new NaviNode();
	res = node;
	node->expr_id = num_expr++;
    node->type = type;
	node->par_expr_id = par_expr_id;
	expr_name.push_back(prefix);
	expr_to_node.push_back(node);
	task_var_expr_ids[taskid][varid].insert(node->expr_id);
	if (type >= 0) {
		node->children = vector<Node*>(schema.relations[type].arity - 1, NULL);
		for (int i = 0; i < schema.relations[type].arity - 1; i++) {
			char name[30];
			sprintf(name, "%s.%d", prefix.c_str(), i + 1);
			build_tree(node->children[i], taskid, varid, node->expr_id,
					schema.relations[type].types[i + 1], name, num_expr);
		}
	}
}
void Verifier :: build_tree ( Node * & res , int taskid , int varid , int par_expr_id , int type , string prefix , int & num_expr ) { DBSchema & schema = art . db ; NaviNode * node = new NaviNode ( ) ; res = node ; node -> expr_id = num_expr ++ ; node -> type = type ; node -> par_expr_id = par_expr_id ; expr_name . push_back ( prefix ) ; expr_to_node . push_back ( node ) ; task_var_expr_ids [ taskid ] [ varid ] . insert ( node -> expr_id ) ; if ( type >= 0 ) { node -> children = vector < Node * > ( schema . relations [ type ] . arity - 1 , NULL ) ; for ( int i = 0 ; i < schema . relations [ type ] . arity - 1 ; i ++ ) { char name [ 30 ] ; sprintf ( name , " " , prefix . c_str ( ) , i + 1 ) ; build_tree ( node -> children [ i ] , taskid , varid , node -> expr_id , schema . relations [ type ] . types [ i + 1 ] , name , num_expr ) ; } } }
recursively build the full navigation set
recursively build the full navigation set
// printf("%d\n", current);