In implicit reference design, are storable values and expressed values the same, and are the references not storable values?

放肆的年华 提交于 2019-12-02 22:39:34

问题


I am self learning some parts of Essentials of Programming Languages.

First let me quote some definitions from Essentials of Programming Languages:

the expressed values are the possible values of expressions, and the denoted values are the values bound to variables.

and

We model memory as a finite map from locations to a set of values called the storable values. For historical reasons, we call this the store.

The storable values in a language are typically, but not always, the same as the expressed values of the language. This choice is part of the design of a language

Now come my questions. In the implicit reference design (e.g. the design adopted in Scheme, Java, C#, Python)

every variable denotes a reference. Denoted values are references to locations that contain expressed values. References are no longer expressed values. They exist only as the bindings of variables.

ExpVal = Int+Bool+Proc
DenVal = Ref(ExpVal)

and

Ref(ExpVal) means the set of references to locations that contain expressed values.

In the implicit reference design described in the third quote,

  • Are the set of expressed values and the set of storable values the same?

    I guess yes, because that seems to be implied by the use of Ref(ExpVal) in the implicit design and by the fourth/last quote (Ref is explicitly said to apply to ExpVal and not explicitly said to apply to StorableVal), and also because that is the case typically in a language, according to the second quote.

    But I am not sure if the answer is yes, because that would lead to some contradiction to my possibly incorrect intuition that a denotable value is a storable value.

  • Are the references not storable values?

    I guess no, because the references are not expressed values (according to the third quote) and the expressed values and the storable values are the same (if the answer to the previous question is yes).

来源:https://stackoverflow.com/questions/57468612/in-implicit-reference-design-are-storable-values-and-expressed-values-the-same

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!