Upload
allison-stafford
View
219
Download
0
Embed Size (px)
Citation preview
ICKEDS04 Porto 2004 Slide nº 1
UNIVERSIDADE NOVA DE LISBOAFaculdade de Ciências e Tecnologia - Departamento de Informática
Updating Legal Documents- The case of Phytosanitary Protection of Vegetables
Agostinho Monteiro and Luís Moniz Pereira
Centro de Inteligência Artificial – CENTRIA
ICKEDS04 Porto 2004 Slide nº 2
Goals
•Application of Logic Programming Updates to:
Problems involving legal reasoning
The case - Phytosanitary Protection of Vegetables and Vegetable Products
Legislation subject to frequent alterations
Legislation originating from different sources
Changing World
Nation’s organization
(EC evolved several times along the analyzed period)
Geography
(disappearance of DDR, Czechoslovakia, Yugoslavia and USSR, and the corresponding constitution of new countries).
•We use LUPS, a previously developed language, as an appropriate tool to represent legal documents
•We consider the possibility of use of this implementation in other, non related, areas.
ICKEDS04 Porto 2004 Slide nº 3
The Problem
Protection against the introduction and dispersion, in the EC states, of organisms harmful to vegetables and vegetable products
•Portugal adheres to the European Community (EC), in 1986
•It became imperative to adapt national legislation to European directives (Dir. 79/93/CEE)
•This directive was transcribed for the national legislation (DL 348/88)
DForbids the introduction of harmful organisms in groups of countries, countries or some specific areas;
DForbids the introduction of harmful organisms if original of groups of countries, countries or some specific areas.
•This groupings of countries changed along the considered time.
•Other countries were or disaggregated (USSR, DDR, etc.) or they originated new countries (Bosnia-Herzegovina, Slovakia, etc.).
ICKEDS04 Porto 2004 Slide nº 4
Requirements
•Total repeal (the whole ordinance) vs. Partial (only part);
•Allowed if not forbidden vs. Forbidden if not allowed (Without information to prohibit it is allowed );
•To inhibit vs. To contradict ;
•5 Attachments (some subdivided in parts – Prohibition in the whole country or in parts of it ):
DI - Only harmful organisms ;
DII - Harmful organisms if present in vegetables (in the country);
DIII – Specific vegetables ;
DIV – Specific demands requested for introduction ;
DV – Phytossanitary certificate demand
•The origins and the destinies may be singular and/or complex ;
•Exceptions exist .
ICKEDS04 Porto 2004 Slide nº 5
LUPS - Motivation
•Dynamic Logic Programming, by itself, doesn't provide a language to specify, or to program, alterations in logical programs .
•If knowledge is already represented by logical programs, dynamic programs just represent the evolution of that knowledge .
D How is that knowledge evolution specified?
D What makes it to evolve?.
•As logic programs describe knowledge states, it is intended that they also describe the transitions of knowledge states .
•Associating a group of transition rules to each state in order to obtain the next state, it is obtained an intercalated of states and transition rules.
•With the language of dynamic updates LUPS, both states and their transitions are made declarative.
ICKEDS04 Porto 2004 Slide nº 6
LUPS – Commands
assert L L1, ..., Lk
assert L L1, ..., Lk when Lk+1, ..., Lm
assert event L L1, ..., Lk when Lk+1, ..., Lm
retract L L1, ..., Lk when Lk+1, ..., Lm
retract event L L1, ..., Lk when Lk+1, ..., Lm
always L L1, ..., Lk when Lk+1, ..., Lm
always L L1, ..., Lk when Lk+1, ..., Lm
cancel L L1, ..., Lk when Lk+1, ..., Lm
holds L1, ..., Ln at q
ICKEDS04 Porto 2004 Slide nº 7
Design and Development
From the analysis of the ruling ordinances about Phytossanitary protection it resulted a regular structure, constituted by:
assert harm-org(‘Or 661-88’, ‘Ceratocystis coerulescens’, ‘Acer saccharum’, ‘Vegetable’ – ‘Whole’, ‘USA’, ‘Portugal’, ‘Plantation’).
•1. Indication of the rule, fact or exception’s constituent norm. Represented by the variable Norm;
•2. Identification of a harmful organism whose introduction and/or circulation is intended to prohibit . This identification is represented by the variable Organism;
•3. A product in which the occurrence of the harmful organism is verified, when that is the case, or the product itself. Represented by the variable Product;
•4. The form presented by the product when it is analyzed. Represented by the variable Form;
•5. The origin or, sometimes, the product’s production place. Represented by the variable Origin;
•6. The geographical destiny of the product, which can be a grouping of countries, an isolated country or even a group of specific areas. Represented by the variable Destiny e, finally ;
•7. The application it is destined to. Represented by the variable Purpose.
ICKEDS04 Porto 2004 Slide nº 8
Groupings of countries - Acronyms
CM Community
NC Third (Not community )
EU Europe
OE Out of Europe
NA North America
CA Central America
SA South America
AM America
MD Mediterranean
EC Ex. Czechoslovakia
EJ Ex. Yugoslavia
ER Ex. URSS
EA Ex. DDR
Asia Asia
ICKEDS04 Porto 2004 Slide nº 9
Knowledge Base Update - Part 1
State 01 updateF(‘genesis.p’). Beginning of the World
State 02 updateF(‘definicoes.p’). Initial definitions
State 03 updateF(‘update union-1957.p’). Beginning of the Community
State 04 updateF(‘update union-1973.p’). United Kingdom, Ireland, Denmark
State 05 updateF(‘update union-1981.p’). Greece
State 06 updateF(‘update union-1986.p’). Portugal, Spain
State 07 updateF(‘update 661-88 Rules.p’). Ordinance 661/88
State 08 updateF(‘update 661-88 Facts.p’).
State 09 updateF(‘update 661-88 Exceptions.p’).
ICKEDS04 Porto 2004 Slide nº 10
Knowledge Base Update - Part 2
State 10 updateF(‘update exCzech-1990.p’).
State 11 updateF(‘update exDDR-1990.p’).
State 12 updateF(‘update exUrss-1990.p’).
State 13 updateF(‘update exYugo-1991.p’).
State 14 updateF(‘update exUrss-1991.p’).
State 15 updateF(‘update exYugo-1992.p’).
State 16 updateF(‘update 344-94 Rules.p’). Ordinance 344/94
State 17 updateF(‘update 344-94-88 Facts.p’).
State 18 updateF(‘update 344-94-88 Exceptions.p’).
State 19 updateF(‘update union -1995.p’). Austria, Finland, Sweden
ICKEDS04 Porto 2004 Slide nº 11
Text of an Ordinance – An example
Ordinance 344-94 - Attachment II
PART A
Harmful organisms whose introduction and dispersion is forbidden inside the Country and in the remaining member States since they are present in certain vegetables or
vegetable products
Section I
Harmful organisms not existing in the Community and important for the whole Community
a) Insects, acaroids and nematodes in any phase or in development
Species Vegetables and vegetable products
1 – Aculops fuchsiae Keifer.................... Vegetables of Fuchsia L., destined to
plantation, except seeds.
ICKEDS04 Porto 2004 Slide nº 12
Implementation example
Usually, rules have the following structure:
assert forb-to-intro(Norm, Organism, Product, Form, Origin, Destiny, Purpose) in_force(‘Or344-94'),in_force(Norm), harm-org(Norm, Organism, Product, Form, '', 'CM', Purpose), community(Destiny).
The specification of this prohibition is made by addition of new information with fact
assert harm-org(‘Or 344-94’, 'Aculops fuchsiae', 'Fuchsia L.', 'Vegetable' - ‘Whole', '', 'CM', 'Plantation').
The exception, to be added in the next state, will contradict the prohibition case it is related to a vegetable in the form of seeds.
assert not forb-to-intro(‘Or 344-94’, 'Aculops fuchsiae', 'Fuchsia L.', 'Vegetable' - 'Seed', '', 'CM', 'Plantation').
The interrogation of the knowledge base will be done, for instance, with the LUPS command holds.
holds forb-to-intro(Norm, 'Aculops fuchsiae', 'Fuchsia L.', Vegetable, '', Country, 'Plantation') at State.
ICKEDS04 Porto 2004 Slide nº 13
Experience 11. Interrogation 14
Vegetables or vegetable products Harmful organisms
1 – Vegetables destined to plantation , excepting seeds, fruits or cut flowers:A) Forest :Acer (Acer saccharum), original of United States
Ceratocystis coerulescens (Munch) Back.
Rules assert forb-to-intro(Norm, Organism, Product, Form, Origin, Destiny, Purpose) in-force(‘Or 661-88’), in-force(Norm), harm-org(Norm, Organism, Product, Form, Origin, Destiny, Purpose), prolog(Destiny == ‘Portugal’).
Facts assert harm-org(‘Or661-88’, ‘Ceratocystis coerulescens’, ‘Acer saccharum’, ‘Vegetable’ – ‘Whole’, ‘USA’, ‘Portugal’, ‘Plantation’).
Exceptions assert not forb-to-intro(‘Or661-88', 'Ceratocystis coerulescens', 'Acer saccharum', 'Vegetable'- 'Seed', ‘USA', 'Portugal', 'Plantation').
assert not forb-to-intro(‘Or 661-88', 'Ceratocystis coerulescens', 'Acer saccharum', 'Vegetal'- 'Fruit', ‘USA', 'Portugal', 'Plantation').
assert not forb-to-intro(‘Or 661-88', 'Ceratocystis coerulescens', 'Acer saccharum', 'Vegetal'- 'Flower', ‘USA', 'Portugal', 'Plantation').
Interrogation holds forb-to-intro(Norm, 'Ceratocystis coerulescens ', ‘Acer saccharum’, ‘Vegetable’ – ‘Whole’, ‘USA’, ‘Portugal’, ‘Plantation’) at 8.
Result Norma = Or661-88
ICKEDS04 Porto 2004 Slide nº 14
Experience 13. Articulate
CommunityThird Europe
Third Europe (Forbidden) Out of Europe
Turkey (Forbidden)
URSS (Forbidden)
Exceptions: Algeria, Cyprus, Egypt, Israel, Libya, Malta, Morocco, Syria, Tunisia.
Designation Country of origin
1 – Vegetable products :2.1 – Potato tubers (Solanum tuberosum L.), except those officially recognized as potato-seed .
Turkey, USSR and other third countries not belonging to continental Europe, with exception of: Algeria, Cyprus, Egypt, Israel, Libya, Malta, Morocco, Syria, and Tunisia.
Analysis
ICKEDS04 Porto 2004 Slide nº 15
Experience 13. Rules, Facts and Exceptions
Rules assert forb-to-intro(Norm, Product, Form, Origin, Destiny, Purpose) in-force(‘Or661-88'), in-force(Norm), harm-org(Norm, Product, Form, 'NE', Destiny, Purpose), not europe(Origin), prolog(Destiny == 'Portugal'). assert forb-to-intro(Norm, Product, Form, Origin, Destiny, Purpose) in-force(‘Or661-88'), in-force(Norm), harm-org(Norm, Product, Form, Origin, Destiny, Purpose), prolog(Destiny == 'Portugal').
Facts assert harm-org(‘Or 661-88', 'Solanum tuberosum L.', 'Vegetable' - 'Tuber ', 'Turkey ', 'Portugal', '').assert harm-org(‘Or 661-88', 'Solanum tuberosum L.', 'Vegetable' - 'Tuber ', 'URSS', 'Portugal', '').assert harm-org(‘Or 661-88', 'Solanum tuberosum L.', 'Vegetable' - 'Tuber ', 'URSS' - 'Estonia ', 'Portugal', '').assert harm-org(‘Or 661-88', 'Solanum tuberosum L.', 'Vegetable' - 'Tuber ', 'NE', 'Portugal', '').
Exceptions % ('III-A-2.1') assert not forb-to-intro(‘Or 661-88', 'Solanum tuberosum L.', 'Vegetable' - 'Tuber ', 'Algeria ', 'Portugal', '').... assert not forb-to-intro(‘Or 661-88', 'Solanum tuberosum L.', 'Vegetable' - 'Seed ', 'Tunisia ', 'Portugal', '').
ICKEDS04 Porto 2004 Slide nº 16
Experience 13. Interrogations
Query holds forb-to-intro(Norm, 'Solanum tuberosum L.', 'Vegetable ' - 'Tuber ', 'USA ', ‘Portugal’, ‘’) at 8.
Result Norm = Or 661-88
Query 21
Query 22
Query holds forb-to-intro(Norm, 'Solanum tuberosum L.', 'Vegetable ' - 'Tuber ', 'Algeria ', ‘Portugal’, ‘’) at 8.
Result Norm = Or 661-88
Query 23
Query holds forb-to-intro(Norm, 'Solanum tuberosum L.', 'Vegetable ' - 'Tuber ', 'URSS’ – ‘Estonia', ‘Portugal’, ‘’) at 9.
Result Norma = Or661-88
Query 24
Query holds forb-to-intro(Norm, 'Solanum tuberosum L.', 'Vegetable ' - 'Tuber ', 'Algeria ', ‘Portugal’, ‘’) at 9.
Result No
ICKEDS04 Porto 2004 Slide nº 17
Experience 15
Vegetables and culture Means Specific demands
1 – Rooted vegetables, planted or destined the plantation
Official verification that the culture field is exempt of Synchytrium endobioticum, of Globodera rostochiensis and of Corynbacterium sepedonicum.
Rules assert must-resp(Norm, Product, Form, Origin, Destiny, Purpose, Exigency) in-force(Norm), in-force(‘Or 661-88’), has-exig(Norm, Product, Form, Origin, Destiny, Purpose, Exigency), prolog(Destiny == ‘Portugal’).
Facts % (‘IV-1-1.1’)assert has-exig(‘Or 661-88’, _, ‘Vegetable ’ – ‘Rooted ’, _, ‘Portugal’, ‘’, ‘Or 661-88 IV-1-1.1’).assert has-exig(‘Or 661-88’, _, ‘Vegetable ’ – ‘Plantado’, _, ‘Portugal’, ‘’, ‘Or 661-88 IV-1-1.1’).assert has-exig(‘Or 661-88’, _, ‘Vegetable ’, _, ‘Portugal’, ‘Plantation’, ‘Or 661-88 IV-1-1.1’).assert has-exig(‘Or 661-88’, _, ‘Vegetable ’ - _, _, ‘Portugal’, ‘Plantation’, ‘Or 661-88 IV-1-1.1’).
Query holds must-resp(Norm, ‘Citrus L.’, 'Vegetable ' – ‘Rooted’, ‘’, ‘Portugal’, ‘’, Exigency) at 9.
Result Norm = Or 661-88Exigency = Or 661-88 IV-1-1.1;
Query holds must-resp(Norm, ‘Citrus L.’, ‘Vegetable ’, ‘Poland ’, ‘Portugal’, ‘Plantation’, Exigency) at 9.
Result Norm = Or 661-88Exigency = Pt 661-88 IV-1-1.1;
ICKEDS04 Porto 2004 Slide nº 18
Maintenance
Analysis and interpretation of the legislation and/or of the world
If partial repeal or change on the world
Identify the rules, facts and/or exceptions to modify/delete
While exist rules, facts and/or exceptions to modify/delete
Inhibit or delete those rules, facts and/or exceptions (a program for each type ) with not or retract
If modification
Add a rule, fact and/or exception to modify with assert
end If
end While
else
Add the assert not in-force(ordinance_to_repeal)
Add the assert in-force(new-ordinance)
Add the new rules, facts and/or exceptions (a program for each type )
End If
ICKEDS04 Porto 2004 Slide nº 19
Other application areas
•Situations that involve borders ;
•Situations that forbid or condition the entrance of certain objects, when present in others, have a certain form, be original of some place, and have as destiny another one (both can be structured ) and are destined to some purpose .
This framing, eventually with small modifications, may be found in areas such as:
Biology (Micro-organisms) ;
Medical (Drugs);
Environment (Industrial and/or nuclear residues, etc.);
Economics (Customs) ;
Bordering (Schengen Agreement );
Military (Armament) .
Terrorism;
ICKEDS04 Porto 2004 Slide nº 20
Conclusions
•In spite of, along the considered period of time, the Community and the World have evolved substantially, it is very easy to update the Knowledge Base, in a declarative way, with the new acquired information (sequences of programs).
•With Dynamic Logic Programming and the language LUPS (itself developed in Logic Programming), it is enough the creation of a new update program (here understood as a text file), for each state we intend to represent ;
•It is possible to interrogate the Knowledge Base in former states, by simply specifying those states or, inversely , to obtain information concerning the state in which certain situation was true.
•It was not necessary to use the totality of the potentialities made available by this language (in reality only a small part was used) because it was not necessary to specify, for instance, events (event) and/or conditions (when) for the transition of States .
•Logic Programming, namely DLP, and its implementation LUPS, are appropriate to represent legal problems that, as in this case, involve borders ;
ICKEDS04 Porto 2004 Slide nº 21
Contacts
•A copy of the used code can be requested by email to
•The implementation LUPS, is available in the site
http://centria.di.fct.unl.pt~jja/updates
•A version of XSB Prolog can be obtained in
http://xsb.sourceforge.net/
ICKEDS04 Porto 2004 Slide nº 22
Program updates
Rewriting each clause of the original program P
A B1, ..., Bm, not C1, …, not Cn becomes AP B1, ..., Bm, C1-, …, Cn
-
not A B1, ..., Bm, not C1, …, not Cn becomes AP- B1, ..., Bm, C1
-, …, Cn-
Rewriting each clause of the update program U
A B1, ..., Bm, not C1, …, not Cn becomes AU B1, ..., Bm, C1-, …, Cn
-
not A B1, ..., Bm, not C1, …, not Cn becomes AU- B1, ..., Bm, C1
-, …, Cn-
Update rules
A AU
A- AU- for all objective atoms A K
Inheritance rules
A AP, not AU-
A- AP-, not AU for all objective atoms A K
default rules
A- not AP, not AU
not A A- for all objective atoms A K.
ICKEDS04 Porto 2004 Slide nº 23
Semantic characterization of Program Updates
Extended interpretation
A- M’ iff not A M
AP M’ iff A Body P and M ╞ Body
AP- M’ iff not A Body P e M ╞ Body
AU M’ iff A Body U e M ╞ Body
AU- M’ iff not A Body U e M ╞ Body
Defaults, rejected and residual
Defaults[M] = {not A: M ╞ Body , (A Body ) P U}
Rejected[M] = {A Body P : (not A Body ’ U) e M ╞ Body ’}
{ not A Body P : (A Body ’ U) e M ╞ Body ’}
Residue[M] = P Rejected[M]
ICKEDS04 Porto 2004 Slide nº 24
Dynamic Program Update
Rewriting each clause of the original program P where s S
A B1, ..., Bm, not C1, …, not Cn becomes APs B1, ..., Bm, C1-, …, Cn
-
not A B1, ..., Bm, not C1, …, not Cn becomes APs- B1, ..., Bm, C1
-, …, Cn-
Update rules where s S
A APs
A- APs- for all objective atoms A K
Inheritance rules where s S
AS AS-1, not reject(AS-1)
AS- AS-1
-, not reject(AS-1-)
reject(AS-1) APs-
reject(AS-1-) APs
- for all objective atoms A K
Default rules
A0- for all objective atoms A K.
Current state rules where s S
A AS
A- AS-
not A AS- for all objective atoms A K