smucclaw / lam4

A functional (and hopefully in the near future, solver-aided) DSL for the law
MIT License
1 stars 0 forks source link

Augment concrete syntax with (i) records, record projection and (ii) very WIP sketch of normative clauses #50

Closed ym-han closed 2 months ago

ym-han commented 2 months ago

@inariksit : Here's the grammar --- ConcreteSyntax.hs -- I had promised to send you, as preparation for experiments on 'rendering' in natural language! Note that it's not currently in sync with the stuff in the Langium lam4-frontend -- the frontend grammar and type checker haven't yet been updated with the constructs I just added.

We can talk more later about more detailed desiderata for the rendering. My rough inclination right now would be to borrow ideas from ACE and what John Camilleri has done, except maybe tweak things to sound more like what one would see in contracts / legal texts (see Tina Stark's and Ken Adams' textbooks).

The expression language fragment of this concrete syntax is a superset of the main branch L4 syntax (i.e., the latter is a subtype of the former), so it should be easy to port over / adapt any work on rendering Lam4 concrete syntax to main-branch L4.

There also more constructs that one could add, like WHERE, but I wanted to focus on the most important / foundational constructs to begin with.

I'll also add some notes / docs explaining the 'rendering' initiative, and why we thought it'd be better to start with a 'rendering' approach, instead of a CNL that also allows for writing, in a subsequent PR.

I've also tagged kosimikus, fendor, Meng, and Martin just so they're aware of the direction we are heading in.