2019/2/3

Session: VI(B) "Experiences in Accessing the Law Across the Globe"

LVI2018＠Firenze

Legislation Supporting System
Based on Legal Computer Programming
as SDL (Software Defined Law)
October 12, 2018
Makoto NAKAMURA
Tokuyasu KAKUTA
Research and Development
Initiative, Chuo University
Professor

Department of Engineering,
Niigata Institute of Technology
Associate Professor©2018Tokuyasu Kakuta

Agenda１．Background２．Basic Idea‐‐‐ Similarity between software development and legislation
３．Products
４．Approach‐‐‐ SDL (Software Defined Law) by drafting in Python
５．Example and simulation
６．Conclusion
７．Demonstration： Xelen for legislation supporting software

12019/2/3

Background

Problem
Making laws takes a lot of efforts and is troublesome.
The meaning is difficult!
Sharing laws is difficult(without EU)

For instance

The style is too technical!
(Especially in Japan)
Because of the difference of languages
Although many countries share similar
legal systems!

Approach
Provide a supporting web system for the legislation works

We adopt Python codes

Features* Our approach is like software development.
* Our system deals with computer programs corresponding to laws.
* The system and the laws can be shared across the globe via theInternet (because programming languages are shared in globe).

Similarities between Software Development
and Legislation
Our Basic Idea
SoftwareDevelopment Basic
Process
Specification

Water Fall Model

DetailSpecification

Source CodeRequirement
Definition

Basic Design Detail DesignCoding

Collecting
Legal Facts

Legal Policy
MakingDrafting(Requirements)

Legislation
Process

Legal Policy
PlanEx)Legal Policy
Making more
DetailOutlineof Draft Law

by stepwise refinement

Test

ReleaseAssembly Publication

Draft Law

Coding is done in accordance with the grammar based on the previous output.
Drafting law is done in accordance with the manner based on the previous output.

The similarities ⇒ We can apply tools and approaches of software development to legislation.

22019/2/3

Our products
Planning
LegalPolicy

Using programming language “Python”
legislation supporting web system ：Xelen

Legislation
EditorGovernment
workerSince most of users
cannot write Python,
this composes itby only filling in ourconceptual templates
without writing Python.

Programming
supportingGUIFig. Legend
Our Products(Software systems)
System Outputs(Codes or Documents)

Computer
Program asLawLegislation
Compiler

Law

Converterfrom python
to Law

Built‐inSimulator of Law
For checking actionsof laweLen
Ordinance DB webfor legislation supporting●Already released since 2012
●To all of local governments• eLen = e‐Legislation environment• Xelen = eXtended eLen

Legislation Supporting Web System:
Xelen

If this link is clicked,
the system makes
the python program.

If this link is clicked, thesystem convert thepython program to thelaw in natural language.

The user writes valuesof any items.
The items areprepared as typicalcases in our systemlibrary “LLib”.

32019/2/3

Our Approach：SDL（Software Defined Law）
Our systems are designed based on our SDL approach as drafting law in Python.

SD approach is a trend of IT area.
Ex) SDN：Software Defined Network
SDS: Software Defined Security
Our project also takes advantage of the trend. :P

SDL Approach:●Can simulate situations of laws directly.
●Makes descriptions of law more precise and objective thandrafting the law in natural language.
●Can divert knowledge and tools from software developments.
●Is language independent.
⇒ Can share the knowledge of similar legal systems amongcountries (across the globe).

Ordinance on the XX City Comprehensive Welfare Center

Sample Ordinance(Purport)
Article 1 As the base for promoting the activities of local welfare, the XX City Comprehensive Welfare Center
shall be established in order to achieve the promotion of health and social participation.
(Establishment)
Article 2 The XX City Comprehensive Welfare Center (hereinafter referred to as the "center") shall beestablished at 1‐1, ..., XX City.
(Services)
Article 3 The center provide the following services:(1) Exchanges of various generations(2) hobby‐oriented and recreational programs(Holidays)
Article 4 The center closes on ‐(1) Sundays, and(2) a holiday set forth in the National Holidays Act.
(Hours of Opening)
Article 5 The center runs from 9 a.m. to 4:30 p.m., opening hours.
(Designated Administrators)
Article 6 The mayor shall designate juridical persons or other organizations to administrate the center.
(Permission of Utilization)
Article 7 A person who intends to utilize the center must obtain the permission from the designatedadministrator.
(Fee)
Article 8 A person who has obtained a permission must pay a fee for the utilization of the center.
(User Responsibilities)
Article 9 Users of the center must not transfer or sublease the right which has arisen from the permission ofutilization.

4

2019/2/3

The Sample Law Program

module：Wcenter.py

from LLib import *Descripted in Python
MyCity= Cities["XX City, YY Pref."]
Title="Ordinance on the XX City Comprehensive Welfare Center"
MyCity="XX City, YY Pref."Purport="As the base for promoting the activities of local welfare, the XX City
Comprehensive Welfare Center shall be established in order to achieve the promotion ofhealth and social participation."
Center=facility( "The XX City Comprehensive Welfare Center" )Center.place="1‐1, ..., XX City"
Center.functions=[ "Exchanges of various generations", "hobby‐oriented and recreational
programs" ]Center.closedDays=[ "Sundays", "a holiday set forth in the National Holidays Act" ]Center.openTime="AM0900‐PM0430"
Center.admin=role("group",do("allowed",MyCity.Mayor,permit(“administrate",Center))))
User=role("human",do("allowed", Center.admin,permit("use",Center)))
User.obligation.append(do("pay", MyCity, fee("use",Center)))
User.obligation.append(prohibit("give", anyone(), User.rigts))
User.obligation.append(prohibit("lease", anyone(), User.rigts))
Commission=commission_enforcement(MyCity.Mayor)
Forms={1:newform('user'),12:newform(‘admin')}Sample Case for Python Simulation of Law
Taro applies to the administrator by an application
form for using the center.
The administrator permits the use.
Taro cannot give the right of the use to Naomi.
After using the center, Taro has no right of the use.

Mayor of XX City
Delegates

Citizens of XX City
Apply

Applied Queue

Application Form

Administrator of thecenter
Select and Permit

Apply
Taro

List of Taro’s Rights
Rightof Use

Try to Give

Naomi

Execute the Right(Play at the center)

Failed by Python because ofprohibiting the transfer(=giving)of the rightby the ordinance.

Delete (after theexecution of theright of use)

The center52019/2/3

Simulation log for the sample casefrom LLib import *import Wcenter
Mayor=Cities[“XX City“].mayor
Admin=Wcenter.admin
User=Wcenter.user
X=corporation(“Takahashi Corp.")
Form=getform(Wcenter.Forms[12])Form.name=X.name
Documents={(“plan", "xxx.doc"), ("articles of incorporation", "yyy.doc")}
apply(Admin, X, Mayor,Form, Documents)
assign(Mayor, Admin.ApplQ[“Takahashi Corp."])print '>'+Admin.members[0].name>Takahashi Corp.
Y=person(“Taro Yamada")
Y.age=35
UForm=getform(Wcenter.Forms[1])UForm.name=Y.name
UForm.date="2018/10/11"
UForm.place="U‐type room"
apply(Y, Admin, User, UForm, 300)
permit(Admin, User.ApplQ[“Taro Yamada"])
Z=person(“Naomi Suzuki")
Z.age=25
print '>'+Y.Rights[0].type>use
print '>'+exec(Y, "give", Z, Y.Rights[0])>Falseexec(Y, "execute", Y.Rights[0])print '>'+Y.Rights>[]

Preparations ofPythonenvironments
Administrator
application
Mayor assigns
User(Taro)application
Permission of Use
User actions

We check Taro’s
final states.

Conclusion and Our HopeConclusion：●Our proposal is SDL approach for drafting laws
by Python as the drafting software.
●Our SDL system is “Xelen”. (The demonstration is later.)
Our Hope：
If many countries can collaborate to provide and send boththeir own laws in natural language and its Python codes to us,
we can also enrich Xelen more by machine learning.
As a result, new style of Legislation by Xelen can be used andshared in all over the world via the Internet (=across the globe).

Continue with our demonstration …
* This research is promoted by the research grant of
SECOM Science and Technology Foundation.

6

2019/2/3

Demonstration
Xelen System(under development)

7