[m-rev.] preliminary review: Fix lax matching of ground inst with bound final inst.

Peter Wang novalazy at gmail.com
Mon Aug 18 16:28:46 AEST 2014


On Mon, 18 Aug 2014 16:06:37 +1000, Peter Wang <novalazy at gmail.com> wrote:
> compiler/prog_rep.m:
> 	Use `instmap_changed_vars_old' in a spot to avoid breaking some
> 	declarative debugging test cases.  I don't know where the real
> 	problem lies.

The failing tests are: dependency, dependency2, find_origin, info,
input_term_dep.  All abort in find_arg_pos_from_back (empty list).

The change to instmap_changed_vars changes the procedure byte codes.
The first example I found is the N = 0 deconstruction in info.m:

    :- pred q(int::in, T::in, t(t(t(T)))::out, int::out) is det.

    q(N, X, Y, M) :-
            ( N = 0 ->
                    Y = f(N, X),
                    M = 2
            ;
                    M = fproc(N),
                    Y = t(t(t(X)))
            ).

and in goal_to_goal_rep:

    Uni = deconstruct(_, _, _, _, _, _),
    ( list.member(Var, BoundVars) ->
        AtomicGoalRep = partial_deconstruct_rep(VarRep,
            ConsIdRep, MaybeArgsRep)
    ;
        AtomicGoalRep = unify_deconstruct_rep(VarRep,
            ConsIdRep, ArgsRep)
    )

N was previously not in BoundVars, but now is, so the goal representation
changes from unify_deconstruct_rep to partial_deconstruct_rep.  I think
the new behaviour is correct, meaning the problem is elsewhere.

Peter



More information about the reviews mailing list