What you do think about this way to model laws?

This is a general Prolog question. Any opinions about the direction I’m taking this? My rough idea:

I want the code to:

  • Answer questions about which laws have been broken based on facts asserted.
  • List the elements of any particular law.
  • To show why a particular crime isn’t present.


My first pass looks like this:

 * Crimes within the jurisdiction of the International Criminal Court.
 * https://world.public.law/rome_statute/article_5_crimes_within_the_jurisdiction_of_the_court

 * A first, simple attempt at Protected Persons under
 * the Geneva Conventions of 1949.
protected_by_geneva_convention(P) :- civilian(P).
protected_by_geneva_convention(P) :- prisoner_of_war(P).
protected_by_geneva_convention(P) :- medical_personnel(P).
protected_by_geneva_convention(P) :- religious_personnel(P).

 * D = Defendant
 * V = Victim

 * Genocide
 * https://world.public.law/rome_statute/article_6_genocide
criminal_liability(genocide, Statute, D, V) :-
	elements(Statute, D, V).

 * War crimes
 * https://world.public.law/rome_statute/article_8_war_crimes
criminal_liability(war_crime, Statute, D, V) :-
	international_conflict(D, V),
	elements(Statute, D, V).

elements(article_8_2_a_i, D, V) :-
	act(D, killed, V).

elements(article_8_2_a_ii, D, V) :-
	act(D, tortured, V).

This may/may not be what you seek but noting so that you can decide.

Check out the topics from


This classic article might be of use:

And I found more references here: Google Scholar

“Controlled English” is another area that might be useful:

1 Like

I would suggest to read about Bousi~Prolog, that could help with modelling such a complex domain…

1 Like

Update: A first working version for the crime of genocide

Statute: Rome Statute article 6 – Genocide

criminal_liability(genocide, Accused, Group) :-
	genocidal_intent(Accused, Group),
	genocidal_act(Accused, Group).

article_6_group(Group) :- national_group(Group).
article_6_group(Group) :- ethnic_group(Group).
article_6_group(Group) :- racial_group(Group).
article_6_group(Group) :- religious_group(Group).

genocidal_act(Accused, Group) :- act(Accused, killed, Group).
genocidal_act(Accused, Group) :- act(Accused, caused_serious_bodily_harm, Group).
genocidal_act(Accused, Group) :- act(Accused, deliberately_inflicted_conditions, Group).
genocidal_act(Accused, Group) :- act(Accused, imposed_measures_to_prevent_births, Group).
genocidal_act(Accused, Group) :- act(Accused, forcibly_transferred_children, Group).

It’s a simple statute, as far they go. And so it was very easy to translate to Prolog.

1 Like

i think what may be tricky is making sure that the implications of your knowledge base are what you expect them to be once your knowledge base is fairly large. i think we implicitly assume a lot of things in between facts which have to be made explicit in a logical knowledge base.

further, the user has to be very familiar with the knowledge base in order to ask detailed questions directly in prolog. that is, they have to know the predicates, what thet imply and so on. otherwise, you’ll need some kind of an “expert system” user interface that guides the user’s query building.

1 Like

I think an explanation mechanism is useful (see “meta interpreters”).
The old syllog system (by Adrian Walker) uses a controlled vocabulary approach, has an explanation mechanism, and can do stratification,

I’ll definitely have some kind of UI in front of this: either a chat bot or more traditional web ui that allows a click/drag interaction.

It may be possible to intermediate your system with an LLM both for the querying and the response. I.e. ask in plain text, LLM translates to Prolog, and then translates result back to plain text.

I use ChatGPT almost every day for one thing or another. I haven’t had much luck with it for Prolog, but maybe it just needs massaging or you’re more apt at prompting it than I am.

1 Like