Professional Documents
Culture Documents
BN A As Logic Program
BN A As Logic Program
There are essentially two kinds of law, case law, de- the accuracy of the implementation and makes the
termined by earlier court decisions, and statutes, de- implementation easier to maintain as the legislation
termined by legislation. Substantial amounts of stat- changes and as case law evolves to augment the
utory law are basically definitional in nature and legislation.
attempt to define more or less precisely some legal Our implementation of the British Nationality Act
relationship or concept. The British Nationality Act 1981 was undertaken as an experiment to test the
1981 [ZO] defines Elritish citizenship and is a good suitability of Prolog logic for expressing and applying
example of statutory law. The act embodies all the legislation. The British Nationality Act 1981 was
characteristics of statutes in ,general: syntactic com- chosen for this experiment for a number of reasons.
plexity, vagueness, and reference to previously en- At the time it was first proposed, the act was a con-
acted legislation. troversial piece of legislation that introduced several
In the course of this article, we will describe how new classes of British citizenship. We hoped that
the text of a large part of the British Nationality Act formalization of the various definitions might illumi-
1981 was translated into a simple form of logic, and nate some of the issues causing the controversy.
we will examine some possible applications of this More importantly, the British Nationality Act is rela-
translation. tively self-contained, and free, for the most part, of
The form of logic used is that on which the pro- many complicating factors that make the problem of
gramming language Prolog is based. Later in the arti- simulating legal reasoning so much more difficult.
cle, we will describe how our translation of the act Furthermore, at the time of our original implemen-
can be executed as a program by an augmented tation (summer 1983) the act was free of the compli-
Prolog system, so that consequences of the act can cating influence of case law.
be determined mechanically. A complication that we anticipated was the pres-
Although Prolog logic is severely restricted, it ence of vagueness. The act contains such vague
proved to be sufficiently high level so that our im- phrases as “being a good character,” “having reason-
plementation could resemble the style and structure able excuse,” and “having sufficient knowledge of
of the actual text of the act. Such a resemblance is English.” These concepts are not defined in the act
important because it helps increase confidence in and occur only at the lowest level of detail. At
This work was supported by the Science and Engineering Research Council. higher levels, the question of whether a person is a
0 1986 ACM OOOl-0782/86,/0300-0370 75c British citizen depends primarily on concrete, easily
understood concepts such as the person’s time and conditions within individual rules. Relatively little
place of birth, and the citizenship and place of effort was put into adjusting these to improve the
settlement of the parents. In order to determine interaction.
whether an individual is a British citizen, the higher In theory, mechanical theorem provers can derive
level defined concepts (such as “place of settlement”) arbitrary logical consequences of legislation ex-
are repeatedly replaced by lower level ones, until all pressed in logical form. In practice, sufficiently effi-
defined concepts are eventually reduced to unde- cient theorem provers exist today only for certain
fined ones. The applicability of undefined, concrete restricted forms of logic, such as that incorporated in
concepts can be established by obtaining data from Prolog. Moreover, such theorem provers behave
the user or some other source. The simplest way to most effectively when they are restricted to deter-
handle vagueness is to assume that the vague con- mining consequences of the act for individual cases.
cepts always apply and to use this assumption to Even with Prolog, however, we were able to derive a
generate qualified answers. For example, limited number of more general consequences of the
act. This ability is potentially quite important. It
Peter is a citizen,
means that an executable, logic-based representation
if he is of good character.
of rules and regulations can be used not only to
A more sophisticated approach might combine this apply the rules, but to aid the process of drafting and
with the use of rules of thumb that reduce vague redrafting the rules in the first place-a point that
concepts to concrete ones, but are not guaranteed to was made by Layman Allen [l] as long ago as 1957.
cover all cases. The rules of thumb arise from the A similar observation was brought to our attention
analysis of previous cases. We deliberately avoided when we first demonstrated our implementation in
such complications and chose the simpler alterna- January 1984 to officials from the Home Office who
tive in our implementation of the act. The treatment were involved in drafting the act.
of vagueness and case law is the subject of current We believe that many of the potential advantages
investigation in our group [2, 361. of representing rules and regulations in computer-
In addition to vagueness, legislation is generally executable logical form are independent of the ac-
thought to contain both imprecision and ambiguity. tual use of computers, Representation in logical form
We will later discuss some examples of imprecision helps to identify and eliminate unintended ambigu-
(such as the lack of any reference to the time at ity and imprecision. It helps clarify and simplify the
which an individual actually becomes a British citi- natural language statement of the rules themselves.
zen) that came up during the course of our imple- It can also help to derive logical consequences of the
mentation. In fact, we found fewer such examples rules and therefore test them before they are put
than we originally expected. In practice, where im- into force-again, points that were also made
precision or ambiguity did exist, it was usually pos- by Allen [l].
sible to identify the intended interpretation with lit- We believe that the formalization of legislation
tle difficulty. and legal reasoning offers potential contributions to
It was never our intention to develop the imple- computing technology itself. It should help to dis-
mentation of the act into a fully functional system. criminate, better than other applications, between
Consequently, we have subjected it to only a limited different knowledge representation formalisms and
number of test applications, primarily to test the citi- problem-solving schemes in artificial intelligence.
zenship of various real and hypothetical individuals. Moreover, the rules and regulations that govern the
We discovered, somewhat to our surprise, that our management of institutions and organizations have
“declarative” representation of the act, which places exactly the same character as legal provisions. This
primary emphasis on resemblance to the original suggests, therefore, an unconventional approach to
form of the legislation and very little emphasis on the construction of software for data-processing ap-
efficiency, actually performed acceptably well in plications. A payroll system, for instance, could be
practice. based directly on tax and sick-pay legislation, could
Data needed for an individual case are obtained include a representation of the company pension
interactively by using an expert-system shell, APES scheme, the rules that govern holiday allocation,
[18, 191, implemented in micro-Prolog [a]. APES also and promotion regulations. We have already con-
provides explanations when requested by the user. structed a number of experimental systems dealing
The quality of this interactive dialogue is sensitive with some of these topics.
to the order in which the different rules for acquir- Finally, we should stress once again that we have
ing citizenship are written, and to the order of the not addressed the broad and much more difficult
problem of simulating legal reasoning. Rather, we l.-(l) A person born in the United Kingdom after com-
have concentrated on the limited objective of imple- mencement shall be a British citizen if at the time
menting rules and regulations with the purpose of of birth his father or mother is
applying them mechanically to individual cases. The (a) a British citizen; or
British Nationality Act 1981 was chosen because it (b) settled in the United Kingdom.
best facilitated the accomplishment of this more The act states that “after commencement” means
limited objective. It is an application for which after or on the date on which the act comes into
Prolog, because of its foundation in logic, proved to force.
be particularly well suited. However, we do not wish As a first approximation, l.-(l)(a) can be repre-
to imply that no other computer-executable formal- sented by the rule
ism would be capable of achieving similar results.
In the remainder of the article, we illustrate our x is a British citizen
if x was born in the U.K.
approach by showing how Prolog might be used to
and x was born on date y
represent the very first clause of the act, and then
and y is after or on commencement
proceed to describe the general structure of the act.
To describe the methodology by which the formal- and z is a parent of x
and z is a British citizen on date y
ization was constructed, we examine the first three
clauses of the act in greater detail, discuss some ap- Here x, y, and z are variables, which can have any
plications of the formalization, and detail some of values. For example, the common knowledge that a
the logical difficulties we encountered. Finally, we parent is either a-father or a mother can itself be
compare and contrast such formalization of legisla- expressed by two rules:
tion with expert systems and with more conven-
z is a parent of x if z is mother of X
tional software techniques, and indicate how our
z is a parent of x if z is father of X
work relates to other approaches to the computer
assistance of legal reasoning. It is important to note that variables in different
In writing this article, we have assumed no pre- rules are distinct even if they look the same.
vious knowledge of law, logic, or Prolog. The next Facts such as
section introduces the necessary background to
Peter was born in the U.K.
Prolog.
William is father of Peter
Acquisition
of
British
CitizenshiD
by by by at by by
birth adoption descent commencement registration naturalization
Shown is an and/or graph representation of the top level of this part of the act, it is possible to acquire British citizenship
acquisition of British citizenship in Part 1 of the act. Within by six different routes.
Acquisition of
British citizenship
,/c$< id;
An and/or graph representation of the top level of acquisition vided into two cases, depending on whether or not the indi-
of British citizenship by birth. This section of the act is di- vidual was found abandoned as a newborn infant.
We can deal with both shortcomings at once by should therefore conclude that such an abandoned
changing the conclusions of rules l.-(l) and l.-(Z) to infant becomes a British citizen at the time of his or
her birth, since that is what we have assumed for
“X acquires British citizenship on
Section l.-(l).
date y by sect. 1.1" and
This is, however, problematic-we cannot expect
"x acquires British citizenship on
that the time of birth of an abandoned infant will be
date y by sect. 1.2."
known exactlv. It is much simuler to assume that an
Sections l.-(l) and l.-(Z) can then be represented by abandoned infant becomes a citizen at the time he
the rules or she is found. This is a reasonable approximation,
particularly since an abandoned newborn infant
x acquires British citizenship on
could not be discovered very long after the time of
date y by sect. 1.1
his or her birth. On the other hand, it would also be
if x was born in the U.K.
very easy to change our formalization of I.-(Z) to
and x was born on date y
cohclude that the individual acquires citizenship at
and y is after or on commencement
the time of birth.
and x has a parent who qualifies
The modification of the rules for l.-(l) and I.-@) in
under 1.1 on date y
the light of 1.43) illustrates the process of progres-
x acquires British citizenship on
sively refining the formalization by trial and error.
date y by sect. 1.2
In addition to adding extra parameters, as described
if x was found as a newborn infant
above, the necessary modifications are sometimes
abandoned in the U.K.
achieved by adding more rules or conditions to the
and x was found on date y
definition of a concept formalized earlier. For exam-
and y is after or on commencement
ple, it turns out that the earlier formalization of
and not[x was not born in the U.K.
after or on commencement] "x has a parent who qualifies
and not[x was not born to a parent under 1.1 on date y"
who qualifies under 1.1
is an oversimplification. Section 48 of the act pro-
at time of birth]
vides for the case of posthumous children. Under
The possession of British citizenship can be re- certain circumstances, a parent of a child qualifies
lated to its acquisition by the following rule: for 1.1 even if that parent dies before the child is
born. The effect of Section 48 is straightforwardly
x is a British citizen on
incorporated, by adding more rules to the earlier
date y by sect. z
formalization to cover the case of posthumous
if x is alive on y
children.
and x acquires British citizenship
In certain cases, incorporating later sections of the
on date yl by sect. z
act requires a more drastic restructuring of the for-
and y is after or on yl
malization. For example, Section 50.-(g) specifies
and not[x ceases to be a British
that a man is the “father” of only his legitimate chil-
citizen on date y2 and
dren, whereas a woman is the “mother” of all her
y2 is between yl and y]
children, legitimate or not. Section 50.-(g) requires
A person can cease to be a citizen by renunciation or only a minor adjustment of the existing rules. Sec-
by being deprived of citizenship. The condition tion 47, however, further complicates matters by
allowing illegitimate children to become legitimate
“x is alive on y”
by the subsequent marriage of their parents. Section
ensures that a person ceases to be a citizen at death. 47, therefore, suggests that what is important in the
Notice that this formalization of Sections l.-(l) and act is not that
1.42) makes the assumption, not explicitly stated in
"x is a parent of y"
the act, that an individual who acquires citizenship
by l.-(l) does so at birth, and one who acquires but rather that
citizenship by 1.42) does so at time of discovery.
"x is a parent of y on date z."
This assumption means that the formalization of
I.-(Z), in particular, is only an approximation to the This change in turn requires a modification of all
act. The act states that an abandoned infant, under rules that include the notion of “parent” in their
the appropriate circumstances, should be treated as conditions.
if he or she satisfied the conditions for l.-(l). We If we were writing a program, such formalization
by trial and error would be regarded as bad pro- there is no correspondingly rigorous way to justify
gramming methodology [lo]. Good methodology con- the axioms themselves. The formulation of such ax-
sists of rigorously deriving correct progratns from ioms must inevitably be a trial-and-error process.
correct program specifications. It can be argued, The philosopher Imre Lakatos has referred to this as
however, that the formalization of legislation is the “quasi-empirical” nature of mathematics [27].
closer to program specification or even td systems
analysis than it is to programming. There is an anal- Ai’PLICATIONS OF THE FORMALIZATiON
ogy here with axiomatic systems in mathematics. Because the formalization of the British Nationality
The formalization of legislation results in an axi- Act is an axiomatic theory, any logical consequence
omatic theory that represents the legislation; the of the axiomatization can, in theory, be derived by
derivation of programs from specifications corre- means of a complete mechanical theorem prover.
sponds to the proof of theorems from axioms. Al- Although Prolog cannot deal with arbitrary sen-
though we rightly demand that theorems be rigor- tences of logic, it is a special-purpose theoiem prover
ously derived from axioms and similarly that pro- that is very efficient for proving certain kinds of
grams be rigorously derived from specifications, simple theorems from axioms formulated as ex-
if X is father of Peter
then X is a parent of Peter
lf X is a parent of Peter
and X is a British citizen on date (3 May 1983)
then Peter has a parent
who qualifies under 1.1 on date (3 May 1983)
Peter was born in the U.K.
Pe;er was born on date (3 May 1983)
(3 May 1983) is after or on commencem&nt, so
if Peter has a parent
who qualifies under 1.1 on date (3 May 1983)
then Peter acquires British citizenship
on date (3 May 1983) by sect. 1.1
Peter is alive on (16 Jan 1984), so
if Peter acquires British citizenship
on date (3 May 1983) by sect. 1.1
and (16 Jan 1984) is after or on (3 May 1983)
and not[Peter ceases to be a British citizen on date Y
and Y is between (3 May 1983) and (16 Jan 1984)]
then Peter is a British %itizen on date (16 Jan 1984) by sect 1.1
tended Horn clauses. Because of limitations imposed required by the theorem prover. The augmented
for the sake of efficiency, however, Prolog some- Prolog system, APES, itself implemented in Prolog
times goes into infinite loops [25] and fails to prove and initially developed as an expert-system shell,
theorems that are logically implied by the axioms. generates the appropriate queries to the user. The
Nevertheless, it can still be used to prove a large answers it produces are logical consequences of the
class of theorems and can help test a set of axioms rules contained in the formalization of the act to-
by assisting in the derivation of logical conse- gether with the information obtained from the user.
quences. In addition, APES can provide explanations for both
An obvious application of the formalization of the zolry a given question is being asked and lrozo a given
act is to determine whether in a given circumstance solution has been obtained.
a particular individual is or is not a British citizen. These features are illustrated in Figure 4. where
To do so, one must have access to facts concerning user input is indicated by boldface type. To make
the individual as well as to other information not the dialogue easier to follow, the complications of
supplied by the act. A convenient way to provide posthumous and illegitimate children are omitted.
such information is to supply it dynamically as it is We have included in the program the information
I deduced
Peter 1s a British citizen on date (16 Jan 1984) by sect. 1.1
from the rule
I can show
1 Peter is alive on (16 Jan 1984)
2 Peter acquires British citizenship
on date (3 May 1983) by sect. 1.1
3 (16 Jan 1984) is after or on (3 May 1983)
4 not[Peter ceased to be a British citizen on date X
and X is between (3 May 1983) and (16 Jan 1984))
how 2
I deduced
Peter acquires Brltlsh citizenshlp
on date (3 May 1983) by sect. 1.1
from the rule
. etc
that the act came into effect on January 1, 1983. By accessing data
A consultation of the system can be invoked by For example,
asking, for example, whether a given individual
“y is a Dependent Territory”
is a British citizen by any selction of the act on some
given date. can be determined by matching the condition
Figure 4 shows bow Prolog proves theorems by against degenerate, conditionless rules that solve
reasoning backwards from conclusion to conditions. the problem without introducing further sub-
Rules of the for:m problems.
problem with this approach is the difficulty of iden- Section 11-(l) can be expressed by the rule
tifying an appropriate bottom level of primitive,
undefined concepts. In the case of the British Na- x acquires British citizenship on date
tionality Act 1981, it would be difficult to decide y by sect. 11.1
many instances where the legislation explicitly spec- “x has a parent who qualifies
ifies all the cases for which a given predicate is in- under I. 1 on date y'
tended to hold, and where the interpretation of ne-
will fail for this infant (whether we know the date of
gation as failure can safely be made. This is not the
birth or not). Consequently, the condition
case, unfortunately, with the use of negation in Sec-
tion 142) of the act, which states the following: “x was not born to a parent who
qualifies under 1.1 at time
(2) A newborn infant who, after commencement, is
found abandoned in the 1Jnited Kingdom shall, un- of birth”
less the contrary is shown, be deemed for the pur- will succeed, and the negative condition
posesof subsection (1) -
(a) to have been born in the United Kingdom “not [x was not born to a parent
after commencement, and who qualifies under 1.1 at time
(b) to have been born to a parent who at the of birth]'
time of the birth was a British citizen or
settled in the Unit’ed Kingdom. will fail. We fail to conclude that the abandoned infant
acquires citizenship by Section l-(2).
Earlier in the article, we formalized this section as This conclusion is exactly the opposite of what is
the rule intended by the act. If both parents of the infant are
x acquires British citizenship on unknown, then we cannot show that they do not
date y by sect. 1.2 satisfy the conditions specified, and we should con-
if x was found as a newborn infant clude by Section 14.2) that the infant is a British
abandoned in the U.K. citizen.
and x was found on date y The last two conditions of Section 142) seem to
and y is after or on commencement involve default reasoning of the general form
and not[x was not born in the U.K. infer P if fail to show “‘not P”
after or on commencement]
and not[x was not born to a parent combining both failure to prove and classical nega-
who qualifies under 1.1 at tion.
ti.me of birth] Negation as failure
The last two conditions of this rule contain double infer “not P” if fail to show P
negations, which would cancel each other out if is obviously similar, but easier to implement because
both were interpreted classically: we can state precisely what “fail to show” means for
not[not P] is equivalent to P. positive conditions in the context of extended Horn
clauses.
Obviously, this is not what is intended by the act. The similarity between the two default rules can
Intuitively, it seems clear that the first occurrence of often be exploited, however, to get the effect of the
“not” in both conditions should be interpreted as required default reasoning. In the present example,
negation as failure. We argue, however, that the sec- we can obtain the effect of the first default rule
ond occurrence, underlined above, should be inter-
infer P if fail to show “not P”
preted as ordinary!. classical negation.
Suppose, for example, we attempt to interpret the by using a rule of the form
second “not” in the last condition also as negation as
infer P if fail to show Q
failure by adding the Prolog rule:
where the conditions Q are equivalent to “not P” in
x was not born to a parent who
the context of the problem we are considering.
qualifies under 1.1 at
Thus, the first of the problematic conditions of
time of birth
Section l-(2)
if not [x was born on date y and
x has a parent who qualifies 'x was not born in the U.K. after or
under- 1.1 on date y] on commencement"
Putting aside the problem of determining the ex- can be replaced by
act date of birth of an abandoned infant, suppose
"x was not born in the U.K.
that we know neither the father nor the mother of a
particular abandoned infant. Then the condition or
x was not born after or on "x does not qualify under 1.1 at
commencement. V time of y's birth"
If we further assume that We can define this by writing:
"not born in the U.K." x does not qualify under 1.1 at
time of y's birth
is equivalent to
if x was not a British citizen at
“born outside the U.K." the time of y's birth
and x was not settled in the U.K. at
and that
the time of y's birth
"not born after or on commencement"
In principle, we could continue with this kind of
is equivalent to analysis, reasoning through the provisions of the act
to construct explicit definitions for the predicates
"born before commencement"
"x was not a British citizen at the
then we can replace the original condition
time of y's birth"
"not[x was not born in the U.K. after "x was not settled in the U.K. at the
or on commencement]" time of y's birth".
in the rule for Section I-(Z) by the two conditions In practice, however, we could not construct such
definitions; the act is too large, and there are too
"not[x was born outside the U.K.]"
many separate possibilities to consider for this to be
and a practical solution.
In the absence of a better general solution, we
"not[x was born before commencementlW
circumvented the problem in practice by treating
where all occurrences of “not” are now interpreted as the negative information
negation by failure.
"x was not a British citizen at the
The other condition with a double negation
time of y's birth"
I'not[x was not born to a parent "x was not settled in the U.K. at the
who qualifies under 1.1 at time time of y's birth"
of birth]"
as part of the input that is obtained by querying the
is more problematic. We can remove the second oc- user. This treatment is not entirely satisfactory, but
currence of negation from this condition by defining it does provide a reasonable solution for most practi-
cal purposes. Notice that the user is asked such
"x was not born to a parent
questions only after it is established that the new-
who qualifies under 1.1 at time
born infant was found abandoned in the United
of birth."
Kingdom, that the discovery occurred after com-
explicitly as a positive predicate: mencement, that the infant was not known to have
been born outside the United Kingdom, that the in-
x was not born to a parent
fant was not known to have been born before com-
who qualifies under 1.1
mencement, and after both parents have been iden-
at time of birth
tified. Even then, users have the option of invoking
if zl is father of x
subsidiary consultations of the system to help them
and 22 is mother of x
answer questions about citizenship and settlement of
and zl does not qualify under 1.1 at
the parents.
time of x's birth
Before briefly discussing other knowledge repre-
and 22 does not qualify under 1.1 at
sentation problems in the British Nationality Act, we
time of x's birth
must make one final remark about negation. The
This definition makes use of the assumption that an type of default reasoning that the act prescribes for
individual has two parents: a unique father and a dealing with abandoned infants is nonmonotonic [3]:
unique mother. Notice that we now establish an Conclusions made by default in the absence of infor-
abandoned infant’s citizenship immediately if either mation to the contrary may have to be withdrawn if
or both of the parents are unknown. new information is made available later. Thus, in
We now have to consider the new predicate the British Nationality Act, an abandoned child may
be a British citizen by Section l-(Z) because the discovering what it is that the person drafting the
identity of both his or her parents is unknown. Sup- condition actually intended. Assuming that this can
pose, however, that the parents are subsequently be determined, there are then several techniques
identified, and it is determined that neither was a available for implementing the required reasoning.
British citizen nor had settled in the United King- One approach is to use Prolog’s extralogical primi-
dom when the child was born. Under these circum- tives to modify the database temporarily by deleting
stances, the earlier conclusion that the child is a facts, adding other assumptions in their place, and
British citizen would have to be withdrawn. This restoring the database when the appropriate conclu-
possibility does not seem to have been anticipated sions have been derived. Although this solution
by the drafters of the act, as there is no provision works in Prolog, it does so by sacrificing the logic of
for it. the knowledge representation. A different and logi-
cally sound approach is to use an amalgamation of
OTHER PROBLEMS IN THE FORMALIZATION object language and metalanguage [4]. This uses a
In addition to its problems with negation, extended proof predicate with explicit parameters for the
Horn clause logic is not adequate for dealing with knowledge base, which can vary for different condi-
counterfactual conditionals. Such conditionals occur tions of a rule. A Prolog implementation of such an
frequently in the Elritish Nationality Act. Clause amalgamation logic has been reported by Bowen and
l&(l)(e), for example, includes in its conditions the Weinberg [5].
phrase A number of other phrases in the act seemed
problematic upon first reading, but were not so in
. . became a British citizen by descent or would have
practice. Clause s-(4), for example, states that
done so but for his having died or ceasedto be a citizen
. . [by] renunciation. If in the special circumstances of a particular casethe
Secretary of State thinks fit, he may treat subsection (2)
The treatment of such counterfactual conditions is as if the reference to twelve months were a reference to
notoriously difficult. It is not obvious what factors six years.
need to be taken into account before it can be deter-
mined that a person would have been a citizen if the From the Secretary of State’s point of view, Clause
person had not died. 344) grants permission to apply discretion in certain
It can be argued, however, that, when the drafters circumstances. For the purposes of formulating rules
used the counterfactual phrase in this clause, they dealing with the acquisition of citizenship, however,
did not intend such an open-ended analysis. The we were able to treat this kind of statement by writ-
device is used merely for convenience: The drafters ing two separate rules. One rule covered the stan-
avoid listing a complicated set of conditions explic- dard case; the other covered the discretionary case,
itly by specifying instead a modification to some with an extra condition to indicate that the rule
other part of the le,gislation. only applies if the Secretary of State decides that it
We decided to trleat counterfactual conditions by should. This treatment gives a reasonable represen-
writing additional alternative rules; one set describ- tation of the discretionary clause (for the purpose of
ing, for example, the conditions for acquisition of determining citizenship), at the cost of increasing
citizenship at commencement for individuals who the number of rules in the formalization.
were alive on that date, and another set for individ- In addition to the problems discussed above,
uals who had died before that date, but otherwise knowledge representation problems arose because of
met all the other requisite conditions before death. the large scale of the work. We have already stressed
This treatment of counterfactual conditions is ex- the trial-and-error development of our formalization.
tremely tedious. It requires a thorough analysis of When the system was in its early stages and the
the provisions of the act before the implicitly de- number of rules in the formalization was small, re-
scribed rules can be reconstructed; it also substan- structuring the rules to incorporate the effect of later
tially increases the number of rules in the formaliza- sections was relatively simple. As the formalization
tion. All of this is precisely what the person drafting developed and there were hundreds of rules and
the rule was trying to avoid by using the counter- many tens of predicates to consider, incorporating
factual phrase in th,e first place. So, although we even a minor change was not always easy. In fact,
managed to represent the effect of counterfactual whether a change was easy to incorporate or re-
conditions within extended Horn clause logic, this quired a major restructuring of the rules was largely
treatment is not entirely satisfactory. a matter of luck, usually depending on whether a
The main difficulty with counterfactual conditions convenient predicate had initially been chosen. We
of this type lies not in representing them, but in see no alternative to trial-and-error formalization, at
least when dealing with legislation already in exis- expert system, it has to be elicited from the subcon-
tence. Therefore, we are developing a programming scious of an expert. Feigenbaum and McCorduck
environment that will incorporate metalevel data [ll] refer to this knowledge elicitation problem as
“dictionaries” and special-purpose editors to assist in “the most important of the central problems of artifi-
the process. cial intelligence research” and “the critical bottle-
neck.” The knowledge elicitation problem is almost
THE STATE OF THE IMPLEMENTATION entirely absent in the formalization of legislation. By
The first four parts of the act, the definitions in Part its very nature, the law is well documented; its pro-
5, and the schedules that were needed for Parts l-4 visions are written down, and where they are not,
(approximately 50 pages of the 73-page act) were decisions in previous cases are recorded for future
translated into extended Horn clause logic during reference. Even if this documentation is not already
July and August 1983 by a student, Fariba Sadri, in a form that can be expressed directly in computer-
without any expert legal assistance. Those sections intelligible terms, it provides a convenient frame-
in Part 5 and the schedules not translated into logic work around which the knowledge elicitation pro-
consist mostly of descriptions of amendments to cess can proceed.
other acts, repeals, offenses, and proceedings related This does not mean, however, that there are no
to them, and decisions involving exercise of discre- knowledge representation problems. As previously
tion by the Secretary of State. mentioned, early versions of the formalization had
The entire system, including APES, was imple- to be refined by trial and error to incorporate the
mented in micro-Prolog. At the time formalization effects of later sections of the act. Other knowledge
was completed, only a small part of the act could be representation problems that arose in the course of
loaded, together with APES, into the small Z-80- the formalization were described earlier in this arti-
based microcomputers on which micro-Prolog was cle. These problems are much less severe than the
then available. During October and November 1983, knowledge elicitation problem in general.
most of the work on the system was concerned with The advantages claimed for expert systems are
overcoming the space limitation. As of December primarily due to the explicit representation and sep-
1983, the system ran a relatively self-contained part aration of knowledge from its manipulation by
of the act, consisting of approximately 150 rules means of deductive inference procedures. In this
dealing with the acquisition of British citizenship, respect, the use of logic for knowledge representa-
on a microcomputer with 128 kbytes of memory. tion and of deductive inference for knowledge
This small demonstration system consists of rules for processing is the purest form of expert-system tech-
the sections of Part 1 that describe the acquisition nique. Knowledge expressed in such a form
of British citizenship, rules that formalize the rele-
l is easy for both naive users and experts to under-
vant sections of Part 5 and the schedules, and rules
stand;
that express certain general knowledge (such as the
l is easy to modify (e.g., to correct errors, to en-
rule that a father or a mother is a parent, and facts
hance, and to reflect changes that occur over
about the lengths of the months). We estimate that
time);
a micro-Prolog system capable of addressing 512
l allows the inference procedure to interact natu-
kbytes of memory would be sufficient to run the
rally with the human user and to explain its con-
complete act, which contains about 500 rules. Such
clusions.
micro-Prolog systems are now available for micro-
computers and, in the form of sigma-Prolog, for a These advantages hold equally for other applica-
range of larger machines. These are recent develop- tions implemented by the same techniques, and
ments, however, and at the time of this writing, we therefore for Prolog “programs” in general-provided
have not transferred the formalization to the larger they are structured according to logic programming
systems. We have chosen instead to consolidate our principles.
experience by considering a number of other exam- Logic can also be used to formalize regulations,
ples from the legal domain, some of which are listed rules, and policies that do not have legal authority.
in the concluding section of this article. An airline company, for example, might use such
techniques to assist in drafting and applying rules
THE RELATIONSHIP WITH EXPERT SYSTEMS for refunding tickets or changing reservations. A
The formalization of legislation by means of rules bank might use them for rules about banking
has almost all the characteristics of an expert sys- charges. A customer might query such a system to
tem. It differs, however, in one important respect: obtain explanations for decisions that would other-
Before knowledge can be formalized in a classical wise be inscrutable. Such applications do not neces-
sarily qualify as expert systems, because they can be Date Place Citizenship
of of of
used to assist in the formulation and debugging of
birth birth parent
rules in situations where expertise does not yet
exist.
lowed us to implement a more substantial appli- concepts identified in the analysis phase. Indeed
cation than would have been possible if we had Stamper’s primary concern has been the develop-
had to deal with the knowledge elicitation prob- ment of the LEGOL semantic model; the implemen-
lem. tation of practical applications is a secondary
2. We have attempted to distinguish as much as objective.
possible between using logic to represent legisla- In contrast with the LEGOL methodology, we have
tion and using Prolog to implement such repre- stressed in this article the top-down, goal-directed
sentations. Our primary commitment has been development of our formalization of the British
to the use of logic, and we have used this com- Nationality Act. We adopted this approach for
mitment to propose and test various extensjons purely practical reasons. It allowed us to delay ad-
of Prolog. dressing the more complex issues of knowledge rep-
resentation until it became unavoidable to do so,
Our work on the application of logic programming and it enabled us to avoid considering how to repre-
in law began with Sergot’s investigation [35] of sent the various commonsense knowledge needed to
Stamper’s LEGOL language and its relationship with understand the legislation until we discovered what
logic programming. The aim of the LEGOL project knowledge was required.
was the development of a computer language for
representing legislation and the structure of
regulation-based organizations [38]. In LEGOL, CONCLUSION
Stamper developed a method of analysis based on a The British Nationality Act experiment has largely
semantic model that provided the basis for a com- served its purpose, at least for the time being. It has
puter language in which rules could be written to demonstrated the feasibility and promise of applying
simulate the effects of legal provisions. The language Prolog logic to a potentially large class of applica-
that emerged (in its executable versions at least) was tions dealing with the implementation of rules and
conceived as an extended relational algebra with regulations. These applications include not only
special operators for handling time [23]. Computa- cases of statutory law, such as the British Nationality
tion proceeded by executing the control structures Act 1981, but also applications normally associated
and evaluating expressions of the algebra. A pro- with advanced data processing.
gram written in the LEGOL language was built by Following our formalization of the British Nation-
combining rules using a variety of conventional pro- ality Act, a variety of smaller projects have been
gram control structures including sequencing of completed within the Logic Programming Group at
rules, if-then-else statements, and iteration [22]. Imperial College. Those incorporating realistically
Sergot showed how LEGOL rules and control sized fragments of legislation include a subset of the
structures could be reinterpreted in logic program- Immigration Act 1971 [39], regulations for govern-
ming terms. Such a translation ignores the emphasis ment grants to industry [29], and a large company’s
placed by Stamper on the importance of LEGOL’s pension regulations, with associated tax legislation
semantic model, but it does suggest a method of [6]. A formalization of Statutory Sick Pay legislation
computing with LEGOL rules that is independent of [37] has also been attempted in collaboration with
the semantic considerations. Interpretation of the group. Application of logic programming in law,
LEGOL rules as statements of logic gives a description and some of the more general problems referred to
of legislation as well as a simulation of its effects; it in this article, is discussed ip more detail in [36].
frees the LEGOL language from the need to be The British Nationality Act 1981 has also proved
embedded within an algorithmic programming lan- to be a rich source of problems for the use of logic
guage; and, by executing LEGOL rules backwards in for knowledge representation. It has highlighted
the spirit of logic programming, it allows recursion problems with negation as failure and counterfactual
to be expressed directly, a feature missing from the conditionals in particular. We believe that the for-
original LEGOL algebra. malization of legislation and the development of
The other main difference between our approach computer systems to assist with legal problem solv-
and Stamper’s is a methodological one. Representa- ing and decision making provide a rich domain for
tion of a fragment of legislation in LEGOL proceeds developing and testing artificial intelligence technol-
in two distinct steps: First, the LEGOL semantic ogy. More tentatively, the accumulated experience
model is used to analyze and identify the entities, of managing complex systems of law may teach us
concepts, and relationships present in the legislation. something about the maintenance of large bodies of
LEGOL rules are then formulated to manipulate the complex software.
Acknowledgment:;. We are grateful to Chris Moss 27. Lakatos, 1. Proofs and refutations. Br. J. Philos. Sci. 14 (1963). l-25,
120-139. 221-243. 296-342.
for suggesting the formalization of the British Na- 28. Lloyd. J.W., and Topor, R.W. Making Prolog more expressive. /. Logic
tionality Act 1081 and to Ronald Stamper and other Program. I. 3 (Oct. 1984). 225-240.
29. Lowes. D. Assistance to industry: A logical approach. MS. thesis.
members of the LEGOL project for their early inter- Dept. of Computing. Imperial College. London, 1984.
actions with ou.r work, and for their comments and 30. MacRae, C.D. User control knowledge in a tax consulting system. In
2nd Infernational Conference on Computers and Law (Houston. Tex..
their encouragement. June). 1985.
31. McCarthy. L.T. Reflections on TAXMAN: An experiment in artifi-
cial intelligence and legal reasoning. Harvard Law Rev. 90 (1977).
837-893.
REFERENCES 32. McCarthy, L.T.. and Sridharan. N.S. The representation of an evolv-
Reference [12] is not cited in text. ing system of legal concepts: I. Logical templates. In Proceedings, 3rd
1. Allen, L.E. Symbolic logic: A razor-edged tool for drafting and inter- Biennial Conference offhe Canadian Society for Compufafional Studies of
preting legal documents. Yale Law I, 66 (May 1957). 833-879. lnfelligence (Victoria. B.C.). Canadian Society for Computational
2. Bench-Cauon. T.. and Seraot. M.1. Towards a rule-based reoresenta- Studies of Intelligence, 1980. pp. 304-311.
tion of opkn texture in La<. Rep.. Dept. of Computing, Imperial 33. Meldman. J.A. A siructural model for computer-aided legal analysis.
College, London. 1965. Also presented at the 2nd International Con- Rufgers 1. Compuf. Law 6 (1977). 27-71.
ference on Computers and Law, Houston. Tex.. June 1985. 34. Schlobohm, D.A. A Prolog program which analyzes income tax is-
3 Bobrow, D.G., Ed. Non-monotonic logic. Special issue on. Altif. Infell. sues under Section 318(a) of the internal revenue code. In Computing
13 (1980). Power and Legal Reasoning, C. Walter. Ed. West, St. Paul. Minn.,
4. Bowen. K.A., and Kowalski. R.A. Amalgamating language and meta- 1985. pp. 765-815.
language in logic programming. In Logic Programming. K.L. Clark and 35. Sergot, M.J. Programming law: LEGOL as a logic programming lan-
S.A. Tarnlund. Eds. APIC Studies in Data Processing, vol. 16. Aca- guage. Rep., Dept. of Computing, Imperial Collage, London, 1980.
demic Press. New York, 1982. pp. 153-172. 38. Sergot. M.J. Representing legislation as logic programs. Rep.. Dept. of
5. Bowen. K.A., and Weinberg, T. A meta-level extension of PROLOG. Computing. Imperial College. Aug. 1985. To be published in
In Symposium on Logic Programming (Boston. Mass.). IEEE Computer Machine Infelligence 17.
Society Press, 1985, pp. 48-53. 37. Sharpe, W.P. Logic programming for the law. In Research and Dew-
6. Ghan, D. A logic based legal expert. M.S. thesis. Dept. of Computing, opmenf in Experf Systems: Proceedings of the 4th Technical Conference of
Imperial College, London. 1984. fhe British Compufer Society Specialisf Group on Experf Systems, War-
7. Clark, K.L. Negation as failure. In Logic and Data Bases, H. Callaire wick, M.A. Braines, Ed. Cambridge University Press, New York, Dec.
and J. Minker, Eds. Plenum, New York, 1978. pp. 293-322. 1985.
8. Clark, K.L., and McCabe. F.G. Micro-PROLOG: Programming in Logic. 38. Stamper, R. LEGOL: Modelling legal rules by computer. In Computer
Prentice-Hall. Englewood Cliffs, N.J.. 1984. Science and Law, B. Niblett. Ed. Cambridge University Press, New
9. de Marco, T. Strucfured Analysis and System Specific&w?. Prentice- York, 1980, pp. 45-71.
Hall, Englewood Cliffs, N.J.. 1979. 39. Suphamongkhon. K. Towards an expert system op immigration leg-
IO. Dijkstra, E.W. A Discipline of Programming. Prentice-Hall, Englewood islation. M.S. thesis, Dept. of Computing. Imperial College, London,
Cliffs, N.J.. 1976. 1984.
11. Feigenbaum, E.A.. and McCorduck, P. The Fiffh Generation. Addison- 40. Sussman. G.. Winograd. T.. and Charniak, E. Micro-Planner refer-
Wesley, Reading. Mass., 1983. ence manual (revised). A.I. Memo 203A, Artificial Intelligence Labo-
12. Fuchi. K. The direction the FGCS project will take. New Generation ratory. M.I.T.. Cambridge. Mass.. 1971.
Comput. I (1983). 3-9. 41. Szolovits, P.. Hawkinson. L.B., and Martin, W.A. An overview of
13. Gardner. A.V.D.L. An artificial intelligence approach to legal reason- OWL, a language for knowledge representation. MlT/LCS/TM-86.
ing. Rep. STAN-CS-85-1045. Dept. of Computing Science, Stanford Laboratory for Computer Science, M&T., Cambridge. Mass.. 1977.
Univ., 1984. To be published by Bradford Books/MIT Press. 42. Waterman, D.A., and Peterson. M.A. Models of legal decisionmak-
14. Gardner, A.V.D.L. Overview of an artificial intelligence approach to ing. Rep. R-2717-ICJ, Institute for Civil Justice, Rand Corporation.
legal reasoning. In Computing Power nnd Legal Reasoning, C. Walter, Santa Barbara, Calif.. 1981.
Ed. West. St. Paul. Minn.. 1985. pp. 247-274.
15. Genesereth. M.R., Greiner, R., Grinberg, M.R., and Smith. D.E. The
MRS dictionary. Memo HPP-80.24, Stanford Heuristic Programming
Project. Stanford IJniv., Calif., Dec. 1980: revised Jan. 1984.
16. Gordon, T.F. Object-oriented predicate logic and its role in repre- CR Categories and Subject Descriptors: 12.1 [Artificial Intelligence]:
senting legal knowledge. In Computing Power and Legal Reasoning, Applications and Expert Systems--law; 12.3 [Artificial Intelligence]:
C. Walter. Ed. West, St. Paul. Minn.. 1985. pp. 163-203. Deduction and Theorem Proving-logic programming; 1.2.4 [Artificial In-
17. Hammond. P. Representation of DHSS regulations as a logic pro- telligence]: Knowledge Representation Formalisms and Methods-predi-
gram. Rep. 82/X, Dept. of Computing, Imperial College, London. cafe logic; 1.2.5 [Artificial Intelligence]: Programming Lqnguages and
1982. pp. 225-235. Also in Proceedings offhe 3rd KS Expert Systems Software-Prolog. APES: I.1 [Computer Applications]: Administrative
Conference, British Computer Society, Cambridge, Dec. 1983. Data Processing--law; K.6.3 [Management of Computing and Informa-
pp. 225-235. tion Systems]: Software Management-softwar: development
18. Hammond. P., and Sergot. M.J. A PROLOG shell for logic based General Terms: Design, Experimentation. Human Factors, Languages,
expert systems. In Proceedings of the 3rd BCS Experf Systems Confer- Reliability. Theory
once. British Computer Society. Cambridge, Dec. 1983, pp. 95-104. Additional Key Words and Phrases: British citizenship, legislation.
19. Hammond, J’., and Sergot, M.J. APES Rejerence Manual. Logic Based rule-based systems
Systems. Richmond, Surrey. England, 1984.
20. Her Majesty’s Stationery Office. The British Nationality Act 1981.
Chapter 61, London, 1981.
21. Hustler, A. ProgrammIng law in logic. Res. Rep. CS-82-13, Dept. of
Computer Science, Univ. of Waterloo. Canada, 1982. Authors’ Present Address: M.J. Sergot, F. Sadri, R.A. Kowalski,
22. Jones, S. Control structures in legislation. In Compufer Science and F. Kriwaczek, P. Hammond. and H.T. Gory. Dept. of Computing. Impe-
Law, 8. Niblett. Ed. Cambridge University Press, New York, 1980. rial College, University of London, 180 Queens Gate. London, SW7 2BZ,
pp. 157-l 69. England.
23. Jones, S.. Mason, P., and Stamper. R. LEGOL 2.0: A relational specifi-
cation language for co,mplex rules. Inf Sysf. 4, 4 (Dec. 1979). 293-
305.
24. Kowalski. R.A. Logic for Problem Solving. Elsevier North-Holland,
New York, 1979. Permission to copy without fee all or part of this material is granted
25. Kowalski, R.A. Logic programming. In Proceedings ZNP-83 Congress. provided that the copies are not made or distributed for direct commer-
Elsevier North-Holland. New York, 1983. pp. 133-145. cial advantage, the ACM copyright notice and the title of the publication
28. Kowalski, R.A. Software engineering and knowledge-based systems and its date appear, and notice is given that copying is by permission of
in new generation computing. Future Generation Compuf. Sysf. 1. 1 the Association for Computing Machinery. To copy otherwise. or to
(1984), 39-49. republish, requires a fee and/or specific permission.