2

I wonder why we use 'assignment' the way that we do? When we state with a definition expression that some variable takes some value, what does this mean? Is there a sense of time in the frame of Mathematics and Logic where certain names refer to certain values? Or is this essence of 'change' wrong? Should we see 'assignment' as really expressing a function that maps between different 'variable spaces' so we are seeing the mapping for when we interpret the value of a particular number in place of our placeholder for a 'name'? In something such as computer-science the idea of assignment, is just that, something that's set until you change it, but the concept of 'assignment' in Logic and Mathematical contexts seems much less clear, what is the best way to understand it? Does the variable name become a valid way to refer to a particular value under a particular 'assignment' and when is this true?

4
  • In programming, "assignment" usually refers to something that happens in time, or at least in sequence. In logic, it means something more like "definition". Apr 29, 2022 at 23:22
  • It is only a technical term for the semantic operation that gives a reference to a term. May 1, 2022 at 8:14
  • @MauroALLEGRANZA would you recommend somewhere to find out more about a formal way of viewing it, the way we treat it and the language we use? such as the for... and when... statements?
    – Confused
    May 1, 2022 at 9:15
  • See e.g. Tarski’s Truth Definitions May 2, 2022 at 7:57

2 Answers 2

0

Answer

Well, a glance at the etymology of 'assignment (Etymonline)' gives us one clue:

late 14c., "an order, request, directive," from Old French assignement "(legal) assignment (of dower, etc.)," from Late Latin assignamentum, noun of action from Latin assignare/adsignare "to allot, assign, award" (see assign). Meaning "appointment to office" is mid-15c.; that of "a task assigned (to someone), commission" is by 1848.

While we tend to think of assignments as a synonym for tasks, 'assignment' is also a synonym for order, as in imperative. Thus, whether in a mathematical context or a computer science context (they're really both computation anyway), an assignment is a command. On a computer, int x:=5; is a sentence to order the compiler to associate the identifier a with the integer value of 5. In mathematics, historically, the order is expressed with the delightful imperative 'let' as in Let x be 5. Remember, in mathematics, logic, and programming, in essence an algorithm or a proof is nothing more than a series of operations, and the person writing it is instructing the compiler or math partner to follow a series of steps.

Does the variable name become a valid way to refer to a particular value under a particular 'assignment' and when is this true?

Absolutely. The variable name or identifier, if you prefer, is a valid way to refer to the value assigned anytime after the assignment. The only real difference between instructions to a math or logic student and that to a compiler is that math and logic teachers tend to presume steps can be ordered in a way that a programmer usually cannot and must make explicit. That is, compilers are notoriously finicky because they do exactly what you tell them to do. For instance, to get a compiler to assign values associated with an identifier like a ten times, one generally has to use syntax like for( a:=0; a<11; a++){} which very clearly sets up an initial assignment a:=0 for the first iteration, then sets up an explicit Boolean conditional to continue a<ll; a++ 'at the end of every iteration of the block, increment the value by one as long as the variable is less than 11'. On the other hand, a math teacher might just say, let a start at 0 and continue the process to 10. Whereas a compiler has strict rules which govern it's iteration (because it's a mindless Turing machine), a human being can imagine all sorts of ways to do an assignment that might not be what the math teacher has in mind.

But, this isn't really an issue that inheres to 'assignment' per se, but one that is more general to the difference between giving an order to an interpreter in a BNF syntax and using natural language to asking a human being to do something.

2
  • As we know, humans don't always do "exactly what you tell them to do".
    – Scott Rowe
    May 30, 2022 at 13:41
  • @ScottRowe lol I'm a parent. I know. But in a theory of physical computation, a human computer is an idealized person that does. :D
    – J D
    May 30, 2022 at 14:38
0

Assignments are typically modeled as functions, both in mathematics and computer science. In particular, there is not really a notion of "time", or at least does not have to be.

For example, consider model theory. In (first order) model theory, a variable assignment is a (total) function from the variables to the domain. We use variable assignments to recursively define the notion of satisfaction. In particular, we say that a model M, variable assignment s satisfy P iff M, s' satisfy P for every s' that agrees with s everywhere except possibly at v.

Consider also computer science and take an imperative language. An assignment is a command rougly of the form "x:=a". One typical model of this command is as a function from states to states, where a state can roughly be modeled as a function that takes sets of identifiers to the domain. In this example, we might have that stX was at first 3. After the command, stX is now a.

The upshot is this: what assignment means varies from context to context. If you're in a formal setting, make sure you are clear on that particular usage.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .