There was a science fiction novel from back in the 70’s by Lloyd Biggle Jr. where trial lawyers loaded legal references into a judicial computer and out popped the verdict. Monument, I think it was called. Good book IIRC - peaceful natives trying to protect their planet from exploitation, guided by a plan left by a crashed human space traveler. The legal stuff was crucial to the plot.
Sounds like the plot from AVATAR (AKA Dances With Smurfs)...............