Skip to content

Working session: read the signature and the rule

Search gave an address — the predicate feeding_break_too_short in the Labour Code package. Before asking, two things are needed: how the predicate is built, and which facts will make it fire. The first is law_packages, the second is law_rules.

law_packages with a package name and a substring filter returns only matching signatures, not the whole act:

{ "package": "kz-labour-code", "query": "feeding" }

The answer has five signatures with labels, among them ours:

feeding_break_too_short(employee: Employee, employer: Employer)
— «перерыв для кормления ребёнка короче установленного минимума»
child_feeding_break_minutes(employee: Employee, employer: Employer, minutes: Integer)
— «продолжительность каждого дополнительного перерыва для кормления ребёнка, в минутах»
children_under_eighteen_months(employee: Employee, count: Integer)
— «число детей работника, дающих право на перерывы для кормления»

The signature says what to substitute: the first predicate has two arguments, both entities, employee and employer. You give entity names yourself, in ordinary words: “Aigul”, “Employer”. A number in an entity position is a call error, not an entity with that name; an integer in an Integer position is a number.

Beside the signatures the answer carries three more things that will be useful:

  • askable — which of the found predicates can be asked directly; the others are facts that are submitted, not asked;
  • temporal.legalTimeDefault and calendarCoverage — default legal date and the years for which an official calendar exists;
  • metadata — status of the act, publisher, where the text was taken from.

The package heading carries the word EXECUTABLE with a counter — a measure of formalization depth. That matters more than it looks: “the norm is not in the model” and “the law is silent” are different answers, and depth says how likely the first is.

law_rules with a predicate name returns the rules that derive it, in verbalized form:

{ "predicate": "feeding_break_too_short" }
Статья 82 пункт 3 подпункт 1). Имеющим одного ребёнка — каждый перерыв не менее тридцати минут
Для Работник Р; Работодатель Р2; целого числа Ц; целого числа Ц2.
Всегда, если установлено, что «продолжительность каждого дополнительного перерыва
для кормления ребёнка, в минутах» (employee: Р, employer: Р2, minutes: Ц)
и установлено, что «число детей работника, дающих право на перерывы для кормления»
(employee: Р, count: Ц2) и Ц2 равно «1» и Ц меньше «30»,
то «перерыв для кормления ребёнка короче установленного минимума» (employee: Р, employer: Р2).

The second rule is the same for two or more children and an hour. Each has a strength (strict, no exceptions), an article anchor, and an identifier.

The most useful field of the answer is factsTemplate: the list of facts the rule reads, with argument types:

[{ "predicate": "child_feeding_break_minutes", "argsTemplate": ["employee: Employee", "employer: Employer", "minutes: Integer"] },
{ "predicate": "children_under_eighteen_months", "argsTemplate": ["employee: Employee", "count: Integer"] }]

That is the answer to “what to submit”. Do not guess facts from the sense: the rule may read something other than what seems natural. Here, for example, it reads the number of children, not the child’s age: age in this formalization is checked by another rule, and its result is submitted as a number.

Verbalization is not a paraphrase of the article. It is a reading of the rule: “always” is the strength strict, “if it is established” means the premise must be an established fact, not merely unrefuted. That distinction will surface on the next page, when we ask the question with no facts.

Now we have the predicate name, its arguments, and two facts it needs. Ask the question.

Documentation for Arxo. Writings — blog.arxo.io.

Anonymous visit counts on stats.arxo.io, no cookies.