3 – Structured Languages

What makes it so hard for computers to understand us? One drawback of human languages, or feature depending on how you look at it, is the lack of a precisely defined structure. To understand how that makes things difficult let’s first take a look at some languages that are more structured. Mathematics, for instance, uses a structured language. When I write y equals 2x plus 5 there is no ambiguity in what I want to convey. I’m saying that the variable y is related to the variable x as two times x plus five. Formal logic also uses a structure language. For example, consider the expression parent(x,y) and parent(x,z) implies sibling(y, z). This statement is asserting that if x is a parent of y and x is a parent of z, then y and z are siblings. A set of structure languages that may be more familiar to you are scripting and programming languages. Consider this SQL statement. SELECT name, email FROM users WHERE name LIKE A%. We are asking the database to return the names and e-mail addresses of all users whose names begin with an A. These languages are designed to be as unambiguous as possible and are suitable for computers to process.

%d 블로거가 이것을 좋아합니다: