Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
sav08:program_memory_as_graph [2009/03/18 09:37] vkuncak |
sav08:program_memory_as_graph [2015/04/21 17:30] (current) |
||
---|---|---|---|
Line 4: | Line 4: | ||
Variables in program state: | Variables in program state: | ||
- | \[ | + | \begin{equation*} |
next,prev : Obj \to Obj | next,prev : Obj \to Obj | ||
- | \] | + | \end{equation*} |
Total functions (as in predicate logic, to make all variables well-defined). | Total functions (as in predicate logic, to make all variables well-defined). | ||
+ | |||
+ | We define: | ||
+ | next(null)=null | ||
Special value (constant): $null \in Obj$ | Special value (constant): $null \in Obj$ | ||
Line 15: | Line 18: | ||
Program state as interpretation $I = (Obj,\alpha)$ in language ${\cal L} = \{ next, prev, null \}$. | Program state as interpretation $I = (Obj,\alpha)$ in language ${\cal L} = \{ next, prev, null \}$. | ||
- | Values of $next,prev,n,first$ in example state. | + | Values of $next,prev,n,first$ in example state: |
+ | * before [[Insertion into Doubly-Linked List]] and | ||
+ | * after | ||
- | In general, program variables determines | + | In general, the declared fields determine |
- | * function symbols and predicate symbols for first-order logic formula | + | * function symbols, constants, and predicate symbols - if we use FOL |
- | * variables, if we use HOL (predicate and function symbols become variables, like others) | + | * variables, if we use HOL (predicate and function symbols become variables, like variables denoting elements) |