Many years ago I ran across Scratch and Blockly that is based on the ideas of Scratch. I used the notion of a block to manage the structures within an XBRL-based financial report.
Seems like someone else has a similar idea for legal related applications which they called Legal Blawx. This seems to be a free download on GitHub. This Ted Talk explains the ideas behind what is going on here.
To understand Blawx, I would recommended reading Blawx: Rules as Code Demonstration. Also, this YouTube video is helpful in understanding, Encoding Rocks Paper Scissors in Blawx.com.
The working proof of concept is a combination of Flora-2 (a.k.a. ErgoLight), an open source declarative logic programming language, and Blockly, a Google platform for developing visual coding environments. Blockly is a descendent of Scratch, a tool designed to teach kids how to code.
Here is more information on rules as code:
Why does this matter? Computational Professional Services. Microsoft has created something similar to Blockly called Make Code. (This is an ONLINE version of Make Code that you can use.) Imagine a logic driven interface, driven by metalogic and a metamodel. See this. See this.