semantics_computer_science

Semantics (Computer Science)

Return to Semantics (computer science), semantics, language semantics,

In computer science, the term semantics refers to the meaning of language constructs, as opposed to their form (syntax (logic) or syntax). According to Euzenat, semantics “provides the rules for interpreting the syntax which do not provide the meaning directly but constrains the possible interpretations of what is declared”.1)

Programming languages

The semantics of programming languages and other languages is an important issue and area of study in computer science. Like the syntax of a language, its semantics can be defined exactly.

For instance, the following statements use different syntaxes, but cause the same instructions to be executed, namely, perform an arithmetical addition of 'y' to 'x' and store the result in a variable called 'x':

Statement Programming languages

x += y

C, C++, C#, Java, JavaScript, Python, Ruby, etc.

$x += $y

Perl, PHP

x := x + y

Ada, ALGOL, ALGOL 68, BCPL, Dylan, Eiffel, J, Modula-2, Oberon, OCaml, Object Pascal (Delphi), Pascal, SETL, Simula, Smalltalk, Standard ML, VHDL, etc.

MOV EAX,[y]

<br />

ADD [x],EAX

Assembly languages: Intel 8086

ldr     r2, [y]

<br/>

ldr     r3, [x]

<br/>

add     r3, r3, r2

<br/>

str     r3, [x]

<br/>

Assembly languages: ARM

LET X = X + Y

BASIC: early

x = x + y

BASIC: most dialects; Fortran, MATLAB, Lua

Set x = x + y

Caché ObjectScript

ADD Y TO X.

ABAP

ADD Y TO X GIVING X

COBOL

set /a x=%x%+%y%

Batch

(incf x y)

Common Lisp

/x y x add def

PostScript

y @ x +! 

Forth

Various ways have been developed to describe the semantics of programming languages formally, building on mathematical logic:<ref>

</ref>

  • Operational semantics: The meaning of a construct is specified by the computation it induces when it is executed on a machine. In particular, it is of interest how the effect of a computation is produced.
  • Denotational semantics: Meanings are modelled by mathematical objects that represent the effect of executing the constructs. Thus only the effect is of interest, not how it is obtained.
  • Axiomatic semantics: Specific properties of the effect of executing the constructs are expressed as assertions. Thus there may be aspects of the executions that are ignored.

Semantic models

See also Ontology (information science)

The Semantic Web refers to the extension of the World Wide Web via embedding added semantic metadata, using semantic data modeling techniques such as Resource Description Framework (RDF) and Web Ontology Language (OWL). On the Semantic Web, terms such as semantic network and semantic data model are used to describe particular types of data model characterized by the use of directed graphs in which the vertices denote concepts or entities in the world and their properties, and the arcs denote relationships between them. These can formally be described as description logic concepts and roles, which correspond to OWL classes and properties.<ref name=“Sikos 2017”>

</ref>

Snippet from Wikipedia: Semantics (computer science)

In programming language theory, semantics is the rigorous mathematical study of the meaning of programming languages. Semantics assigns computational meaning to valid strings in a programming language syntax. It is closely related to, and often crosses over with, the semantics of mathematical proofs.

Semantics describes the processes a computer follows when executing a program in that specific language. This can be done by describing the relationship between the input and output of a program, or giving an explanation of how the program will be executed on a certain platform, thereby creating a model of computation.

1)
Euzenat, Jerome. Ontology Matching. Springer-Verlag Berlin Heidelberg, 2007, p. 36.
semantics_computer_science.txt · Last modified: 2024/04/28 03:34 (external edit)