Describe how you could implement these rules so that the simplifications are made only when the program’s semantics is correctly preserved

Suppose that the following rules are proposed as possible optimizations to be implemented in your compiler. expression simplifies to expression (fst e, snd e) → e fst (e2, e3) → e1 snd (e2, e3) → e2 Describe how you could implement these rules so that the simplifications are made only when the program’s semantics is correctly preserved. [5 marks] 5 (TURN OVER) CST.2017.3.6 9 Concepts in Programming Languages (a) Explain what is meant by a monad in a programming language, giving the two fundamental operations of a monad along with their types. Note:At the point when will there be an exhibition benefit in booking two non-intelligent applications on the equivalent hyperthreaded processor center so they run in equal as opposed to running consecutively, one work one after the other? fferent conforming compilers on different machines. { return a / b; }