I'm a brick-and-mortar engineer with very cursory coding experience (pseudo-code algorithms, formal logic gates in printed circuits, and Matlab/Simulink), studying to be a Civil Servant in a Romance country where the law is extremely informed by what I understand is the Positivist mindset - tries to create a closed logical system where all possibilities are accounted for and judges have as little leeway of interpretation as possible.
A lot of it follows patterns such as
#INCLUDE(CONSTITUTION)
#INCLUDE(PARLIAMENTARY LAWS)
#INCLUDE(GOVERNMENT REGULATIONS)
#"DEFINITIONS"
#IF A THEN
GOTO_LAW(B)
//as in, "apply article 35 line 3 paragraph b
//of section A of book 1 of law 75/2003 of
//the National Assembly", for example
ELSEIF C THEN
GOTO_LAW(D)
ELSEIF NOT(A OR C)
DO ACTION_E
ENDIF
WHILE CONDITION_F=FALSE
DO ACTION_G
ENDWHILE
etc.
In my line of work, it often happens that a lower-tier, quick-release Executive Regulation conflicts with a parliamentary Law or with the Constitution Itself. This can have dire business consequences and completely wreck a project's timeline, or budget, or sink it altogether. I understand that this is known as "judicial insecurity", and it's tangibly damaging.
It would be nice if lawgivers were kind enough to decree airtight laws that, though one might argue they are more or less just or good, at least are formally consistent with each other, telling citizens and legal persons clearly what we can and cannot do. However, it's often up to lay citizens to notice these discrepancies and take them to court for appeal. Even when the cases are very clear-cut, it can take months or years, and by the time it's done, a whole new set of quick-and-dirty executive regulations may have come out.
I'd like to know if, given the at least attempted "formal algorithm" method of the law, there wouldn't be an automated method of parsing the laws for contradictions, formal inconsistencies, endless loops, or undesirable end-states. I'd likewise appreciate an automated system for parsing out the control flows in the laws and turning them into easily-readable, standardized diagrams and charts.
Now, However, I don't know enough about programming, particularly as applied to linguistics, to figure out what the best approach would be. If y'all got any insights, I'd strongly appreciate them.
The DEFINITIONS part is particularly tricky for me, as we've got, off the top of my head:
- Agents
- Public ones: Courts, Legislative Assemblies, Administrations, Department, Position (distinct to the person of the civil servant in it), "Organ", etc. (it's quite a tangled web of affiliations and dependencies, and liable to change quickly, too).
- Private citizens, with the attributes thereof that are deemed relevant (nationals/EU citizens/foreign, major/minor, etc.)
- Private associations: Privately or Publicly owned, For Profit or Non Profit, different types of corporation...
- Actions: For example, for a person to be [appointed to an Positon], -Organ A [nominates], -Organ B [introduces in the agenda], -Organ C [votes], -Organ D [vetoes or not], -Organ E [signs the appointment], -Organ F [publishes] in the official bulletin, etc.
- Documents: just in the example above, each action or lack thereof is recorded (actively or by default) in a document (Nomination, Minutes, Appointment, the Bulletin, etc.). Then you have stuff like Registries and Records, which are compilations of documents, and need to be distinguished from the Organs named after them that are in charge of running them. You have Contracts, which are a whole Thing themselves. You have your specific Administrative Acts and your General Decrees. And, well, I can't help but think of the myriad types of documents, both formal and not, that are introduced in - discovery, was it? - as Evidence.
- Dates and timestamps are very important, as are the specific windows and deadlines to perform this or that action.
- Principles: they're very annoying because they're unevenly applied and usually not self explanatory, but they're supposed to inform all legislation and, when they're in the Consitution, they're meant to be very binding indeed. Legality, Rule of Law, State of Law, Non-Arbitrariness, Objectivity, Impartiality, Transparency, Non-Retroactiveness, General Interest, Cooperation, Coordination...
- It's possible to go to the Doctrine (i.e., the opinions of Respected Legal Scholars) or to Case Law (which tend to rule on ambiguities of this type) to construct something resembling a useful formal definition, but it's usually very difficult to avoid a degree of "fuzziness" and "gradient" in the concept.
- As such, my impression is that any formal tests that one could devise to make sure the laws apply those principles would fall under the header of operationalization, i.e. answering a difficult question with a similar, much simpler one.
- The example I was given in Philosophy of Science class at Uni was: "How much do you love your wife?" vs. "How high a voltage are you willing to be shocked with in order to guarantee that she herself does not get shocked?"
- Likewise, "is this law impartial" could be turned into "in practice, what demographics are disproportionately favored by it and what aren't", although that requires going outside of the formal confines of the law. There's likely a way to formally test if, in theory, the law is impartial, but I can't think of one right now.
- Similarly, the concept of "General Interest" is quite problematic - a huge collection of subjective interests that seems incredibly hard to even know objectively, let alone turn into a set of quantitative criteria, or legislate for without biases or hidden assumptions, - and yet "the Administration serves the General Interest Objectively and Impartially" is an actual article of Law that is in effect and which you could refer to in court when appealing an administrative regulation or act that you have evidence serves Special Interests, is Subjective, or favors certain parties over others.
I've been circling the problem, reading some law, attempting a chart and a pseudo-code, going to practical cases, reading some theory on the background thereof, learning about different coding languages and practicing simple exercises just to get the hang of them, etc. I'm slowly growing familiar with declarative, imperative, object-oriented, etc languages, as well as Controlled Natural Languages and attempts to make programming easy to parse for people and human language easy to parse for machine. I'm finding out about programs and AIs that are designed to parse language, and about statistical methods to hermeneutics and data analysis.
It's been quite haphazard and unstructured, and I feel like I may be wasting my time blindly touching an elephant's trunk and trying to figure out what sort of snake it is. But I'm afraid to raise my voice, explaining what I'm doing and ask, "am I doing this right" and of either being ignored or being told to ask a more specific and well-researched question. I'd really appreciate some guidance, though.
I guess, for now, I'd be content with tips on how to approach the following problems, in order of priority:
- automating the representation of laws as control flow charts
- automating the discovery of
- undesirable loops and end-states in said flow charts
- fringe cases that are pedagogically optimal for explaining the nuts and bolts of the law to people learning it
- ambiguous language: when a word means different things depending on which "semantic field" of law we're in - for example, "convention" can mean very different kinds of agreements in Civil Law, Administrative Law dealing with private entities, Administrative law dealing with different tiers of the Administration, and International Law, just to name a few.
- formal contradictions between laws of equal and different tiers
That would be a good start - just a formal comprehension and testing of the law.
Other than that, I'm aware that LawTech firms are developing some truly interesting applications on a number of subjects, with particular attention paid to contract drafting and enforcement, and the automation thereof, as well as to the prediction of outcomes in lawsuits based on case analytics. I'm not, however, aware of the theoretical and skillset edifice upon which this kind of work is build - but it interests me a great deal. In fact, I'm finding Law so fascinating and vitally important that I'm actually considering getting a Law degree myself - I understand that STEM-trained folks are actually rather welcome in Law Schools? I'd strongly appreciate any guidance on how to build my knowledge and skills base to begin to be able to grapple with such problems - and, eventually, if I'm any good at it, offer useful billable expertise that clients would purchase, of course.