## Programming Languages Mentoring Workshop (PLMW)

Good morning from POPL 2015 in Mumbai, India.

Throughout this blog, * denotes a notation heavy segment in the talk. These can be difficult to summaries quickly without typesetting. See the authors paper online for now and I'll try to find speaker slides at the later time.

## PLMW Organizers - Intro

This is the 4rd PLMW workshop and we are very pleased to see you all. Mentoring workshops are now being much more common. This year we have funded 75 students. We would like the thank the speakers, sponsors and organisers (including Annabel :)

Video from Derek

POPL proceedings are now available online

## Nate Foster (Cornell University) - You and Your Graduate Research

### Prelude:

- doing a PhD is not easy, many do not finish. This is a survivors story

- some of my comments many be US specific

- acknowledgements (including Jorge Cham from PhD comics :))

### Motivation

THis is useful from everyone, not just undergraduates.

**Why you shouldn't do it?**

- money: nick shows a graph of salaries in university, football coaching is clearly the right way to go for a big salary.

- start-ups: Tech start-ups are now a top topic, Oculus VR example and you don't need a PhD for this

- respect: Education is highly valued and there's respect from degrees, but no one will call you doctor exact your mom.

- to stay in school: Undergraduate was fun so lets stay in school, a PhD program is totally different.

- being a professor: Let all become a professor, demonstration of the numbers of academics verse other careers

**Why you should?**

- opens opportunities

- cool jobs in industry: leadership, work on cool problems, you can work on large systems and with real users

- freedom: applies on any level, freedom to choose interesting problems, opportunities to work on the big problems

### What is a PhD?

Comparing degrees at different levels:

- high school: basics for life

- undergrad: broad knowledge in a field

- professional: advanced knowledge and practical skills

- PhD: advanced knowledge and a research contribution.

PhD is open edge

PhD is a transformation - we start with intelligent people who aren't researchers. Its a apprentice based scheme to being a researcher. Its not an easy or painless process.

### PhD Success

**pick an institution**

The community that your in will shape your work,

Very important factors include advisor, opportunities and peers. Typically less important factors are finances, institution and location.

**Dive into Research**

Don't be distracted by other things e.g. classes and teaching

Pick great problems

"It is better to do the right problem the wrong way than the wrong problem the right way" - Hamming

**Stay Engaged**

Working with others means it easier, as you can motivate each other.

Know when its time to switch topics - good research are versatile and able to switch quickly

Independence - you need to know when the time is right to go rogue and ignore your adviser

Reaching escape velocity to graduate

## Peter Müller (ETH Zürich) - Building automatic program verifiers

verification: Given a program P and a specification S, prove that all execution of P satisfies S

automatic verification: Develop an algorithm that decide whether P satisfies S

We can't prove halting => we are finished :)

Lets start again ...

Peter demonstrates of verification tool called Viper, using the typical account balance and transfer example. The verifier gives two error, we add preconditions and the verifier successes. We then use the verifier for thread safety, again fixing a concurrency bug with locking.

Automatic verification is not b/w. We can have semi-automatic verification: we can guide the verifier. The complexity of the code varies greatly, most success in the area focuses on a small area. We build verifiers from weaker guarantees. Verification can working with modularity (or maybe it will not). Varying complexity of properties.

### 7 Stage process

**Define the research goals**

What is the state of the art?

Find examples the area in the problem space that is not currently handled (well) by current verifiers.

**Find Reasoning Principle**

How to explain the correctness of the code to a friend? For the loop, we would use a loop invariant.

This is very different to techniques like model checking, I wouldn't say to friend "I have checked 15 billion possible evaluation paths and are all valid".

**Break Down Arguments**

Decompose the correctness argument: what do I need to prove for each program and what can I reuse between programs. How can I modularise the program.

**Design Specification Language**

Designing a language to express intended behaviour, we must know who the user will be and their level of experience. Find the right compromise between expressibility and simplicity, that is right for the intended audience.

**Design Program Logic**

Determine which properties need to be checked and which properties may be assumed.

**Automate Proof Search**

Utilize existing infrastructure like SAT and SMT solvers. Develop decision procedures for aspects not already covered by existing infrastructure.

**Evaluate the Solution**

Firstly an experimental evaluation, does the solution work on the example code you were executing. Then he meta-theory like the soundness proof.

**Research Direction**

Either develop now technical for new languages and feature (e.g. the recent interest in event-bases programming due to android.) or work in general infrastructure for utilise in many areas.

## Frank Pfenning (Carnegie Mellon University) - Proof theory and its role in programming language research

I will show you why every PL researcher needs a bit of proof theory.

How do we write correct programs ?

We don't :)

In practice, programming and informal reasoning go hand in hand, we use mental logical assertions, e.g. after calling sort the list is sorted. It's vital to decompose the problem into part so we can reason locally.

We need to develop programming language with the logic of the programmer in mind. Think about your least favourite programming language and why the operational or logical model of the languages doesn't agree with you. Reasoning is an integral part of programming. We need to co-design the language and logic for reasoning about it.

Logic is computation so the key is to design coherent logical and operations semantics.

**Examples:**

Computation first...

- runtime code generation => IS4

- partial eval => temporal logic

- dead code ele => model logic

- distribution computation => IS5

- message-passing

- concurrency => linear logic

- generic effects => lax logic

... and the logics first

- lax logic => ??

- temporal logic => ??

- epistemic logic => ??

- ordered logic => ??

**Key ingredients.**

Understand the difference between judgements and propositions. The basic style of proof systems e.g. natural deduction, sequent calculus, axiomatic proof system and binary entailment.

**Example: Hypothetical Judgement***

**Example: Runtime Code Generation**

We have the source expression at runtime. We distinguish ordinary variable which are bound to values and expression values which are bound to source code.*

## Stephanie Weirich (University of Pennsylvania) - How to write a good research paper

Stephanie is giving the popular talk "How to write a good research paper" from Simon Peyton Jones.

Start by writing the paper. It focuses us. Write a paper about any idea no matter now insignificant it seems. Then you develop the idea.

Identify your key idea, the paper main goal is to convey your idea. Be explicit about the main idea for the paper, the reviews should need to be a detective.

**The paper flow:**

- Here is a problem

- It's an interesting problem

- It's an unsolved problem

- Here is my idea

- My idea works

The introduction - describe the problem and what your paper contributes towards to problem. Don't describe the problem to broadly to quickly. It's vital to nail the exactly contributions.

The related work - it belongs after the main body of the paper, not straight after the introduction. Be nice in the related work. Be honest about the weaknesses of your approach.

Use simple, direct language, putting the reader first. Listen to readers.

## Damien Pous (CNRS, LIP, ENS Lyon) - Coinductive techniques, from automata to coalgebra

Checking language equivalence of finite automata

Demonstration of the naive algorithm to compare equivalence by walking through the stages and comparing. This algorithm is looking for bi simulation. This algorithm has quadratic complexity. Instead we can used HK (Hopcroft and Kerp) algorithm.

[I got a bit lost in the theory of coalgebras for the rest of the talk, sorry]*