Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Unification (computer science)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Application: unification in logic programming=== The concept of unification is one of the main ideas behind [[logic programming]]. Specifically, unification is a basic building block of [[Resolution (logic)|resolution]], a rule of inference for determining formula satisfiability. In [[Prolog]], the equality symbol <code>=</code> implies first-order syntactic unification. It represents the mechanism of binding the contents of variables and can be viewed as a kind of one-time assignment. In Prolog: # A [[variable (programming)|variable]] can be unified with a constant, a term, or another variable, thus effectively becoming its alias. In many modern Prolog dialects and in [[first-order logic]], a variable cannot be unified with a term that contains it; this is the so-called ''[[occurs check]]''. # Two constants can be unified only if they are identical. # Similarly, a term can be unified with another term if the top function symbols and [[arities]] of the terms are identical and if the parameters can be unified simultaneously. Note that this is a recursive behavior. # Most operations, including <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, are not evaluated by <code>=</code>. So for example <code>1+2 = 3</code> is not satisfiable because they are syntactically different. The use of integer arithmetic constraints <code>#=</code> introduces a form of E-unification for which these operations are interpreted and evaluated.<ref>{{cite web |title=Declarative integer arithmetic |url=https://www.swi-prolog.org/pldoc/man?section=clpfd-integer-arith |website=SWI-Prolog |access-date=18 February 2024}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)