Question about placement of cuts



Q1. Is there any difference (to Prolog) between these two styles of
code?

Type 1:

foo(A,B) :-
bar(A),
!,
baz(B),
!.

bar(a).
bar(b).


baz(y).
baz(z).

=======================
Type 2:
foo(A,B) :-
bar(A),
baz(B).

bar(a) :- !.
bar(b) :- !.

baz(y) :- !.
baz(z) : - !.

=======================
Q2.
I have a predicate similar to this:

% determine_sign(Pre,Post,Overall).
determine_sign(pos,neg,neg).
determine_sign(pos,pos,pos).
determine_sign(neg,pos,neg).
determine_sign(neg,neg,pos).
determine_sign(_,_,[]).

Maybe that last clause should actually be this?

determine_sign(Pre,Post,[]) :-
\+ is_member(Pre, [pos,neg]),
\+ is_member(Post, [pos,neg]).

Does that have the same effect as adding cuts to each definition?

thanks,
Brianna

.