tutorial – automated deduction with legal texts ... · challenges i...

73
Tutorial – Automated Deduction with Legal Texts Introduction to a normative logic Tomer Libal

Upload: others

Post on 06-Oct-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Tutorial – Automated Deduction with Legal TextsIntroduction to a normative logic

Tomer Libal

Page 2: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Logical reasoning

I ScenarioI We have a problem

I Some factsI context

I We consult the right legislation

I How do we reach conclusions?

I Can a computer do that for us?

Page 3: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Logical reasoning

I ScenarioI We have a problem

I Some factsI context

I We consult the right legislation

I How do we reach conclusions?

I Can a computer do that for us?

Page 4: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Computer reasoning

I Given a legal textI Persons who are doctors and lawyers qualifyI Andrew is a doctor

I how can a computer decide if Andrew qualifies?partially based on an example from Allen, Layman E., and C. Rudy Engholm. “Normalized legal drafting and thequery method.” J. Legal Educ. 29 (1977): 380.

Page 5: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Some approaches

I Machine learningI Show the computer examples of people who are and are not

qualifiedI Logic based

I Our approach

Page 6: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Challenges

I Text can be ambiguous, imprecise, requires context, spreadover different pages/documents

I ExampleI Persons who are doctors and lawyers qualifyI Option 1: Persons who are lawyers [qualify] and [persons who

are] doctors qualify.I Option 2: Persons who are [both doctors and lawyers] qualify

based on Allen, Layman E., and C. Rudy Engholm. “Normalized legal drafting and the query method.” J. LegalEduc. 29 (1977): 380.

Page 7: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Challenges

I Text can be ambiguous, imprecise, requires context, spreadover different pages/documents

I ExampleI Persons who are doctors and lawyers qualifyI Option 1: Persons who are lawyers [qualify] and [persons who

are] doctors qualify.I Option 2: Persons who are [both doctors and lawyers] qualify

based on Allen, Layman E., and C. Rudy Engholm. “Normalized legal drafting and the query method.” J. LegalEduc. 29 (1977): 380.

Page 8: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

English as a legal language

I Is English precise?I Persons who are doctors and lawyers qualifyI Persons who are lawyers [qualify] and [persons who are] doctors

qualifyI Persons who are [both doctors and lawyers] qualify

I English is too imprecise. How can we provide a preciseinterpretation to a sentence?

Page 9: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

English as a legal language

I Is English precise?I Persons who are doctors and lawyers qualifyI Persons who are lawyers [qualify] and [persons who are] doctors

qualifyI Persons who are [both doctors and lawyers] qualify

I English is too imprecise. How can we provide a preciseinterpretation to a sentence?

Page 10: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Formal languages

I Assume having in our language

I Propositional symbols - p1 p2 . . .I Each can mean anything

I The phrase templates (from now on called connectives)I . . . AND . . .I IF . . . THEN . . .

I Which of the sentences can be written in this language?I Persons who are doctors and lawyers qualifyI Persons who are lawyers [qualify] and [persons who are] doctors

qualifyI Persons who are [both doctors and lawyers] qualify

Page 11: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Formal languages

I Assume having in our languageI Propositional symbols - p1 p2 . . .

I Each can mean anything

I The phrase templates (from now on called connectives)I . . . AND . . .I IF . . . THEN . . .

I Which of the sentences can be written in this language?I Persons who are doctors and lawyers qualifyI Persons who are lawyers [qualify] and [persons who are] doctors

qualifyI Persons who are [both doctors and lawyers] qualify

Page 12: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Formal languages

I Assume having in our languageI Propositional symbols - p1 p2 . . .

I Each can mean anythingI The phrase templates (from now on called connectives)

I . . . AND . . .I IF . . . THEN . . .

I Which of the sentences can be written in this language?I Persons who are doctors and lawyers qualifyI Persons who are lawyers [qualify] and [persons who are] doctors

qualifyI Persons who are [both doctors and lawyers] qualify

Page 13: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Formal languages

I Assume having in our languageI Propositional symbols - p1 p2 . . .

I Each can mean anythingI The phrase templates (from now on called connectives)

I . . . AND . . .I IF . . . THEN . . .

I Which of the sentences can be written in this language?I Persons who are doctors and lawyers qualifyI Persons who are lawyers [qualify] and [persons who are] doctors

qualifyI Persons who are [both doctors and lawyers] qualify

Page 14: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Formalization and meanings

I Since we have propositional symbols, we can write all sentences

I Persons who are doctors and lawyers qualifyI p1

I p1 means “The persons who are doctors and lawyers qualify”

I Persons who are lawyers [qualify] and [persons who are] doctorsqualify

I p1I p1 means “The persons who are lawyers qualify and the

persons who are doctors qualify”

ORI IF p1 THEN p3 AND IF p2 THEN p3

I p1 means “The persons are lawyers”I p2 means “The persons are doctors”I p3 means “The persons qualify”

Page 15: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Formalization and meanings

I Since we have propositional symbols, we can write all sentences

I Persons who are doctors and lawyers qualifyI p1

I p1 means “The persons who are doctors and lawyers qualify”

I Persons who are lawyers [qualify] and [persons who are] doctorsqualify

I p1I p1 means “The persons who are lawyers qualify and the

persons who are doctors qualify”

ORI IF p1 THEN p3 AND IF p2 THEN p3

I p1 means “The persons are lawyers”I p2 means “The persons are doctors”I p3 means “The persons qualify”

Page 16: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Formalization and meanings

I Since we have propositional symbols, we can write all sentences

I Persons who are doctors and lawyers qualifyI p1

I p1 means “The persons who are doctors and lawyers qualify”

I Persons who are lawyers [qualify] and [persons who are] doctorsqualify

I p1I p1 means “The persons who are lawyers qualify and the

persons who are doctors qualify”

OR

I IF p1 THEN p3 AND IF p2 THEN p3I p1 means “The persons are lawyers”I p2 means “The persons are doctors”I p3 means “The persons qualify”

Page 17: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Formalization and meanings

I Since we have propositional symbols, we can write all sentences

I Persons who are doctors and lawyers qualifyI p1

I p1 means “The persons who are doctors and lawyers qualify”

I Persons who are lawyers [qualify] and [persons who are] doctorsqualify

I p1I p1 means “The persons who are lawyers qualify and the

persons who are doctors qualify”

ORI IF p1 THEN p3 AND IF p2 THEN p3

I p1 means “The persons are lawyers”I p2 means “The persons are doctors”I p3 means “The persons qualify”

Page 18: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Symbolic reasoning

I Can we infer if Andrew, who is a doctor, qualify?I p1

I p1 means “The persons who are lawyers qualify and thepersons who are doctors qualify”

I IF p1 THEN p3 AND IF p2 THEN p3I p1 means “The persons are lawyers”I p2 means “The persons are doctors”I p3 means “The persons qualify”

I More or less since p1 does not exactly mean “Andrew, who is adoctor”

I We will consider this problem later

Page 19: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Symbolic reasoning

I Can we infer if Andrew, who is a doctor, qualify?I p1

I p1 means “The persons who are lawyers qualify and thepersons who are doctors qualify”

I IF p1 THEN p3 AND IF p2 THEN p3I p1 means “The persons are lawyers”I p2 means “The persons are doctors”I p3 means “The persons qualify”

I More or less since p1 does not exactly mean “Andrew, who is adoctor”

I We will consider this problem later

Page 20: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Symbolic reasoning

I Can we infer if Andrew, who is a doctor, qualify?I p1

I p1 means “The persons who are lawyers qualify and thepersons who are doctors qualify”

I IF p1 THEN p3 AND IF p2 THEN p3I p1 means “The persons are lawyers”I p2 means “The persons are doctors”I p3 means “The persons qualify”

I More or less since p1 does not exactly mean “Andrew, who is adoctor”

I We will consider this problem later

Page 21: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Logic

I We said that the computer can reason over the sentencesI IF p1 THEN p3 AND IF p2 THEN p3I p1

I and deduceI p3I Andrew is qualified

I The reason it can is that it can understand some of the textI The propositional symbols are just meaningless (for the

computer) symbolsI But the words AND, IF and THEN have a meaning the

computer can understand

I Together, syntax (the language) and semantics (meaning) forma logic

I More about that in Alex’s talk

Page 22: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Logic

I We said that the computer can reason over the sentencesI IF p1 THEN p3 AND IF p2 THEN p3I p1

I and deduceI p3I Andrew is qualified

I The reason it can is that it can understand some of the textI The propositional symbols are just meaningless (for the

computer) symbolsI But the words AND, IF and THEN have a meaning the

computer can understand

I Together, syntax (the language) and semantics (meaning) forma logic

I More about that in Alex’s talk

Page 23: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Logic

I We said that the computer can reason over the sentencesI IF p1 THEN p3 AND IF p2 THEN p3I p1

I and deduceI p3I Andrew is qualified

I The reason it can is that it can understand some of the textI The propositional symbols are just meaningless (for the

computer) symbolsI But the words AND, IF and THEN have a meaning the

computer can understand

I Together, syntax (the language) and semantics (meaning) forma logic

I More about that in Alex’s talk

Page 24: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Logic

I We said that the computer can reason over the sentencesI IF p1 THEN p3 AND IF p2 THEN p3I p1

I and deduceI p3I Andrew is qualified

I The reason it can is that it can understand some of the textI The propositional symbols are just meaningless (for the

computer) symbolsI But the words AND, IF and THEN have a meaning the

computer can understand

I Together, syntax (the language) and semantics (meaning) forma logic

I More about that in Alex’s talk

Page 25: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Formal interpretationsI We have translated a sentence from English into another

language

I We can express the intended interpretation of a naturallanguage sentence in a non-ambiguous way

I We call it formal interpretation or formalization

I We can write a computer program to reason about them sincesome words have a meaning it can understand

I How can we create these formalizations?I Persons who are doctors and lawyers qualifyI IF p1 THEN p3 AND IF p2 THEN p3I NLPI Manually by an expert

I Our approachI NLP will be integrated later in order to assist

Page 26: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Formal interpretationsI We have translated a sentence from English into another

language

I We can express the intended interpretation of a naturallanguage sentence in a non-ambiguous way

I We call it formal interpretation or formalization

I We can write a computer program to reason about them sincesome words have a meaning it can understand

I How can we create these formalizations?I Persons who are doctors and lawyers qualifyI IF p1 THEN p3 AND IF p2 THEN p3

I NLPI Manually by an expert

I Our approachI NLP will be integrated later in order to assist

Page 27: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Formal interpretationsI We have translated a sentence from English into another

language

I We can express the intended interpretation of a naturallanguage sentence in a non-ambiguous way

I We call it formal interpretation or formalization

I We can write a computer program to reason about them sincesome words have a meaning it can understand

I How can we create these formalizations?I Persons who are doctors and lawyers qualifyI IF p1 THEN p3 AND IF p2 THEN p3I NLPI Manually by an expert

I Our approach

I NLP will be integrated later in order to assist

Page 28: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Formal interpretationsI We have translated a sentence from English into another

language

I We can express the intended interpretation of a naturallanguage sentence in a non-ambiguous way

I We call it formal interpretation or formalization

I We can write a computer program to reason about them sincesome words have a meaning it can understand

I How can we create these formalizations?I Persons who are doctors and lawyers qualifyI IF p1 THEN p3 AND IF p2 THEN p3I NLPI Manually by an expert

I Our approachI NLP will be integrated later in order to assist

Page 29: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Automation

I Once we have a formalization, we can use the computer toI Confirm or refute queries

I “Is Andrew qualified?”I Check if the formalization makes sense

I ConsistencyI Check if the formalization contains redundancy

I IndependencyI Explain why something is not correct

I Model checking, abductive reasoningI Paint graphs and other visualization

Page 30: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Consistency

I Let’s extend our language with a new connectiveI NOT . . .

I Assume we have the sentencesI “Driving under the affect of drugs is a crime”I “Driving during the night is not a crime”

I One possible formalization isI IF p1 THEN p2

I p1 means driving under the affect of drugsI p2 means crime

I IF p3 THEN NOT p2I p3 means driving during the night

I What is the problem?

I What happens if we drive under the affect of drugs during thenight? Are we committing a crime?

Page 31: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Consistency

I Let’s extend our language with a new connectiveI NOT . . .

I Assume we have the sentencesI “Driving under the affect of drugs is a crime”I “Driving during the night is not a crime”

I One possible formalization isI IF p1 THEN p2

I p1 means driving under the affect of drugsI p2 means crime

I IF p3 THEN NOT p2I p3 means driving during the night

I What is the problem?

I What happens if we drive under the affect of drugs during thenight? Are we committing a crime?

Page 32: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Consistency

I Let’s extend our language with a new connectiveI NOT . . .

I Assume we have the sentencesI “Driving under the affect of drugs is a crime”I “Driving during the night is not a crime”

I One possible formalization isI IF p1 THEN p2

I p1 means driving under the affect of drugsI p2 means crime

I IF p3 THEN NOT p2I p3 means driving during the night

I What is the problem?

I What happens if we drive under the affect of drugs during thenight? Are we committing a crime?

Page 33: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Redundancy

I A set of natural language sentences might contain someredundancy

I “Driving under the affect of drugs during the night is a crime”I “One cannot drive during the night”

I One might be redundant in a certain formalization

Page 34: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Automated reasoning

I So far, we have said that the computer can answer certainquestions

I In fact, there are specific software which can do that

I Automated theorem proversI Can answer questions for a specific logicI Our focus

Page 35: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Formalization power

I We have considered two languagesI EnglishI A language containing

I ANDI NOTI IF THEN

I What are the limits of each of these languages?

I English is too expressive and can denote imprecise/ambiguoussentences

I The second is too weak

Page 36: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Formalization power

I We have considered two languagesI EnglishI A language containing

I ANDI NOTI IF THEN

I What are the limits of each of these languages?I English is too expressive and can denote imprecise/ambiguous

sentencesI The second is too weak

Page 37: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Weak languages

I The United Nations Convention on Contracts for theInternational Sale of Goods - part of Article 31

“If the seller is not bound to deliver the goods at any other particularplace, his obligation to deliver consists:

(a) if the contract of sale involves carriage of the goods - in handingthe goods over to the first carrier for transmission to the buyer;

(b) in other cases – in placing the goods at the buyer’s disposal atthe place where the seller had his place of business at the timeof the conclusion of the contract.”

I How can we formalize it in our weak language?

Page 38: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Possible formalization

I We need two more connectivesI EITHER . . . OR . . .I IF . . . THE OBLIGATION IS

IF NOT p1 THEN EITHER IF p2 THEN THE OBLIGATIONIS p3 OR IF NOT p2 THEN THE OBLIGATION IS p4

I WhereI p1 is “the seller is bound to deliver the goods at any other

particular place”I p2 is “the contract of sale involves carriage of the goods”I p3 is “handing the goods over to the first carrier for

transmission to the buyer”I p4 is “placing the goods at the buyer’s disposal at the place

where the seller had his place of business at the time of theconclusion of the contract.”

Page 39: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Possible formalization

I We need two more connectivesI EITHER . . . OR . . .I IF . . . THE OBLIGATION IS

IF NOT p1 THEN EITHER IF p2 THEN THE OBLIGATIONIS p3 OR IF NOT p2 THEN THE OBLIGATION IS p4

I WhereI p1 is “the seller is bound to deliver the goods at any other

particular place”I p2 is “the contract of sale involves carriage of the goods”I p3 is “handing the goods over to the first carrier for

transmission to the buyer”I p4 is “placing the goods at the buyer’s disposal at the place

where the seller had his place of business at the time of theconclusion of the contract.”

Page 40: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Reasoning example

I AssumingI NOT p1 - “the seller is not bound to deliver the goods at any

other particular place”I p2 - " the contract of sale involves carriage of the goods"

I The theorem prover can concludeI THE OBLIGATION IS p4 - “There is an obligation for the

seller to hand the goods over to the first carrier for transmissionto the buyer”

Page 41: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Strengthening the language

I We can continue to strengthen the language to be able toexpress all legal nuances

I Fundamental Requirements1. It should be formal (precise and non-ambiguous)2. A logic needs to be strong enough to capture interesting legal

nuances3. It should be weak enough to be implemented in an efficient

theorem prover

Page 42: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Formal languages for legal reasoning

I There are manyI Standard deontic logic (SDL)

I too weakI Dyadic deontic logicsI Input/output logic

I Efficient theorem provers exist only for SDL (among those inthe list)

Page 43: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Formal languages for legal reasoning

I There are manyI Standard deontic logic (SDL)

I too weakI Dyadic deontic logicsI Input/output logic

I Efficient theorem provers exist only for SDL (among those inthe list)

Page 44: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Balancing between the requirements

I Find a logic which isI expressive enough to capture some (not all) legal nuancesI has an efficient theorem prover

I Our choiceI DL*I MleanCoP

I An efficient normal multi-modal first-order theorem prover (J.Otten)

Page 45: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

What can be captured by DL*?

I Contrary-to-duty scnearios (CTD) and the distinction betweenideal and actual obligations

I Chisholm’s paradox(1) it ought to be that Jane helps her neighbors;(2) it ought to be that if Jane helps her neighbors, she tells them

that she is coming;(3) if Jane does not help her neighbors, then she ought not to tell

them that she is coming;(4) Jane does not help her neighbors.

I The theorem prover can inferI Ideally Jane ought to help and to tell her neighborsI Currently, she ought not to tell themI Jane has violated an ideal obligation

Page 46: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

What can be captured by DL*?

I Contrary-to-duty scnearios (CTD) and the distinction betweenideal and actual obligations

I Chisholm’s paradox(1) it ought to be that Jane helps her neighbors;(2) it ought to be that if Jane helps her neighbors, she tells them

that she is coming;(3) if Jane does not help her neighbors, then she ought not to tell

them that she is coming;(4) Jane does not help her neighbors.

I The theorem prover can inferI Ideally Jane ought to help and to tell her neighbors

I Currently, she ought not to tell themI Jane has violated an ideal obligation

Page 47: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

What can be captured by DL*?

I Contrary-to-duty scnearios (CTD) and the distinction betweenideal and actual obligations

I Chisholm’s paradox(1) it ought to be that Jane helps her neighbors;(2) it ought to be that if Jane helps her neighbors, she tells them

that she is coming;(3) if Jane does not help her neighbors, then she ought not to tell

them that she is coming;(4) Jane does not help her neighbors.

I The theorem prover can inferI Ideally Jane ought to help and to tell her neighborsI Currently, she ought not to tell them

I Jane has violated an ideal obligation

Page 48: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

What can be captured by DL*?

I Contrary-to-duty scnearios (CTD) and the distinction betweenideal and actual obligations

I Chisholm’s paradox(1) it ought to be that Jane helps her neighbors;(2) it ought to be that if Jane helps her neighbors, she tells them

that she is coming;(3) if Jane does not help her neighbors, then she ought not to tell

them that she is coming;(4) Jane does not help her neighbors.

I The theorem prover can inferI Ideally Jane ought to help and to tell her neighborsI Currently, she ought not to tell themI Jane has violated an ideal obligation

Page 49: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

DL* language (syntax)

I Non-normative connectives: NOT . . . , . . . AND . . . , . . .OR . . . , IF . . . THEN . . . , IFF . . . THEN . . .

I Normative unary connectives: OBLIGED . . . ,PERMITTED . . . , FORBIDDEN . . . , IDEALLY . . .

I Normative binary operators: IF . . . THEN THEOBLIGATION IS . . . , etc.

Page 50: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

DL* language (syntax)

I Non-normative connectives: NOT . . . , . . . AND . . . , . . .OR . . . , IF . . . THEN . . . , IFF . . . THEN . . .

I Normative unary connectives: OBLIGED . . . ,PERMITTED . . . , FORBIDDEN . . . , IDEALLY . . .

I Normative binary operators: IF . . . THEN THEOBLIGATION IS . . . , etc.

Page 51: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

DL* language (syntax)

I Non-normative connectives: NOT . . . , . . . AND . . . , . . .OR . . . , IF . . . THEN . . . , IFF . . . THEN . . .

I Normative unary connectives: OBLIGED . . . ,PERMITTED . . . , FORBIDDEN . . . , IDEALLY . . .

I Normative binary operators: IF . . . THEN THEOBLIGATION IS . . . , etc.

Page 52: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Equivalent (more concise) notation

I (~ . . . ), (. . . , . . . ), (. . . ; . . . )I (. . . => . . . ), (. . . <=> . . . )I (Ob . . . ), (Pm . . . ), (Fb . . . ), (Id . . . )I (. . . O> . . . ), (. . . P> . . . ), (. . . F> . . . )

Page 53: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

NAI

I Theoretically, we have a relatively expressive language whichhas automation

I We provide NAI - Normative AI toolI tools for making formalizations

I Focus of Tereza’s talk

I tools for reasoning over the formalizationI Focus of Alex’s talk

I In the rest of my talkI First-order DL*

I Note that fully understanding the logic is not necessary forusing the tool

I But it can help improving and understanding the formalizations

Page 54: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Generalization

I Before we have consideredI “Persons who are doctors and lawyers qualify”I “Is Andrew, who is a doctor, qualified?”

I We formalized it asI IF p1 THEN p3 AND IF p2 THEN p3I p1

I WhereI p1 means “The persons are lawyers”I p2 means “The persons are doctors”I p3 means “The persons qualify”

I What is the problem?

Page 55: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Need for generalization - problems

I Andrew is just one of the persons who are doctorsI Incorrect interpretation

I We cannot make a distinction between the peopleI Assume Jack is an engineer - p4I If we know that Andrew is a doctor and Jack is an engineer,

who is qualified?I IF p1 THEN p3 AND IF p2 THEN p3I p1I p4

I The prover answers p3.

Page 56: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Need for generalization - problems

I Andrew is just one of the persons who are doctorsI Incorrect interpretation

I We cannot make a distinction between the people

I Assume Jack is an engineer - p4I If we know that Andrew is a doctor and Jack is an engineer,

who is qualified?I IF p1 THEN p3 AND IF p2 THEN p3I p1I p4

I The prover answers p3.

Page 57: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Need for generalization - problems

I Andrew is just one of the persons who are doctorsI Incorrect interpretation

I We cannot make a distinction between the peopleI Assume Jack is an engineer - p4

I If we know that Andrew is a doctor and Jack is an engineer,who is qualified?

I IF p1 THEN p3 AND IF p2 THEN p3I p1I p4

I The prover answers p3.

Page 58: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Need for generalization - problems

I Andrew is just one of the persons who are doctorsI Incorrect interpretation

I We cannot make a distinction between the peopleI Assume Jack is an engineer - p4I If we know that Andrew is a doctor and Jack is an engineer,

who is qualified?I IF p1 THEN p3 AND IF p2 THEN p3I p1I p4

I The prover answers p3.

Page 59: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Need for generalization - problems

I Andrew is just one of the persons who are doctorsI Incorrect interpretation

I We cannot make a distinction between the peopleI Assume Jack is an engineer - p4I If we know that Andrew is a doctor and Jack is an engineer,

who is qualified?I IF p1 THEN p3 AND IF p2 THEN p3I p1I p4

I The prover answers p3.

Page 60: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Generalization

I SolutionI FOR ANY Person IF doctor(Person) THENqualified(Person)

I WhereI doctor means that Person is a doctorI qualified means that Person is qualified

Page 61: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

New formalization

1. FOR ANY Person IF doctor(Person) THENqualified(Person) AND IF lawyer(Person) THENqualified(Person)

2. doctor(andrew)3. engineer(jack)

I Deduce automatically: qualified(andrew)

I concise syntax

1. ((doctor(Person) => qualified(Person)),(lawyer(Person) => qualified(Person)))

2. doctor(andrew)3. engineer(jack)

Page 62: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

New formalization

1. FOR ANY Person IF doctor(Person) THENqualified(Person) AND IF lawyer(Person) THENqualified(Person)

2. doctor(andrew)3. engineer(jack)

I Deduce automatically: qualified(andrew)

I concise syntax

1. ((doctor(Person) => qualified(Person)),(lawyer(Person) => qualified(Person)))

2. doctor(andrew)3. engineer(jack)

Page 63: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Syntactical conventions

1. ((doctor(Person) => qualified(Person)),(lawyer(Person) => qualified(Person)))

2. doctor(andrew)3. engineer(jack)

I If a word starts with an Upper case letter, it refers to ANY

Page 64: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Some consequences

I Problems with propositions only are decidable

I Problems with variables are only semi-decidableI We are ensured of an answer only if the answer is trueI If it is not, the prover may never terminate

I This has implications on the automated process as we will seein Alex’s talk

Page 65: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

About us

Team

I Tereza - Legal expertiseI Alex - Implementation of the frontendI Matteo - Theory and researchI Tomer - Implementation of the backend, theory and research

I NAI is open source and open accessI We hope to have an interested and involved community

I We welcome help!

Page 66: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

About us

Team

I Tereza - Legal expertiseI Alex - Implementation of the frontendI Matteo - Theory and researchI Tomer - Implementation of the backend, theory and research

I NAI is open source and open accessI We hope to have an interested and involved community

I We welcome help!

Page 67: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

About us

Team

I Tereza - Legal expertiseI Alex - Implementation of the frontendI Matteo - Theory and researchI Tomer - Implementation of the backend, theory and research

I NAI is open source and open accessI We hope to have an interested and involved community

I We welcome help!

Page 68: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

How can lawyers help

I Use the tool and send us feedbackI SlackI https://github.com/normativeai/frontend/issues

I Help build a benchmark

I Help define the requirements and future of the tool

Page 69: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

How can researchers help

I Some possible topicsI New logical capabilities (abduction, model finding, etc.)I Explainable proofsI Implications of FOL on DL*I Extend the legal language (mainly to include powers)I Integration of defeasibility

I We will be happy to collaborate on these and other topics

Page 70: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

How can software engineers help

I Help improve the toolI Open source, just fix bugs and implement features and send us

a pull request on githubI Join our team and discussions

Page 71: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Apple T&C

I Long and intelligble for most peopleI Being signed by millions every day

I Including childrenI Can we make the world better?

I Once the document is formalized in NAII Graphs and visualizationI Automatic FAQI Automatic generation of comicsI . . .

I http://lawforme.in/

Page 72: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Apple T&C

I Long and intelligble for most peopleI Being signed by millions every day

I Including childrenI Can we make the world better?

I Once the document is formalized in NAII Graphs and visualizationI Automatic FAQI Automatic generation of comicsI . . .

I http://lawforme.in/

Page 73: Tutorial – Automated Deduction with Legal Texts ... · Challenges I Textcanbeambiguous,imprecise,requirescontext,spread overdifferentpages/documents I Example I Personswhoaredoctorsandlawyersqualify

Next part

I Tereza will show how to use the NAI tool in order to formalizelegislation and queries

I SlackI Will be used in the interactive sessionI Asking questions, giving feedback, suggesting improvementsI https://tinyurl.com/y2jzlhyr