Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Semantics
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Computer science === {{main|Semantics (computer science)}} In computer science, the semantics of a [[Computer program|program]] is how it behaves when a computer runs it. Semantics contrasts with syntax, which is the particular form in which instructions are expressed. The same behavior can usually be described with different forms of syntax. In [[JavaScript]], this is the case for the commands <code>i += 1</code> and <code>i = i + 1</code>, which are syntactically different expressions to increase the value of the variable ''i'' by one. This difference is also reflected in different [[programming languages]] since they rely on different syntax but can usually be employed to create programs with the same behavior on the semantic level.<ref>{{multiref | {{harvnb|Fernández|2014|pp=[https://books.google.com/books?id=dzi5BQAAQBAJ&pg=PA10 10, 14–15]}} | {{harvnb|Dale|Weems|Headington|2003|pp=[https://books.google.com/books?id=VbyCFuJLgOMC&pg=PA42 42, 44]}} | {{harvnb|O’Regan|2020|p=[https://books.google.com/books?id=hnLJDwAAQBAJ&pg=PA193 193]}} }}</ref> Static semantics focuses on semantic aspects that affect the [[compile time|compilation]] of a program. In particular, it is concerned with detecting errors of syntactically correct programs, such as [[type error]]s, which arise when an operation receives an incompatible [[data type]]. This is the case, for instance, if a function performing a numerical calculation is given a [[String (computer science)|string]] instead of a number as an argument.<ref>{{multiref | {{harvnb|Fernández|2014|pp=[https://books.google.com/books?id=dzi5BQAAQBAJ&pg=PA14 14–15]}} | {{harvnb|Fritzson|2010|p=[https://books.google.com/books?id=doNqLi7279wC&pg=PA703 703]}} | {{harvnb|Mosses|2003|p=[https://books.google.com/books?id=tMlrCQAAQBAJ&pg=PA167 167]}} }}</ref> Dynamic semantics focuses on the run time behavior of programs, that is, what happens during the [[Execution (computing)|execution]] of instructions.<ref>{{multiref | {{harvnb|Fernández|2014|pp=[https://books.google.com/books?id=dzi5BQAAQBAJ&pg=PA15 15–16]}} | {{harvnb|Fritzson|2010|p=[https://books.google.com/books?id=doNqLi7279wC&pg=PA703 703]}} | {{harvnb|Mosses|2003|p=[https://books.google.com/books?id=tMlrCQAAQBAJ&pg=PA167 167]}} }}</ref> The main approaches to dynamic semantics are [[denotational semantics|denotational]], [[axiomatic semantics|axiomatic]], and [[operational semantics]]. Denotational semantics relies on mathematical formalisms to describe the effects of each element of the code. Axiomatic semantics uses deductive logic to analyze which conditions must be in place before and after the execution of a program. Operational semantics interprets the execution of a program as a series of steps, each involving the transition from one [[State (computer science)|state]] to another state.<ref>{{multiref | {{harvnb|Fernández|2014|p=[https://books.google.com/books?id=dzi5BQAAQBAJ&pg=PA16 16]}} | {{harvnb|O’Regan|2020|pp=[https://books.google.com/books?id=hnLJDwAAQBAJ&pg=PA193 193–194]}} }}</ref>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Semantics
(section)
Add topic