rogerburtonpatel / vml

Code and proofs for Verse-ML, an equation-style sub-ml language. Part of an undergraduate senior thesis with Norman Ramsey, Milod Kazerounian, and Roger Burtonpatel.
5 stars 0 forks source link

Nr Meeting Agenda 4/18 #43

Closed rogerburtonpatel closed 1 month ago

rogerburtonpatel commented 2 months ago
  1. Milod’s comment: Abstract: Overall good and to the point. I would only alter the final two sentences to make it clear that these are your contributions, rather than facts established by someone else. Consider changing to: "I formalize Verse as V-, a core language that uses Verse’s equations with some restrictions, and show that it can be compiled to a decision tree. I also show that V- subsumes P+, a core language with three popular extensions to pattern matching." 
 May conflict with Landes's advice on the abstract. Let's discuss.

Resolution: "I propose:"

  1. Talk about “lines 985 to 1025: this page isn't working for me. Let's talk about it tomorrow.”

Both languages restrict choice. V- restricts it more. <- Put in discussion.

NICE PROPERTIES:

For (3); s/user-defined types/constructed data

Nr's notes:

When talking about implementation of P+, note that side conditions make Nice Property 5 an np-hard problem.

"When you focus on the extensions: less code duplication, laws look more like what you want to write at the board, exhaustiveness analysis is technical but important. Other properties can be split off into another group."

Observers section: example first, properties second.

2 GROUPS: Why better than observers? And: the code is more like what we're thinking about. These we'll improve through extensions and wish to preserve in a new proposal.

We want code to look better: laws and duplicate. In order to get that, we compromise exhaustiveness analysis. V- is comparable to P+: makes the same compromises.

NR claims this is 2 points:

  1. V- is a viable alternative to P+ in terms of code we want to write

  2. V- is a viable alternative to P+ in terms of efficiency

  3. For our meeting tomorrow, it would be good if you had a sample of what you might say in the paper—and if you like we can work out some of the details of an approach.

    \DTran\ then repeatedly chooses a guarded expression $G$ and attempts the following:

    \begin{enumerate} \item If there are no guards, insert a \it{match} node with the right-hand side of $G$.

    \item Choose an equation in $G$ of the form $x = e$ s.t. $x$ is not \it{known} and all names in $e$ are \it{known}.

    \item If one is found, generate a \it{let} node, make $x$ known, prune
    the \it{if-fi} of all duplicate instances of that $x = e$, and invoke
    \DTran\ again. 
    
    \item If none is found, choose an equation in $G$ of the form 

    $x = K \dots$ s.t. $x$ is \it{known}. \item If one is found, use it to generate a \it{test} node, building each subtree of the \it{test} by pruning all branches in \it{all} guarded expressions of the \it{if-fi} in which $x = e$ and $e \neq K \dots$ and invoking \DTran\ on the remaining ones with a context where $x$ is known. The algorithm builds the default tree of the \it{test} by finding it in the \it{if-fi} or assembling one that fails at runtime.

    \item If no equation of the form \it{x = K \dots} is found, try to 
    find a condition $e$ s.t. all names in $e$ are known. 
    
    \item If one is found, use it to generate a \it{let}-\it{if-then-else}
    pair, pruning each subtree of $e$. 
    
    \item If no condition $e$ is found, try to find an equation $x = e$ s.t.
    both $x$ and all names in $e$ are \it{known}.

    \item If one is found, generate an ifeq/x node and prune subtrees. I will explain this in our meeting.

    \item If none is found, the \it{if-fi} cannot be compiled to a decision
    tree. The algorithm halts with an error. 

    \end{enumerate}

rogerburtonpatel commented 1 month ago

This has been addressed.