Question

Explan in few words how are similar and different static semantics and dynamic semantics?

Explan in few words how are similar and different static semantics and dynamic semantics?
0 0
Add a comment Improve this question Transcribed image text
Answer #1

STATIC SEMANTICS

Static semantics defines which syntatically valid sentences have a meaning. Semantics relates to meaning of a sentence that has no static semantic error.

For example: "'I can not praise the student too highly" is ambigous in meaning.

  • Better approach is to use attribute grammers-Knuth(1968)
  • Often specified using natural language descriptions- imprecise.

DYNAMIC SEMANTICS

Dynamic semantic is a perspective on natural language semantic that emphasizes the growth of information in time.It is an approach to meaning representation where pieces of text or discourse are viewed as instructions to update an exisiting context with new information, the result of which is an updated context.

  • Three approaches used are
  1. operational semantics.
  2. axiomatic semantics.
  3. denotational semantics.

STATIC AND DYNAMIC SEMANTICS

Static Semantics Dynamic Semantics
The static semantics of a language is indirectly related to the meaning of programs during execution. Dynamic semantics refers to the meaning of expressions, statements, and other program units.

Models complie time checks

  • Checks that can be performed before running
  • Well formation
  • Type checking

Models run time behaviour

  • Concerned with the observable behavior of a running program
  • Description of computational range.

Example:Type checking a type cast

TypeA() new TypeB()

Check that TypeA is a subclass of TypeB

Example:Evaluation of If-expressions

if(a)then(b)

If a evalutaes to true then evaluate b.

Checked at Complie time. Cannot be checked at compile time.
Cannot be check at Run-time. Can only be checked at Run-time.
Used to define things about PLs that are hard or impossible to define with BNF Describes the meaning of PL constructs.
Add a comment
Know the answer?
Add Answer to:
Explan in few words how are similar and different static semantics and dynamic semantics?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT