tags:

views:

121

answers:

3

i am new to perl and was asked to do a documentation on the semantics of perl.i did find some information but i cannot understand them.can some one explain it to me ion a simple way?a very simple explanation is enough.no need to go to deapth. explain how axiomatic,operatioonal and denotational semantics are implemented in perl thank you very much:)

+2  A: 

perldoc perlsyn and perldoc perlop should answer most of your questions.

Chas. Owens
+3  A: 

Well, Perl doesn't have a formal semantics---just a reference implementation, and the documentation (perldoc). It sounds like your assignment (for school?) is intended to get you thinking about how the ideas behind the various kinds of formal semantics can be used to describe Perl.

Operational semantics should be the easiest---describe how various constructs are interpreted by perl the program.

Axiomatic semantics should be demonstrable for e.g. assignment statements and flow-control constructs. This is probably best done by viewing constructs as Hoare-style predicate transformers from pre-conditions to post-conditions (and describing invariants).

Denotational semantics may be a little trickier, because as far as I can tell, those behind Perl had very little experience in the design or use of denotational semantics for languages. I don't have many good hints here; of course the idea is to define some mappings between program constructs and a mathematical formalism---something like a lambda calculus. In fact, given that Perl is in some ways a functional language (i.e. it has closures, anonymous functions, and both upward and downward funargs), this may be your best bet.

Derrick Turk
A: 

thanku all for your help.@Derrick Turk: ur explanation is just wat i was looking for.i got a clear idea about it and now know wat to do exactly with the implementation part of it. @Chas. Owens: thanx for thos links dey helped me alot.

clb