(have degrees in software engineering & law, have during law school reviewed much of the existing literature in this field from several societies/journals, of which one of my professors was a prominent contributor; there has been much published on this type of stuff, and none of it is deemed (even by the people working on it) remotely feasible for implementation or actual use.)
Start searching e.g. by reading the publications of http://jurix.nl and the literature referenced therein; or google scholar'ing on 'legal ontologies' and going from there.
https://computationallegalstudies.com is the blog of law professor Dean Katz, and will probably be of considerable interest to you.
Human judgement turns out to be pretty important in deciding whether or not something is a crime. That judgement is influenced by argument, guided by precedent, and reviewable by higher authorities, but it is ultimately judgement. It's somewhere between very, very hard and impossible to write laws that catch the edge cases without ensnaring innocent people or being subject to human interpretation.
Those same definitions will be used several times. Could they be extracted out? Could we have something that we're able to turn into a series of questions that a lay person could have at least a crack at? I've seen some of those done for tax law in the UK and it really simplifies things (although these are made manually).
Basically, keep humans making those decisions of what is malicious or wilful, and have the law written in such a way as to allow (but not require) a computer to take and combine those decisions.