WS Presentations Main Page
mmultiply([],_,[]).
mmultiply([V0|Rest], V1, [Result|Others]):-
mmultiply(Rest, V1, Others),
multiply(V1,V0,Result).
----------------------------------------------
mmultiply([],_,[]).
mmultiply([V0|Rest],V1,[Result|Others]) :-
(
ground(V1) ->
mmultiply(Rest,V1,Others)&
multiply(V1,V0,Result)
;
mmultiply(Rest,V1,Others),
multiply(V1,V0,Result)
).
----------------------------------------------
mmultiply([],_,[]).
mmultiply([V0|Rest],V1,[Result|Others]) :-
(
ground(V1) ->
mmultiply_g(Rest,V1,Others)&
multiply(V1,V0,Result)
;
mmultiply(Rest,V1,Others),
multiply(V1,V0,Result)
).
mmultiply_g([],_,[]).
mmultiply_g([V0|Rest],V1,[Result|Others]) :-
mmultiply_g(Rest,V1,Others)&
multiply(V1,V0,Result).