Professional Documents
Culture Documents
1. Introduction
Within the Logic Programming Group at Imperial College the domain of law
is seen as a primary source of applications. These applications are intended both
to demonstrate and test developing techniques of logic programming, and to
suggest and motivate future extensions. In general terms, our approach can be
summarised as follows. We take some legislative text, typically a statute o r a
set of regulations, and represent its provisions in a formal, logical language.
(More precisely, given the nature of the language in which the original legislation
is expressed, we represent particular interpretations o r readings of these pro-
visions.) We thus obtain a logical representation of what the legislation expresses
(or again, more precisely, of what we think it is that the legislation expresses).
We construct in effect a model of the law which captures the essential feature
of interest and which can be executed or manipulated to support tasks related
t o the legislation.
* The work reported here was supported by the Science and Engineering Research Council. We
are happy to acknowledge the contributions of our colleagues Trevor Bench-Capon, Kave Eshghi,
Gwen Owen Robinson, Tom Routen, Fariba Sadri, Uri Schild, Murray Shanahan and David
Wolstenholme.
202 Robert Kowalski and Marek Sergot
A if B a n d . . .and C
is one representation of the first clause of the British Nationality Act 1981, which
states
A person born in the United Kingdom after commencement shall be a British citizen
if at the time of birth his father or mother is -
(a) a British citizen; or. . .
Commencement, the date on which the Act came into effect, was 1January 1983.
Extended Horn clauses are the basis for logic programming, and for the
programming language PROLOG. The rule above which represents the first
clause of the British Nationality Act, for example, runs as a procedure when
executed by PROLOG. One such procedure is -
engine." This yields a program which can determine what consequences follow
logically from the model given some particular state of affairs. We thus obtain
a program which can be used for the routine application or administration of
the provisions from which we started. If executed by a system such as APES,
the program will automatically ask for information which is missing, and it
will be capable of explaining and justifying its conclusions.
What we have described is a program which operates by blind, mechanical
application of its rules. It follows that such a program is appropriate only in
areas of the law where we are interested in providing a system which routinely
applies a set of complex regulations without questioning their legal basis. To
avoid any misunderstanding, we state explicitly that most legal reasoning is
concerned with a different problem, namely that of identifying, interpreting
and reconciling the relevant legal sources (statutes, case reports and other sources
of law) and thus of determining what legal rules should apply, rather than the
much easier problem of actually applying the rules once they have been iden-
tified. Nevertheless, in the day to day practice of law, there are many situations
where routine tasks do have to be performed, and where rules and regulations
do have to be applied mechanically. When the rules and regulations involved
in these tasks are complex, then a system which can perform most of the detailed
routine work can be of significant help, even though it is addressing only the
most straightforward aspect of the legal decision making process.
The use of such a program does not imply handing over the responsibility
for making decisions to the computer. The program might be used instead to
check decisions and conclusions drawn independently by its user. Consider for
example the assessment of claims for Social Security benefits. A program could
"look over the shoulder" of the official assessing the claim, and compare his
calculations against its own model of the relevant legislation. When the two
disagree, the official might want to accept the advice given by the system;
alternatively, he might decide that there are additional factors in the case at
hand which have to be taken into account and that the advice given by the
system needs to be rejected.
Except perhaps for the ease of generating explanations, it would of course
be possible to build functionally identical programs for these routine applications
by using conventional programming techniques. Such programs are commonly
used already. A payroll program that automatically deducts the prescribed
amount of income tax from an employee's net monthly salary is an example.
Nevertheless, the approach that we are advocating does have significant advan-
tages over the use of conventional programming techniques, even for these
routine administrative tasks.
Conventional programs for legal applications incorporate representations of
the relevant rules and regulations into the routines which are used to apply the
regulations, This is a direct consequence of the nature of conventional pro-
gramming languages, which are designed to express how a program should
behave, rather than what it should compute. It is difficult or impossible to take a
206 Robert Kowalski and Marek Sergot
conventional program for some legal application and point to some part of it
and say "Here is the legislation." In contrast, a logic program for the same task
keeps its representation of the legislation (the logical model of the law) distinct
from the routines which make use of the legislation (the inference mechanism).
Compared with conventional programs, this means that logic programs (and
other programs implemented by means of the same techniques) are: easier to
build; easier to modify and maintain as the legislation changes; easier for a
human to interact with, by supplying missing information as it is required and
by obtaining explanations; and easier to understand and assess for accuracy.
(These advantages are relative. We are not claiming that such programs are
easy to build and we are not claiming that they are always easy to modify and
maintain. )
The understandability of a program is important for reasons other than simply
assessing its accuracy. For in many applications in law, no matter how trivial
or routine, it will be critical that the assumptions on which the program is based,
and the legal sources from which these are derived, should be open to scrutiny
and critical assessment. Without this possibility users are condemned to accept
the workings of a program at face value, and to rely to an unacceptable degree
on the legal skill of its author. Note also that we prefer to speak of the "accuracy"
of a program, rather than its "correctness." "Correctness" would suggest that
there is some objective notion of a correct reading of the law.
The approach as we have described it so far does not provide the ability to
construct programs for applications in law which are fundamentally different
from those we could construct with conventional programming techniques.
Rather, it provides us with a better method for constructing such programs,
with the ability to make these programs more flexible, and with the opportunity
to increase the range of applications we could tackle in practice. One of the
principal aims of our representation of the British Nationality Act was to
demonstrate the computational feasibility of applying logic programming tech-
niques in a realistically-sized application, and to show that this could be done
without compromising the "logical purity" of the underlying representation.
Certainly, the British Nationality Act is a particularly simple example of
legislation, where many of the complications (such as the absence of case law
when we embarked on our implementation) were either absent or could be
ignored. It is the relative absence of these complicating factors which influenced
our choice of the British Nationality Act at the outset.
The British Nationality Act, inoreover, is small in comparison with some
legislation. But it is also substantially larger and more complex than many of
the fragments that have to be represented when building a useful system for
the routine administration of some very specific aspect of some particular part
of the law. We feel that our representation of the British Nationality Act has
demonstrated the feasibility of constructing similar programs in many areas of
administrative law, and this is further supported by our representation of other
fragments of legislation (see earlier references to other projects).
The Use of Logical Models in Legal Problem Soloing 207
Before considering other uses to which we might put a logical model of the
law, it is important to make one further qualifying remark. Our representation
of the British Nationality Act was undertaken with no expert legal assistance.
Our model of the Act expresses a layman's reading of the provisions. This in
itself renders our British Nationality Act program of limited practical value.
We could not use it in its present form for solving problems of British citizen-
ship in actual legal practice.
To construct a program dealing with the British Nationality Act that could
be used in practice, it would be necessary to enlist the help of an expert lawyer,
preferably several experts on citizenship and immigration law. We did not enlist
the help of such experts, partly because we had no access to this expertise, and
partly because we were interested to see to what extent it would be possible
to understand and apply the provisions of the British Nationality Act by
considering only its common sense or "layman's" reading. Access to an expert
adviser might well have changed the exact form of the rules in our program,
but it would not have changed the method we used to formulate and compute
with the rules.
Of course, if a program is to be used in practice, then expert legal advisers
are indispensable. Their role is to check the formulation for accuracy, to advise
on the reading of the various provisions, and to point to simplifications and
misunderstandings.
It is naturally most convenient if there is access to such an expert adviser
from the very beginning, and throughout the process of formulating the legisla-
tion as logical rules. This is not always realistic, given the demands on the time
of an expert lawyer and the costs of employing the services of such a person.
An alternative we have tried in other collaborative projects is to involve the
expert adviser primarily towards the end of a project. Apart from an initial
consultation to identify potential difficulties and misunderstandings, and
occasional meetings to clarify specific points, it is often possible to produce a
prototype representation, concentrating particularly on the computational
aspects of the formulation. At this stage, once the prototype is virtually
complete, the expert adviser can scrutinise and adjust the representation in the
light of his knowledge of the law. Note that whatever method is used, it is easier
to benefit from the advice of an expert when the underlying representation of
the law is explicit, laid open for examination, and separated from the computa-
tional procedures that apply it.
There is a further role for an expert adviser, which again we can illustrate
by reference to our British Nationality Act program. There may be several areas
in which an expert adviser might want to extend or modify our program to
provide a more useful practical system. He might want to include rules, for
example, to indicate what some of the vague concepts appearing in the Act but
not explicitly defined there are actually taken to mean in practice. He might
also want to draw on his experience, to advise on the best way of applying
the rules for particular kinds of users. He might recommend questions to ask
208 Robert Kowalski and Marek Sergot
So far we have discussed the use of logical models of the law for constructing
programs to help with the application of routine aspects of administrative law.
We have laid particular emphasis on the importance of separating a represen-
tation of the law from the inference mechanisms that apply this representation
for some given purpose. This separation has practical significance, even for
relatively simple applications. But it also makes possible the use of logical models
of the law in more ambitious systems that address other parts of the legal
problem-solving process. In the following two sections we consider more
ambitious uses of logical models: to aid the drafting of legislation and to aid
the expert lawyer.
In this section we consider the possibility of using the same logical model
of the law in different systems intended for different kinds of users. Consider
Social Security legislation for example. One system might be tailored for govern-
ment officials who must administer the law, assess claims for benefit, and process
applications. A different system in the same general area might be required by
an agency whose task is to advise citizens on their various entitlements and
help them to formulate applications which have the greatest chance of success.
That the two systems have different requirements should be clear. The govern-
ment officials’ system will probably be more detailed. It will need to incorporate
a representation of various supplementary regulations, and of the local pro-
cedures, directives and guidelines that officials must take into account when
processing claims. The citizens’ advice system will not be concerned with such
detail. (And even if it were, it is unlikely that a government department would
be willing to make public all the internal regulations which it issues to its officers.)
Instead, the citizens’ advice system will require a broader coverage of the same
area of law. This might have to be augmented with an indication of what the
government’s attitude has been in the past, what the current policy seems to
be, and what chances a particular claimant has of having a claim accepted. It
might also be required to advise on courses of action which would increase the
chances of success.
As we indicated earlier, there would seem to be no reason why we could not
build these various systems separately. But we can expect that the two systems
The Use of Logical Models in Legal Problem Solving 209
would overlap to a substantial extent, and that at the core of both systems would
be a representation of the relevant published legislation. It would be redundant
to construct this core representation twice. Certainly, the idea that we could
base both systems (and any others that might arise) on a single representation
of the relevant legislation is an attractive one. It is possible to illustrate how
this might be done on "toy" examples. But it remains to be seen how this works
out in practice in real applications. It could be that in a real application adding
the various supplementary representations causes such disruption to the common
model that we might just as well have built the two systems separately in the
first place. Although we gave Social Security legislation as an example, it should
be clear that the same considerations apply in all areas of the law. For a system
which helps to administer the law will always have different requirements from
a system which is used to help advise a client how best to prepare and present
his case.
Separating a model of the law from the routines that apply it makes it possible
to use the same model of the law with different modes of execution. For example,
both PROLOG and APES work by reasoning backwards from a conclusion we
want to establish to data we have available or that can be made available by
the user. As an alternative, it is also possible to reason forwards instead, looking
for conclusions we can draw from the available data. Forward reasoning as a
way of executing logic programs is especially attractive for deductive databases,
both for answering queries (e.g., Zaniolo 1988) and for checking new data for
consistency (e.g., Sadri and Kowalski 1988).
Other, more sophisticated theorem-proving techniques can also be used to
execute models of the law. However, implementing each new mode of execution
from scratch is unlikely to be cost-effective. Instead, it is much more attractive
to develop a range of programming "shells" with the functionality to support
these alternative modes of use. A "sheil" refers here to the inference mechanism
that executes the logical model, together with the auxiliary routines and facilities
required for the construction of finished applications. Programming "shells"
developed for legal applications can often be used in other application domains
as well. Again, we see in the law an ideal domain in which to develop a range
o f logic programming shells and test them out on substantial applications.
5 . Drafting Aids
In addition to these alternative ways of using a given logical model of the law,
we are also interested in the use of logical models at the drafting stage and in
the formulation of policy. Such uses of logical models of the law resemble uses
of executable specifications in Software Engineering. A specification in Software
Engineering is a precise description of what it is that a computer system is
supposed to do. Specifications are formulated at the design stage. Once they
are complete, they are used to drive the concrete implementation of the system
in terms of the chosen programming language. Specifications which are also
210 Robert Kowalski and Marek Sergot
executable in their own right are particularly useful, because they can be used
to illustrate the effects of proposed modifications, and to test that the final system
will indeed do what the user expects it to do. There is an obvious analogy in
law. One can imagine how a draftsman who is charged with formulating a piece
of new legislation or with modifying an existing piece might use an executable
model of his current draft to test that it “does” what he intended. He could
have available, for example, a library of stereotypical cases on which he can
try out changes to his current draft.
Analogies come to mind. An engineer who is designing a new bridge will
construct a computer model (usually a whole range of them) to test out various
aspects of the design (that the bridge would support its intended load, that it
would be possible to maintain, that it would not affect local road traffic
adversely, that the cost of building it would not exceed the budget, and so on).
There will always be aspects of the design that are impossible to test (how fast
the joints will corrode, for example). But no engineer would contemplate actually
building the bridge until all the tests that are possible had been completed. We
believe that there is now at least the possibility of making similar computer
models available to a legal draftsman.
Such computer models for the draftsman need not be limited to stimulating
the effect of legislation on a library of stereotypical cases. Mechanical theorem-
provers might be used to derive logical consequences from a logical model
representing the current or proposed new draft of a piece of legislation. One
use of this capability might be to test whether the legislation does possess
intended general properties - for example, whether a proposed (imaginary) Social
Security amendment has the intended effect of entitling all persons over a given
age to a pension under the new scheme. A failure to establish that such a general
property holds would identify mistakes or gaps in the legislation, suggesting
in turn how the defective draft might be improved.
The analogous use of theorem-provers to derive general properties of pro-
grams and program specifications is beginning to become practical in Software
Engineering. Indeed, the programming language PROLOG itself has its roots
in this work, and can be regarded as a theorem-prover of a particularly simple
kind. Viewed as a theorem-prover, PROLOG is too limited to support these
applications, but existing theorem-provers more general and more sophisticated
than PROLOG do have the ability to do so.
The use of theorem-provers to process models of legislation was foreseen as
early as 1957by Layman Allen (Allen 1957)when he argued for the use of symbolic
logic as a tool for drafting and potentially simplifying complex legal documents.
Allen’s ideas have been developed further and have had some influence on the
drafting style of legislators, particularly in some of the United States. In his original
paper, Allen suggested that automated tools might even be applied to help in the
construction of a legal document. He illustrated how a legal document could be
simplified and restructured using simple theorem-proving techniques similar to
those employed in the simplification and re-design of electrical circuits.
The Use of Logical Models in Legal Problem Solving 211
What has not been established (to our knowledge) is whether the more general
possibility of deriving arbitrary consequences from logical models of the law
would provide practical help to the person engaged in drafting a piece of real
legislation. It is difficult to test out these ideas in practice. Legal draftsmen, in
the United Kingdom certainly, work under extreme pressure. It is unrealistic
to increase their workload in the short-term by asking them to experiment with
prototype systems that might eventually be developed to provide useful drafting
aids. However, it might be possible to undertake this exercise in organisations
outside the law. Complex regulations have to be drafted in all kinds of organisa-
tions. The person charged with drawing a set of such regulations will face
many of the same difficulties that a Parliamentary draftsman will encounter,
and will perhaps be better able to experiment with speculative systems under
development.
It must also be stressed that such drafting aids would be something of a
luxury. Simpler tools, such as special-purpose editing facilities and cross-
'
referencing aids, can be provided more easily and are likely to be more effective
in the short-term. We have recently been involved in a preliminary study
on the provision of such tools for a data base of legislative texts intended
primarily to support the work of Parliamentary draftsmen. Such a data base
is complementary to the logical models discussed in this paper, in that it
represents not the detailed "meaning" of a piece of legislation but rather its
structure (what it contains) and its relationship to other legislation. Humphreys
(1988) and Roy-Burman (1988) describe the background and intended usages
in more detail. We have experimented with the use of similar data bases to aid
the task of representing large and complex bodies of legislation (Bench-Capon
et a]. 1987).
We have also been involved in the provision of tools to help in the formulation
of policy and the formulation of law at the stage before detailed drafting begins.
Roughly, the intention is to provide legislators with a set of logical tools to
help assess the socio-economic implications of proposed changes to legislation,
to estimate the costs involved, and to anticipate potential shortcomings and
other undesirable consequences, before the changes are implemented in legisla-
tion. Here, in addition to the proposed legislation itself the logical model must
incorporate representations of goals and intentions (often vague and conflicting)
and underlying socio-economic theories (often vague and unarticulated) . This
work, still in its early stages, is described by Bench-Capon (1987).It is conducted
as part of an Alvey "Large Demonstrator Project" investigating the provision
of decision support systems in large legislation-based organisations like the
Department of Health and Social Security. Other components in the Demonstrator
project are systems to help in the assessment of claims and systems to advise
on entitlement to the various welfare benefits available. The other collaborators
in the project are ICL, Logica, and the Universities of Lancaster and Surrey (and
Liverpool since 1987).
212 Robert Kowalski and Marek Sergot
7. Ambiguity
Legislation - by which we mean statutes and published rules and regulations
- is written in natural language. Consequently, it is on occasion both ambiguous
and vague. Much of the legal decision-making process is concerned with the
resolution of ambiguity and vagueness, and these are problems which we must
confront if we are to provide computer programs that address more than the
most basic aspects of the legal process.
In practice problems of ambiguity and vagueness in the law are resolved in the
same way, by presenting and then analysing a set of reasoned arguments why
one particular interpretation rather than another should be taken in a given case.
Moreover, with both kinds of problem, much of the argumentation concerns
214 Robert Kowalski and Marek Sergot
with several conflicting logical models in a single program open up a vast range
of possible applications. These possibilities are not limited to applications within
the law: The techniques apply equally in any area which requires reasoning about
uncertain or hypothetical states of affairs.
9. Conclusion
We believe that logic programming techniques have already proved useful in
helping to construct first generation legal reasoning systems - systems that reason
with one fixed interpretation of a legislative text.
We expect that second generation systems - systems that can reason with
several interpretations and with conflicting rules arising from previous cases
- will not only help to test the technology further, but will help to identify
extensions of the technology which may prove useful also in other application
areas. Such expected extensions include the incorporation of ATMS knowledge
assimilation, and knodledge refinement techniques (see Kowalski 1979). We
believe that the law is an ideal domain for motivating such general extensions
of logic programming techology .
We would like to believe that our investigations will prove useful, not only
for building computer programs for legal applications, but more importantly,
for clarifying and improving the legal reasoning process whether performed with
or without the assistance of computers.
University of London
Imperial College of Science, Technology and Medicine
Department of Computing
180 Queen's Gate
London SW7 2BZ
United Kingdom
References
Allen, L. E. 1957. Symbolic Logic: A Razor-Edged Tool for Drafting and Interpreting
Legal Documents. Yale Law Journal 66: 833-79.
Ashley, K. D., and E. L. Rissland. 1987. But, See, Accord: Generating 'Blue Book'
Citations in HYPO. In The First International Conference on Artificial Intelligence
and Law, 67-74. New York: ACM Press.
Bench-Capon, T. J. M. 1987. Support for Policy Makers: Formulating Legislation with
the Aid of Logical Models. In The First International Conference on Artificial Intel-
ligence and Law, 181-89. New York: ACM Press.
, and M. J. Sergot. 1987. Towards a Rule-Based Representation of Open Tex-
ture in Law. In Computing Power and Legal Language. Ed. C. Walter. Greenwood:
Quorum Press.
Bench-Capon, T. J. M., G. 0. Robinson, T. W. Routen, andM. J. Sergot. 1987. Logic
Programming for Large Scale Applications in Law: A Formalisation of Supplementary
Benefit Legislation. In The First International Conference on Artificial Intelligence
and Law, 190-98. New York: ACM Press.
Bowen, K. and R. A. Kowalski. 1982. Amalgamating Language and Metalanguage in
Logic Programming. In Logic Programming. Ed. K . L. Clark and S.-A. Tarnlund.
London: Academic Press.
de Kleer, J. 1986. An Assumption-Based TMS. Artificial Intelligence 28: 127-62.
Gardner, A. v. d. L. 1984. An Artificial IntelligenceApproach to Legal Reasoning. Report
STAN-CS-85-1045. Department of Computing Science, Stanford University.
218 Robert Kowalski and Marek Sergot
Hammond, P., and M. J. Sergot. 1983. A PROLOG Shell for Logic Based Expert Systems.
Proceedings Expert Systems 83.
Humphreys, A. M. 1988. Proposals for a Statute Law Database. MSc thesis. Department
of Computing, Imperial College, London.
Kowalski, R. A. 1979. Logic for Problem Solving. New York: North Holland.
Lakhani, H. M. 1988. Stock Exchange Regulations in Logic. MSc thesis. Department
of Computing, Imperial College, London.
McCarty, L. T., and N. S. Sridharan. 1982. A Computational Theory of Legal Argument.
Technical Report LRP-TR-2. Laboratory for Computer Science Research. Rutgers
University.
Roberts, H. 1988. Knowledge Representation for Procedural Law. MSc thesis. Department
of Computing, Imperial College, London.
Roy-Burman, J. 1988. Database Modelling of the Physical and Conceptual Structure
of Statute Law. MSc thesis. Department of Computing, Imperial College, London.
Sadri, F., and R. A. Kowalski. 1988. A Theorem-Proving Approach to Database Integrity.
In Foundations of Deductive Databases and Logic Programming. Ed. J . Minker,
313-62. Los Altos, Ca.: Morgan Kaufman Publishers.
Schild, U. J. 1988. JURIX: A Legal Expert System. Department of Computing, Imperial
College, London. (Paper presented at 8th International Workshop on Expert Systems,
Avignon, 1988.)
Sergot, M. J. 1985. Representing Legislation as Logic Programs. Department of Corn-
puting, Imperial College, London. In Machine Intelligence 13. Ed. E. Hayes, D. Michie,
J. Richards. Oxford: Oxford University Press.
. 1987. The Representation of Law in Computer Programs: A Survey and
Comparison of Past and Current Projects. Department of Computing, Imperial
College, London.
, F. Sadri, R. A. Kowalski, F. Kriwaczek, P. Hammond, andH. T. Cory. 1986.
The British Nationality Act as a Logic Program. Comm. ACM 29: 370-86.
Southwick, R. 1988. Reasoning with Assumptions. Paper. Department of Computing,
Imperial College, London.
Stathis, K. 1987. A Logic-Based System for an Application in Law. MSc thesis. Depart-
ment of Computing, Imperial College, London.
Zaniolo, C. 1988. Design and Implementation of a Logic Based Language for Data
Intensive Application. Proceedings of the Fifth International Logic Programming
Conference and Symposium. Ed. R. A. Kowalski and K. A. Bowen, 1666-87.
Cambridge, Mass.: MIT Press.