As an aside the difference between murder and manslaughter is in the intent of the perpetrator. Murder is typically when you intended for the outcome to be death (and is additionally divided into whether or not it was premeditated/planned).
Manslaughter is reserved for when there was not intent to kill, but your actions caused a death.
Err, having written that out I now guess there is also some social component to it: you may still be received at a party if convicted of manslaughter but maybe not murder so we need different words to describe the act for purposes outside of the legal system
We even draw the distinction between degrees of murder since sitting down and planning a murder in cold blood (murder in the first degree) is far different than a road rage incident with a gun (murder 2) which is different still than a shove in a bar where someone falls down and hits their head and dies (manslaughter). Hell, some places even distinguish between voluntary and involuntary manslaughter.
The point is that all these words have meaning, and we deeply care about the nuance.
To circle back to the "if law were programming" idea, I think of all the nuances you cited as belonging in any "then" clauses, not the "if" clauses of legalese
if made_dead:
# determine punishment
if premeditated:
...
elif road_rage and crime_scene.contains({"gun"}):
# a kind of very, very slightly premeditation
...
else:
# and here one can get into [in]voluntary made dead
because (as I ham-fistedly tried to get at) there are very, very few cases in the law where one human can legally end the life of another human so it's silly to try and split hairs about "why" except for how much revenge(?) society wants to extract from them for the wrongdoingAll this was inscrutable before LLMs, but LLMs bring their own challenges: to summarize something in plain text, is it using a deep graph of definitions that are sourced and verifiable, or hallucinating their existence? IMO architectures as in https://arxiv.org/html/2410.04949v1 and https://arxiv.org/html/2409.13252v1 are useful; one uses LLMs to create local knowledge graphs and integrate them, then translates natural language queries into (successive) graph queries or graph-based RAG approaches. Things are still evolving in real time here, and IMO we've only scratched the surface of what's possible.
You want to administer nuclear weapons, the U.S. military and toxic-waste rules based on a high-school freshman’s knowledge of the world?
I am 100% open to the fact that it may not be possible to do this, since nat-lang is its own special little thing, and trying to apply fixes to it may be nonsensical themselves
The word subroutines would be cross-references to potentially more complex concepts akin to "one cannot end life (§3.14.159) unless working (§8.6.753) in a job (§127.0.1) that allows State violence" where the boundaries of what this legislation cares about 'ending life,' the boundaries around 'working,' the boundaries of a 'job' would then be composed into 'citizen cannot kill other citizen'.
I always got the impression that the nuance between murder and manslaughter wasn't in their degree of unlawfulness but rather in their sentencing, but I am deeply thankful that I haven't needed to know