Another difference between Prolog and Mercury is that Mercury lacks 'real' unification. Predicates must be moded (they must be compiled for some particular variable instantiation states). The compiler reorders literals in a way that free variables do not need to be represented in memory. Almost all the 'logical' side of the language is discarded statically at compile-time. The first time that I tried it (+ 20 years ago!) executables were blazingly fast! The bad side (at the time) was poor flexibility and very slow compilation time (compared with Prolog).