patternMinor
What are the definitions of syntax and semantics?
Viewed 0 times
thewhatsemanticsaresyntaxanddefinitions
Problem
-
For a formal language $L \subseteq \Sigma^*$ over an alphabet
$\Sigma$. From https://proofwiki.org/wiki/Definition:Syntax
The syntax of a formal language is its structure, and is specified by
a formal grammar of the formal language.
From http://en.wikipedia.org/wiki/Syntax_%28logic%29
In logic, syntax is anything having to do with formal languages or formal systems without regard to any interpretation or meaning given to them. Syntax is concerned with the rules used for constructing, or transforming the symbols and words of a language, as contrasted with the semantics of a language which is concerned with its meaning
-
How do you define the "structure" of a formal language,
and therefore define the syntax of a formal language? Ideally define
them formally or mathematically?
-
The syntax of a formal language should be defined formally, because it pertains to the formal language which is defined formally as a subset of $\Sigma^*$, right?
-
Raphael once said that the syntax of a formal language is
the language itself. Is it true?
-
From http://en.wikipedia.org/wiki/Syntax_%28logic%29
Syntax is usually associated with the rules (or grammar) governing the composition of texts in a formal language that constitute the well-formed formulas of a formal system.
We shouldn't equate the two concepts: the syntax of a formal language, and a formal grammar of a formal language, should we?
Note that a formal language can have several formal grammars that all generate the language. When a formal language has multiple different formal grammars that generate it, is the syntax different for different grammar?
Also a formal language may not have a formal grammar that can generate it, and still syntax should make sense to such a formal language?
-
For a non-formal language $L'$ over an alphabet $\Sigma$,
-
What are
the definitions of its syntax and its semantics, ideally
mathematically?
-
When defining its syntax, how do you distinguish what pertai
For a formal language $L \subseteq \Sigma^*$ over an alphabet
$\Sigma$. From https://proofwiki.org/wiki/Definition:Syntax
The syntax of a formal language is its structure, and is specified by
a formal grammar of the formal language.
From http://en.wikipedia.org/wiki/Syntax_%28logic%29
In logic, syntax is anything having to do with formal languages or formal systems without regard to any interpretation or meaning given to them. Syntax is concerned with the rules used for constructing, or transforming the symbols and words of a language, as contrasted with the semantics of a language which is concerned with its meaning
-
How do you define the "structure" of a formal language,
and therefore define the syntax of a formal language? Ideally define
them formally or mathematically?
-
The syntax of a formal language should be defined formally, because it pertains to the formal language which is defined formally as a subset of $\Sigma^*$, right?
-
Raphael once said that the syntax of a formal language is
the language itself. Is it true?
-
From http://en.wikipedia.org/wiki/Syntax_%28logic%29
Syntax is usually associated with the rules (or grammar) governing the composition of texts in a formal language that constitute the well-formed formulas of a formal system.
We shouldn't equate the two concepts: the syntax of a formal language, and a formal grammar of a formal language, should we?
Note that a formal language can have several formal grammars that all generate the language. When a formal language has multiple different formal grammars that generate it, is the syntax different for different grammar?
Also a formal language may not have a formal grammar that can generate it, and still syntax should make sense to such a formal language?
-
For a non-formal language $L'$ over an alphabet $\Sigma$,
-
What are
the definitions of its syntax and its semantics, ideally
mathematically?
-
When defining its syntax, how do you distinguish what pertai
Solution
To beging with, the expression "formal language" may refer to formally
defined sets of string as considered in the theory of automata and
formal languages. I shall write that "Formal Language" with capital
first letters. But "formal language" may also refer to some kind of
language that is intended for expressing meaning, but is precisely
defined mathematically. I shall rather call it formally defined language.
A first remark is that formally defined languages are similar to natural
languages (vernacular), in the sense that both are used to convey
meaning through representations of that meaning.
This is the fundamental issue. We have to convey meaning, to others,
or to ourselves (when we take notes). Meaning can concern all sorts of
things, some finite, some infinite, possibly about strange domains of
human imaginations, such as real numbers, or the set of all sets.
But we can always do that only through representation. The
representation may be a linear sequence of symbols. It may also be a
spatially organized collection of symbols. It may be drawings, or data
structures in a computer, or sound stream, or gestures. It is
physical.
To answer the question in a nutshell, and in a very general way: the
organisation of the physical representation of discourse is syntax,
while semantics is the meaning conveyed, and the way it is derived
into, or from, the representation.
A major characteristic of syntax is that syntactic representations
are finite: they convey a finite amount of information. This is true
of pictures that can de digitized with finite precision to convey what
they are supposed to convey, But the best example is one of the most
common form of representation: the written text. If one takes all the
symbols used for writing as digits in a proper base, any written text
may be read an integer number, which is a finite object. This does not
prevent the discourse from being about infinite objects, or whatever
else, including ghosts, leprechauns, the Zeta function, the turtle
that carries the planet on its back and the last Sunday before the
Big-Bang. And, this does not forbid having an infinite number of
representations, of sentences of the language.
But how is syntax connected to semantics? How do we associate a
meaning with physical representation. The most basic way is to
associate a specific meaning to specific representations, and learn
these associations. This is basically how ideographic writing gets
started. But it has limitation: you can define only a finite number of
meanings in this way. An important aspect of language is to
be able to handle unbounded number of meaning by associating in an
organized way the representation of elementary meanings.
So syntax is not just a collection of elementary representations, but
also a collection of rules to associate them to make more complex
representations. Elementary representations correspond to elementary
meanings, and rules associating them indicate how the simpler meanings
can be composed to make more complex meanings.
A simple example is the way formally defined languages are
specified in mathematics (I am simplifying somewhat, skipping over
some technical issues, parsing technology for example). The syntax is
defined as a set of string over an alphabet. This set is often defined
by a context-free grammar. that provides rules to create strings on
the alphabet. The rules also associate strctures to strings: the
parse-trees. The definition of semantics associate a value (of
whatever domain) to the elements of the alphabet, and associate
operations on these values to the rules of the grammar. This define a
homomorphism from the set of string in the context-free syntax to the
set of values in the semantic domain. (Note that, sometimes, the syntax is directly defined as a set of trees.)
So we have an infinite set (the syntax Formal Language) of finite
representations (string or sentences of the formal language) which has
a finite definition/description (the Context-Free grammar). The
semantics is defined by specifying a domain of values, and both the
domain and the values in it may be finite or infinite entities. For example
a mathematical text, though finite, can talk about real numbers which
are a continuously infinite set of infinite entities (in the sens that
most reals do not have a finite description). Furthermore, the mapping
is finitely defined, by associating a function with each grammar rule.
A rule composes subpart of the text into a larger text, and the
associated function composes the meaning of these subparts into a
meaning for the larger text.
Not all kinds of Formal Languages may be appropriate for syntax
definition. They must provide some structure to the language strings
that can be used to define the semantics mapping. Besides context-free languages and grammars, there are
many other kinds of Formal Languages and Formal Language Definitions
that can provide structure for syntax strings (tree adjoining grammars
for example). Th
defined sets of string as considered in the theory of automata and
formal languages. I shall write that "Formal Language" with capital
first letters. But "formal language" may also refer to some kind of
language that is intended for expressing meaning, but is precisely
defined mathematically. I shall rather call it formally defined language.
A first remark is that formally defined languages are similar to natural
languages (vernacular), in the sense that both are used to convey
meaning through representations of that meaning.
This is the fundamental issue. We have to convey meaning, to others,
or to ourselves (when we take notes). Meaning can concern all sorts of
things, some finite, some infinite, possibly about strange domains of
human imaginations, such as real numbers, or the set of all sets.
But we can always do that only through representation. The
representation may be a linear sequence of symbols. It may also be a
spatially organized collection of symbols. It may be drawings, or data
structures in a computer, or sound stream, or gestures. It is
physical.
To answer the question in a nutshell, and in a very general way: the
organisation of the physical representation of discourse is syntax,
while semantics is the meaning conveyed, and the way it is derived
into, or from, the representation.
A major characteristic of syntax is that syntactic representations
are finite: they convey a finite amount of information. This is true
of pictures that can de digitized with finite precision to convey what
they are supposed to convey, But the best example is one of the most
common form of representation: the written text. If one takes all the
symbols used for writing as digits in a proper base, any written text
may be read an integer number, which is a finite object. This does not
prevent the discourse from being about infinite objects, or whatever
else, including ghosts, leprechauns, the Zeta function, the turtle
that carries the planet on its back and the last Sunday before the
Big-Bang. And, this does not forbid having an infinite number of
representations, of sentences of the language.
But how is syntax connected to semantics? How do we associate a
meaning with physical representation. The most basic way is to
associate a specific meaning to specific representations, and learn
these associations. This is basically how ideographic writing gets
started. But it has limitation: you can define only a finite number of
meanings in this way. An important aspect of language is to
be able to handle unbounded number of meaning by associating in an
organized way the representation of elementary meanings.
So syntax is not just a collection of elementary representations, but
also a collection of rules to associate them to make more complex
representations. Elementary representations correspond to elementary
meanings, and rules associating them indicate how the simpler meanings
can be composed to make more complex meanings.
A simple example is the way formally defined languages are
specified in mathematics (I am simplifying somewhat, skipping over
some technical issues, parsing technology for example). The syntax is
defined as a set of string over an alphabet. This set is often defined
by a context-free grammar. that provides rules to create strings on
the alphabet. The rules also associate strctures to strings: the
parse-trees. The definition of semantics associate a value (of
whatever domain) to the elements of the alphabet, and associate
operations on these values to the rules of the grammar. This define a
homomorphism from the set of string in the context-free syntax to the
set of values in the semantic domain. (Note that, sometimes, the syntax is directly defined as a set of trees.)
So we have an infinite set (the syntax Formal Language) of finite
representations (string or sentences of the formal language) which has
a finite definition/description (the Context-Free grammar). The
semantics is defined by specifying a domain of values, and both the
domain and the values in it may be finite or infinite entities. For example
a mathematical text, though finite, can talk about real numbers which
are a continuously infinite set of infinite entities (in the sens that
most reals do not have a finite description). Furthermore, the mapping
is finitely defined, by associating a function with each grammar rule.
A rule composes subpart of the text into a larger text, and the
associated function composes the meaning of these subparts into a
meaning for the larger text.
Not all kinds of Formal Languages may be appropriate for syntax
definition. They must provide some structure to the language strings
that can be used to define the semantics mapping. Besides context-free languages and grammars, there are
many other kinds of Formal Languages and Formal Language Definitions
that can provide structure for syntax strings (tree adjoining grammars
for example). Th
Context
StackExchange Computer Science Q#28376, answer score: 5
Revisions (0)
No revisions yet.