formal-semantics

formal-semantics - In particular, demonstrate that your...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Assignment #13 CSC301 – Fall 2010 -- Due Monday, 11/22, in Class Given the operational semantics and the natural semantics for language ONE in the book (Chap 23, see lecture notes for the rules without the typos), add subtraction to the language (that is, add subtraction to the grammar given on page 498) and then extend both the operational and the natural semantics with rules for subtraction. Use the binary term ‘minus’ as your abstract syntax representation. Demonstrate that both of your semantic definitions compute correct values for subtraction.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: In particular, demonstrate that your semantics compute the correct values for the following terms: 1. 2-1 2. 3*2-3 3. 3*(2-3) Hand in your extended grammar, the semantic rules given in Prolog, and the natural semantics. In addition, hand in the computations in Prolog and in the natural semantics that demonstrate your rules for the three problems above. Hint : You will need to transform the terms in the above problems into abstract syntax trees first. The abstract syntax tree for problem 1 above should read minus(const(2),const(1)) ....
View Full Document

Ask a homework question - tutors are online