Name Resolution - Wikipedia, The Free Encyclopedia

6
12/19/2014 Name resolution - Wikipedia, the free encyclopedia http://en.wikipedia.org/wiki/Name_resolution 1/6 Name resolution From Wikipedia, the free encyclopedia Name resolution can refer to any process that further identifies an object or entity from an associated, not- necessarily-unique alphanumeric name: In computer systems, it refers to the retrieval of the underlying numeric values corresponding to computer hostnames, account user names, group names, and other named entities; In programming languages, it refers to the resolution of the tokens within program expressions to the intended program components; In semantics and text extraction, it refers to the determination of the specific person, actor, or object a particular use of a name refers to. Contents 1 In computer systems 2 In programming languages 2.1 Static versus dynamic 2.2 Name masking 2.3 Alpha renaming to make name resolution trivial 3 In semantics and text extraction 3.1 Name resolution in simple text 3.2 Name resolution across documents 4 See also 5 References In computer systems Computer operating systems commonly employ multiple key/value lists that associate easily remembered names with the integer numbers used to identify users, groups, other computers, hardware devices, and other entities. In that context, name resolution refers to the retrieval of numeric values given the associated names, while Reverse name resolution refers to the opposite process of finding the name(s) associated with specified numeric values: In computer networking, it refers to processes used to obtain the assigned IP addresses needed to communicate with devices whose host or domain names are known. Examples include the Domain Name System (DNS), Network Information Service and Multicast DNS (mDNS). IP addresses for devices on the local segment can in turn be resolved to MAC addresses by invoking the Address

description

fdsffdsf

Transcript of Name Resolution - Wikipedia, The Free Encyclopedia

12/19/2014 Name resolution - Wikipedia, the free encyclopedia

http://en.wikipedia.org/wiki/Name_resolution 1/6

Name resolutionFrom Wikipedia, the free encyclopedia

Name resolution can refer to any process that further identifies an object or entity from an associated, not-necessarily-unique alphanumeric name:

In computer systems, it refers to the retrieval of the underlying numeric values corresponding tocomputer hostnames, account user names, group names, and other named entities;In programming languages, it refers to the resolution of the tokens within program expressions to theintended program components;In semantics and text extraction, it refers to the determination of the specific person, actor, or object aparticular use of a name refers to.

Contents

1 In computer systems2 In programming languages

2.1 Static versus dynamic2.2 Name masking2.3 Alpha renaming to make name resolution trivial

3 In semantics and text extraction3.1 Name resolution in simple text3.2 Name resolution across documents

4 See also5 References

In computer systemsComputer operating systems commonly employ multiple key/value lists that associate easily rememberednames with the integer numbers used to identify users, groups, other computers, hardware devices, and otherentities. In that context, name resolution refers to the retrieval of numeric values given the associatednames, while Reverse name resolution refers to the opposite process of finding the name(s) associated withspecified numeric values:

In computer networking, it refers to processes used to obtain the assigned IP addresses needed tocommunicate with devices whose host or domain names are known. Examples include the DomainName System (DNS), Network Information Service and Multicast DNS (mDNS). IP addresses fordevices on the local segment can in turn be resolved to MAC addresses by invoking the Address

12/19/2014 Name resolution - Wikipedia, the free encyclopedia

http://en.wikipedia.org/wiki/Name_resolution 2/6

Resolution Protocol (ARP).Unix operating systems associate both an alphanumeric name and a user or group ID with each useraccount or defined group of user names.

The GNU C library provides various operating system facilities that shell commands and other applicationscan call to resolve such names to the corresponding addresses or IDs, and vice-versa. Some Linuxdistributions use an nsswitch.conf file to specify the order in which multiple resolution services are used toeffect such lookups.

In programming languagesExpressions in computer programs reference variables, data types, functions, classes, objects, libraries,packages and other entities by name. In that context, name resolution refers to the association of those not-necessarily-unique names with the intended program entities. The algorithms that determine what thoseidentifiers refer to in specific contexts are part of the language definition.

The complexity of these algorithms is influenced by the sophistication of the language. For example, nameresolution in assembly language usually involves only a single simple table lookup, while name resolutionin C++ is extremely complicated as it involves:

namespaces, which make it possible for an identifier to have different meanings depending on itsassociated namespace;scopes, which make it possible for an identifier to have different meanings at different scope levels,and which involves various scope overriding and hiding rules. At the most basic level name resolutionusually attempts to find the binding in the smallest enclosing scope, so that for example localvariables supersede global variables; this is called shadowing.visibility rules, which determine whether identifiers from specific namespaces or scopes are visiblefrom the current context;overloading, which makes it possible for an identifier to have different meanings depending on how itis used, even in a single namespace or scope;accessibility, which determines whether identifiers from an otherwise visible scope are actuallyaccessible and participate in the name resolution process.

Static versus dynamic

In programming languages, name resolution can be performed either at compile time or at runtime. Theformer is called static name resolution, the latter is called dynamic name resolution.

A somewhat common misconception is that dynamic typing implies dynamic name resolution. However,static typing does imply static name resolution. For example, Erlang is dynamically typed but has staticname resolution.

12/19/2014 Name resolution - Wikipedia, the free encyclopedia

http://en.wikipedia.org/wiki/Name_resolution 3/6

Static name resolution catches, at compile time, use of variables that are not in scope; preventingprogrammer errors. Languages with dynamic scope resolution sacrifice this safety for more flexibility; theycan typically set and get variables in the same scope at runtime.

For example, in Python:

locals()['num'] = 999 # equivalent to: num = 999noun = "troubles"noun2 = "hound" # which variables to use are decided at runtimeprint("{num} {noun} and a {noun2} ain't one".format(**locals())) # outputs: 999 troubles and a hound ain't one

However, relying on dynamic name resolution in code is discouraged by the Python community.[1][2] Thefeature also may be removed in a later version of Python.[3]

Examples of languages that use static name resolution include C, C++, E, Erlang, Haskell, Java, Pascal,Scheme, and Smalltalk. Examples of languages that use dynamic name resolution include some Lispdialects, Perl, PHP, Python, REBOL, and Tcl.

Name masking

Masking occurs when the same identifier is used for different entities in overlapping lexical scopes. At thelevel of variables (rather than names), this is known as variable shadowing. An identifier I' (for variable X')masks an identifier I (for variable X) when two conditions are met

1. I' has the same name as I2. I' is defined in a scope which is a subset of the scope of I

The outer variable X is said to be shadowed by the inner variable X'.

For example, the parameter x masks the local variable in this common pattern:

private int foo; // A declaration with name "foo" in an outer scope public void setFoo(int foo) { // A declaration with the same name in the inner scope // "foo" is resolved by looking in the innermost scope first, // so the author uses a different syntax, this.foo, to refer to the name "foo" // in the outer scope. this.foo = foo; } // "foo" here means the same as this.foo below, // since setFoo's parameter is no longer in scope. public void getFoo() { return foo; }

12/19/2014 Name resolution - Wikipedia, the free encyclopedia

http://en.wikipedia.org/wiki/Name_resolution 4/6

Name masking can cause complications in function overloading, due to overloading not happening acrossscopes in some languages, notably C++, thus requiring all overloaded functions to be redeclared orexplicitly imported into a given namespace.

Alpha renaming to make name resolution trivial

In programming languages with lexical scoping that do not reflect over variable names, α-conversion (or α-renaming) can be used to make name resolution easy by finding a substitution that makes sure that novariable name masks another name in a containing scope. Alpha-renaming can make static code analysiseasier since only the alpha renamer needs to understand the language's scoping rules.

For example, in this code:

class Point { private: double x, y; public: Point(double x, double y) { // x and y declared here mask the privates setX(x); setY(y); } void setX(double newx) { x = newx; } void setY(double newy) { y = newy; } }

within the Point constructor, the class variables x and y are shadowed by local variables of the same name.This might be alpha-renamed to:

class Point { private: double x, y; public: Point(double a, double b) { setX(a); setY(b); } void setX(double newx) { x = newx; } void setY(double newy) { y = newy; } }

In the new version, there is no masking, so it is immediately obvious which uses correspond to whichdeclarations.

In semantics and text extractionIn this context (also referred to as entity resolution), name resolution refers to the ability of text miningsoftware to determine which actual person, actor, or object a particular use of a name refers to.

12/19/2014 Name resolution - Wikipedia, the free encyclopedia

http://en.wikipedia.org/wiki/Name_resolution 5/6

Name resolution in simple text

For example, in the text mining field, software frequently needs to interpret the following text:

John gave Edward the book. He then stood up and called to John to come back into the room.

In these sentences, the software must determine whether the pronoun "he" refers to "John", or "Edward"from the first sentence. The software must also determine whether the "John" referred to in the secondsentence is the same as the "John" in the first sentence, or a third person whose name also happens to be"John". Such examples apply to almost all languages, and not only English.

Name resolution across documents

Frequently, this type of name resolution is also used across documents, for example to determine whetherthe "George Bush" referenced in an old newspaper article as President of the United States (George H. W.Bush) is the same person as the "George Bush" mentioned in a separate news article years later about a manwho is running for President (George W. Bush.) Because many people may have the same name, analystsand software must take into account substantially more information than only a name to determine whethertwo identical references ("George Bush") actually refer to the same specific entity or person.

Name/entity resolution in text extraction and semantics is a notoriously difficult problem, in part because inmany cases there is not sufficient information to make an accurate determination. Numerous partialsolutions exist that rely on specific contextual clues found in the data, but there is no currently knowngeneral solution.

The problem is sometimes referred to as name disambiguation and, for digital libraries, authordisambiguation.

For examples of software that might provide name resolution benefits, see also:

AeroTextAlchemyAPIAttensityAutonomyBasis Technologydandelion dataTXT (https://dandelion.eu/products/datatxt/), providing a customizable approach forname resolution using an internal knowledge graph (built on Wikipedia, DBpedia and other sources)DBpedia Spotlight, providing a simple approach for name resolution using DBpedia and WikipediaNerso (http://wis.etu.edu.tr/nerso), another approach for name resolution using DBpedia.NetOwl

See also

12/19/2014 Name resolution - Wikipedia, the free encyclopedia

http://en.wikipedia.org/wiki/Name_resolution 6/6

Name serverMulticast DNSName Service SwitchIdentity resolutionnamespace (programming)Scope (programming)Named entity recognitionNaming collisionAnaphor resolution

References1. ^ "[Python-Ideas] str.format utility function" (http://mail.python.org/pipermail/python-ideas/2009-

May/004582.html). 9 May 2009. Retrieved 2011-01-23.2. ^ "8.6. Dictionary-based string formatting"

(http://diveintopython.org/html_processing/dictionary_based_string_formatting.html). diveintopython.org. MarkPilgrim. Retrieved 2011-01-23.

3. ^ "9. Classes - Python v2.7.1 documentation" (https://docs.python.org/tutorial/classes.html#python-scopes-and-namespaces). Retrieved 2011-01-23. "search for names is done dynamically, at run time — however, thelanguage definition is evolving towards static name resolution"

Retrieved from "http://en.wikipedia.org/w/index.php?title=Name_resolution&oldid=626479321"

Categories: Computer libraries Compiler construction

This page was last modified on 21 September 2014 at 14:08.Text is available under the Creative Commons Attribution-ShareAlike License; additional terms mayapply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is aregistered trademark of the Wikimedia Foundation, Inc., a non-profit organization.