Does Mathematica use first-order or second-order unification?

Does Mathematica use first order or second order order unification?

  • When Mathematica is pattern-matching expressions, does it use first order or second order http://en.wikipedia.org/wiki/Unification_%28computer_science%29. Just to clarify the difference between first order and second order unification: In Second order unification, it is possible to replace a pattern variable with a function: When the expression 3+3 or Plus[3,3] is matched with the pattern f[3], the matching succeeds and f is bound to Plus[#, #]& or Plus[3, #]&.

  • Answer:

    I am not an expert in the field, but ... According to http://www.mathematica-journal.com/issue/v4i1/columns/maeder/53-63_Roman41.mj.pdf (and he is an expert): The process of unification should be easy to understand for Mathematica users, since a weaker form of it —pattern matching— is the fundamental operating principle of Mathematica’s evaluator. So, no unification is done in native Mma. If you need it, Maeder presents in that 2 articles series a package with a modified evaluator that aims to bring second order unification to Mma. Just for those to whom unification means only a physics Grail, should Mma have unification you could do things like: f[x_,a] /. f[b,y_]-> {x,y} (* -> {b,a} *)

user1176201 at Mathematica Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.