Linear implication can be used to quickly add some language
enhancements to a Prolog system. For instance, to add
a switch case statement one can write
simply:
switch(Selector,Body):- case(Selector)-:Body. test(X):- switch(X, ( case(1)->write(one) ; case(2)->write(two) ; otherwise->write(unexpected(X)) )) ,nl. % ?-test(2),test(13).
Clearly, this is a very compact way, useful at least as a specification. Note that this can be done as well with macro expansion, possibly more efficiently, but also with much more work.