Example #1
0
static void		check_lines(t_env *env, t_node *start, t_node *end)
{
	t_node		*tmp;
	t_node		*tmp2;

	tmp = (env->proj == 0) ? isometric(env, start) : parallel(env, start);
	tmp2 = (env->proj == 0) ? isometric(env, end) : parallel(env, end);
	if ((tmp->x - tmp2->x) == 0)
		draw_vertical(env, tmp, tmp2);
	else
		check_affine(env, tmp, tmp2);
}
Example #2
0
evac study(Conjunct *C, Sequence<Variable_ID> &evac_from, Sequence<Variable_ID> &evac_to, int n_from, int n_to, int max_arity)
{
    assert(max_arity > 0);
    assert(max_arity <= C->relation()->n_inp());
    assert(max_arity <= C->relation()->n_out());

    assert((&evac_from == &input_vars && &evac_to == &output_vars) ||
	   (&evac_from == &output_vars && &evac_to == &input_vars));

    evac ret = evac_nasty;

    if (C->query_guaranteed_leading_0s() >= max_arity)
	ret = evac_trivial;
    else
	{
	Conjunct *c = C->copy_conj_same_relation();
	assert(c->relation() == C->relation());

	if (evac_debug >= 3)
	    {
	    fprintf(DebugFile, "About to study %s evacuation for conjunct\n",
		    &evac_from == &input_vars ? "In-->Out" : "Out-->In");
	    use_ugly_names++;
	    C->prefix_print(DebugFile);
	    use_ugly_names--;
	    }

	bool sat = simplify_conj(c, true, 4, black);
	assert(sat);  // else c is deleted

	int v, col;

	// Substitute out all possible symbolic constants
	assert(c->problem->nSUBs == 0);
	for (v = 1; v <= c->relation()->global_decls()->length(); v++)
	    if ((col = c->find_column((*c->relation()->global_decls())[v]))>0)
		try_to_sub(c->problem, col);

	if (check_offset(c, evac_from, evac_to, n_from, n_to, max_arity))
	    ret = evac_offset;
	else if (check_subseq(c, evac_from, evac_to, n_from, n_to, max_arity))
	    ret = evac_subseq;
	else if (check_offset_subseq(c, evac_from, evac_to, n_from, n_to, max_arity))
	    ret = evac_offset_subseq;
	else if (check_affine(c, evac_from, evac_to, n_from, n_to, max_arity))
	    ret = evac_affine;

	delete c;
    	}

    if (evac_debug >= 2)
	{
	if ((evac_debug == 2 && ret != evac_trivial && ret != evac_nasty))
	    {
	    fprintf(DebugFile, "Studied %s evacuation for conjunct\n",
		    &evac_from == &input_vars ? "In-->Out" : "Out-->In");
	    use_ugly_names++;
	    C->prefix_print(DebugFile);
	    use_ugly_names--;
	    }

	fprintf(DebugFile, "Saw evacuation type %s\n", evac_names[ret]);
	}

    return ret;
}