42
Approach and a Study of Luxembourg’s Tax Law Ghanem Soltana Elizabeta Fourneret Morayo Adedjouma Mehrdad Sabetzadeh Lionel Briand University of Luxembourg, Luxembourg Using UML for Modeling Procedural Legal Rules .lu software verification & validation V V S

Using UML for Modeling Procedural Legal Rules

Embed Size (px)

Citation preview

Approach and a Study of Luxembourg’s Tax Law!

Ghanem Soltana Elizabeta Fourneret Morayo Adedjouma !

Mehrdad Sabetzadeh Lionel Briand

University of Luxembourg, Luxembourg!

Using UML for Modeling Procedural Legal Rules

.lusoftware verification & validationVVS

How did this work come about?• Collaboration with

Government of Luxembourg

• CTIE: Government’s IT Centre

• ACD: Tax Administration Department

• New tax system under development

• System needs to be compliant with the law

2

No

Context and motivation

3

Test cases

Actual software system

Traces to

Traces to

Input

to

Input to Analyzable

interpretation of the law

Actual result

Simulated result

Generates

Results match?

Yes

Impact of fiscal decisions

Simulates

Tax Law

Context and motivation

4

Analyzable interpretation

of the law

Focus of the talk:!What needs to be modeled?

What language to use? What methodology to apply?

Related work

• Dutch legislation: UML Class Diagrams + OCL [van Engers et al., 2001]

• US Internal Revenue Code: ontologies [Melz et al., 2004]

• US healthcare: rule-based framework [Breaux, 2009]

5

What are the differences?

6

• Modeling procedural & administrative aspects !!!!

• Support for automated verification in various form !

Research steps

7

2. Build UML profile

3. Use profile for transforming

models

• What information content should we expect?

• What are the complexity factors?

• Explicit means for capturing information requirements

• Basis for modeling methodology

• Reuse existing automation techniques

• Solvers for testing • MATLAB for simulation

1. Conduct grounded theory

study

• Legal framework composed of legislation, regulations, and circulars !

• Framework has prescriptive nature

Procedure for calculating FD

deduction

What does the tax law look like?

8

Art. 105bis […]The commuting expenses deduction (FD) is defined as a function over the distance between the principal town of the municipality on whose territory the taxpayer's home is located and the place of taxpayer’s work. The distance is measured in units of distance expressing the kilometric distance between [principal] towns. A ministerial regulation provides these distances. !The amount of the deduction is calculated as follows: If the distance exceeds 4 units but is less than 30 units, the deduction is € 99 per unit of distance. The first 4 units does not trigger any deduction and the deduction for a distance exceeding 30 units is limited to € 2,574.

{{

Legal concepts definition

!Grounded theory coding of 16 articles from Luxembourg’s Income Tax Law

Art. 105bis […]The commuting expenses deduction (FD) is defined as a function over the distance between the principal town of the municipality on whose territory the taxpayer's home is located and the place of taxpayer’s work. The distance is measured in units of distance expressing the kilometric distance between [principal] towns. A ministerial regulation provides these distances. !The amount of the deduction is calculated as follows: If the distance exceeds 4 units but is less than 30 units, the deduction is € 99 per unit of distance. The first 4 units does not trigger any deduction and the deduction for a distance exceeding 30 units is limited to € 2,574.

Meta-concepts in prescriptive laws

9

DecisionOperation

Information requirements (1)

10

Traceability Package

Legal Text

Legal Agent Record

Information Source

1..*

0..1

Process Package

Step

Data Object

*

1..*has as input

0..1

produces as output

1..*

originates from

is derived from

Datatype Package

StringNumeric

SetDatatype

Boolean Domain Object

Age PercentageDistance Unit

Monetary Value

1

DecisionOperation

Date

Legal Rule

Information requirements (2)

11

Traceability Package

Legal Text

Legal Agent Record

Information Source

1..*

0..1

Process Package

Step

Data Object

*

1..*has as input

0..1

produces as output

1..*

has as typeDatatype Package

StringNumeric

SetDatatype

Boolean Domain Object

Age PercentageDistance Unit

Monetary Value

1*

DecisionOperation

Date

▲▲

Legal Rule

Information requirements (3)

12

Traceability Package

Legal Text

Legal Agent Record

Information Source

1..*

0..1

Process Package

Step

Data Object

*

1..*has as input

0..1

produces as output

1..*

1..* has as type

originates from

is derived from

Datatype Package

StringNumeric

SetDatatype

Boolean Domain Object

Age PercentageDistance Unit

Monetary Value

1*

DecisionOperation

Date

Legal Rule

1

OCL complexity factors (1)

13

Numerous branches!!!

Art. 2 Individuals are considered resident taxpayers if they have their address in the Grand Duchy. Individuals are considered non-resident taxpayers if they do not reside in the Grand Duchy but have a local income within the definition of Article 156.

context TaxPayer inv ResidentialStatus:

let hasLocalAddress:Boolean = self.addresses!select(a:Address | a.country = Country::LU)

!notEmpty() inif hasLocalAddress then

self.oclIsTypeOf(ResidentTaxPayer)else

let hasLocalIncomes:Boolean = self.incomes!select(i:Income | i.oclIsTypeOf(LocalIncome))

!notEmpty() inif hasLocalIncome then

self.oclIsTypeOf(NonResidentTaxPayer)

elsefalse

endifendif

self.taxPayerDependents!select(dependent:Person | not dependent.oclIsTypeOf(TaxPayer) anddependent.addresses!intersection(self.addresses)!notEmpty() anddependent.allowances.amount!sum>0)

14

OCL complexity factors (2)

Art. 127 […]. An eligible dependent is a person who lives in the same household as the taxpayer but is not taxpayer himself. Only dependent receiving some allowances from the government are eligible.

Lengthy navigations!!!

15

OCL complexity factors (3)

Art. 127bis On request, the taxpayer gets a deduction for extraordinary expenses for children care. When children under the age of twenty-one are maintained and educated mostly by the taxpayer, the total amount of all expenses dedicated to these children is considered as extraordinary expenses. However, extraordinary expenses defined by the current article must not exceed 3.480 euros per year and per child […]

Nested iterations

context TaxPayer inv CE3:

let tax year:Date = self.tax year,

incomes:Set(Income) = self.incomes!select(i:Income | i.year = tax year),

dependents:Set(Dependent) = self.dependents!select(d:Dependent | d.age < 21 )

in

incomes!forAll(inc:Income |dependents!forAll(dep:Dependent |

let total expenses:MonetaryValue = inc.expenses!select(exp:Expense | exp.beneficiary = dep)!sum()

in

if total expenses < 3480 then

total expenses = inc.getCE3(tax year).amount

else inc.getCE3(tax year).amount = 3480 endif))

16

2. Build UML profile

3. Use profile for transforming

models

• What information content should we expect?

• What are the complexity factors?

• Explicit means for capturing information requirements

• Basis for modeling methodology

• Reuse existing automation techniques

• Solvers for testing • MATLAB for simulation

1. Conduct grounded theory

study

Background: UML Profiles are a standard mechanism to extend UML with

domain-specific modeling concepts

Characteristics of our profile

17

Our UML profile: !• Customizes the activity modeling fragment of UML !!• Provides stereotypes for capturing information

requirements !!• Has built-in consistency constraints to ensure correct

use of the profile !!!

18

Art. 105bis […]The commuting expenses deduction (FD) is defined as a function over the distance between the principal town of the municipality on whose territory the taxpayer's home is located and the place of taxpayer’s work. The distance is measured in units of distance expressing the kilometric distance between [principal] towns. A ministerial regulation provides these distances. !The amount of the deduction is calculated as follows: If the distance exceeds 4 units but is less than 30 units, the deduction is € 99 per unit of distance. The first 4 units does not trigger any deduction and the deduction for a distance exceeding 30 units is limited to € 2,574.

Profile illustrated on an example

«rule» «context» TaxPayer

19

OCL context

Decisions and operations (1)

20

: MonetaryValue

«intermediate» expected_amount

«assert» Check correctness of

deduction granted to taxpayer

«rule» «context» TaxPayer

«calculate»

No deductionno (false)

«decision» distance >

minimal_distance

«statement» actual_amount =

expected_amount

«formula»

0 (zero)

Decisions and operations (2)

21

: MonetaryValue

«intermediate» expected_amount

«calculate» Normal rate per unit for declared distance

«assert» Check correctness of

deduction granted to taxpayer

«rule» «context» TaxPayer

distance < maximal_distance

«formula»

«calculate»

No deduction

yes (true)

yes (true)

no (false)«decision»

«decision»

distance > minimal_distance

«statement» actual_amount =

expected_amount

prorata_period * flat_rate * distance

«formula» 0 (zero)

Decisions and operations (3)

22

no (false)

: MonetaryValue

«intermediate» expected_amount

«calculate» Normal rate per unit for declared distance

«assert» Check correctness of

deduction granted to taxpayer

«rule» «context» TaxPayer

distance < maximal_distance

«calculate» Special flat rate for maximal distance

«formula»

«calculate»

No deduction

yes (true)

yes (true)

no (false)«decision»

«decision»

distance > minimal_distance

«statement» actual_amount =

expected_amount

prorata_period * flat_rate * distance

«formula» prorata_period * maximal_flat_rate

«formula» 0 (zero)

Iterations

23

no (false)

: MonetaryValue

«intermediate» expected_amount

«calculate» Normal rate per unit for declared distance

«assert» Check correctness of

deduction granted to taxpayer

«rule» «iterative»

inc : Income

«context» TaxPayer

OCL: self.incomes-> select(i:Income| i.year = tax_year)

«query» Agent type: OfficerQuestion: When was the request postmarked?

incomes«in»

tax_year«fromagent»

distance < maximal_distance

«fromrecord»

«in»

«calculate» Special flat rate for maximal distance

«formula»

«calculate»

No deduction

yes (true)

«query»

yes (true)

no (false)«decision»

«decision»

distance > minimal_distance

«statement» actual_amount =

expected_amount

prorata_period * flat_rate * distance

«formula» prorata_period * maximal_flat_rate

«formula» 0 (zero)

Inputs (1)

24

no (false)

: MonetaryValue

«intermediate» expected_amount

«calculate» Normal rate per unit for declared distance

«assert» Check correctness of

deduction granted to taxpayer

«rule» «iterative»

inc : Income

«context» TaxPayer

OCL: self.incomes-> select(i:Income| i.year = tax_year)

«query» Agent type: OfficerQuestion: When was the request postmarked?

incomes«in»

tax_year«fromagent»

distance < maximal_distance

«fromrecord»

«in»

«calculate» Special flat rate for maximal distance

«formula»

«calculate»

No deduction

yes (true)

«query»

OCL: inc.getFD (tax_year).amount

actual_amount«in» «fromrecord»

«query»

OCL: inc.prorata_periodprorata_period«in» «fromrecord»

«query»

flat_rate

minimal_distance

maximal_distance

«fromlaw» «in»

«fromlaw» «in»

«fromlaw» «in»

maximal_flat_rate«fromlaw» «in»

yes (true)

no (false)«decision»

«decision»

distance > minimal_distance

«statement» actual_amount =

expected_amount

prorata_period * flat_rate * distance

«formula» prorata_period * maximal_flat_rate

«formula» 0 (zero)

distance«fromrecord» «in»

«query» OCL: inc.distance Source: Ministerial Regulation of February 6, 2012

Source: Art. 105bis of the LITL, 2013

«query»

25

no (false)

: MonetaryValue

«intermediate» expected_amount

«calculate» Normal rate per unit for declared distance

«assert» Check correctness of

deduction granted to taxpayer

«rule» «iterative»

inc : Income

«context» TaxPayer

OCL: self.incomes-> select(i:Income| i.year = tax_year)

«query» Agent type: OfficerQuestion: When was the request postmarked?

incomes«in»

tax_year«fromagent»

distance < maximal_distance

«fromrecord»

«in»

«calculate» Special flat rate for maximal distance

«formula»

«calculate»

No deduction

yes (true)

«query»

OCL: inc.getFD (tax_year).amount

actual_amount«in» «fromrecord»

«query»

OCL: inc.prorata_periodprorata_period«in» «fromrecord»

«query»

flat_rate

minimal_distance

maximal_distance

«fromlaw» «in»

«fromlaw» «in»

«fromlaw» «in»

maximal_flat_rate«fromlaw» «in»

yes (true)

no (false)«decision»

«decision»

distance > minimal_distance

«statement» actual_amount =

expected_amount

prorata_period * flat_rate * distance

«formula» prorata_period * maximal_flat_rate

«formula» 0 (zero)

distance«fromrecord» «in»

«query» OCL: inc.distance Source: Ministerial Regulation of February 6, 2012

Source: Art. 105bis of the LITL, 2013

«query»

IncomeTaxDeduction

Address

TaxPayer

- flat_rate- maximal_flat_rate- maximal_distance- minimal_distance

Constant«enumera(on»

*

* taxpayer

*

incomes1lives at

*

*

*is accomplished at

1..*

CommutingExpenseDeduction

is based on

*

*

*works at

Service

is paid for0..11

Income- distance:DistanceUnit- prorata_period:NumbergetFD(Date):MonetaryValue

1..*

Inputs (2)

26

no (false)

: MonetaryValue

«intermediate» expected_amount

«calculate» Normal rate per unit for declared distance

«assert» Check correctness of

deduction granted to taxpayer

«rule» «iterative»

inc : Income

«context» TaxPayer

OCL: self.incomes-> select(i:Income| i.year = tax_year)

«query» Agent type: OfficerQuestion: When was the request postmarked?

incomes«in»

tax_year«fromagent»

distance < maximal_distance

«fromrecord»

«in»

«calculate» Special flat rate for maximal distance

«formula»

«calculate»

No deduction

yes (true)

«query»

OCL: inc.getFD (tax_year).amount

actual_amount«in» «fromrecord»

«query»

OCL: inc.prorata_periodprorata_period«in» «fromrecord»

«query»

flat_rate

minimal_distance

maximal_distance

«fromlaw» «in»

«fromlaw» «in»

«fromlaw» «in»

maximal_flat_rate«fromlaw» «in»

yes (true)

no (false)«decision»

«decision»

distance > minimal_distance

«statement» actual_amount =

expected_amount

prorata_period * flat_rate * distance

«formula» prorata_period * maximal_flat_rate

«formula» 0 (zero)

distance«fromrecord» «in»

«query» OCL: inc.distance Source: Ministerial Regulation of February 6, 2012

Source: Art. 105bis of the LITL, 2013

«query»

IncomeTaxDeduction

Address

TaxPayer

- flat_rate- maximal_flat_rate- maximal_distance- minimal_distance

Constant«enumera(on»

*

* taxpayer

*

incomes1lives at

*

*

*is accomplished at

1..*

CommutingExpenseDeduction

is based on

*

*

*works at

Service

is paid for0..11

Income- distance:DistanceUnit- prorata_period:NumbergetFD(Date):MonetaryValue

1..*

Art. 105bis […]The commuting expenses deduction (FD) is defined as a function over the distance between the principal town of the municipality on whose territory the taxpayer's home is located and the place of taxpayer’s work. The distance is measured in units of distance expressing the kilometric distance between [principal] towns. A ministerial regulation provides these distances. !The amount of the deduction is calculated as follows: If the distance exceeds 4 units but is less than 30 units, the deduction is € 99 per unit of distance. The first 4 units does not trigger any deduction and the deduction for a distance exceeding 30 units is limited to € 2,574.

{{

Putting it together

27

2. Build UML profile

3. Use profile for transforming

models

• What information content should we expect?

• What are the complexity factors?

• Explicit means for capturing information requirements

• Basis for modeling methodology

• Reuse existing automation techniques

• Solvers for testing • MATLAB for simulation

1. Conduct grounded theory

study

Retrieve all required inputs!

Declare!Inputs!

Transformation to OCL (1)

28

Recognize !Pattern!

Transform Pattern !to OCL!Make recursive call to handle next element !

Activity Diagram«itera've»

iterator: Type«in»+

Set(Object)name:

Retrieve all required inputs!

Declare!Inputs!

Transformation to OCL (2)

29

Recognize !Pattern!

Transform Pattern !to OCL!Make recursive call to handle next element !

Activity Diagram name ! forAll (iterator: Type |

Filled by the algorithm’s unwinding

)

OCL vs. Model1. context TaxPayer inv FD:

2. let tax year:Date = self.tax year in

3. let incomes:Set(Income) = self.incomes!select(i:Income | i.year = tax year) in

4. incomes!forAll(inc:Income |5. let distance:DistanceUnit = inc.distance in

6. let minimal distance:DistanceUnit =

7. Constant::MINIMAL DISTANCE.oclAsType(DistanceUnit) in

8. if (distance > minimal distance) = true then

9. let maximal distance:DistanceUnit =

10. Constant::MAXIMAL DISTANCE.oclAsType(DistanceUnit) in

11. if (distance < maximal distance) = true then

12. let flat rate:MonetaryValue =

13. Constant::FLAT RATE.oclAsType(MonetaryValue) in

14. let prorata period:Numeric = inc.prorata period in

15. let expected amount:MonetaryValue = prorata period * flat rate * distance in

16. let actual amount:MonetaryValue = inc.getFD(tax year).amount in

17. actual amount = expected amount

18. else if (distance < maximal distance) = false then

19. let maximal flat rate:MonetaryValue =

20. Constant::MAXIMAL FLAT RATE.oclAsType(MonetaryValue) in

21. let prorata period:Numeric = inc.prorata period in

22. let expected amount:MonetaryValue = prorata period * maximal flat rate in

23. let actual amount:MonetaryValue = inc.getFD(tax year).amount in

24. actual amount = expected amount

25. else false endif

26. endif

27. else if (distance > minimal distance) = false then

28. let expected amount:MonetaryValue = 0 in

29. let actual amount:MonetaryValue = inc.getFD(tax year).amount in

30. actual amount = expected amount

31. else false endif endif

32. )

30

31

2. Build UML profile

3. Use profile for transforming

models

• What information content should we expect?

• What are the complexity factors?

• Explicit means for capturing information requirements

• Basis for modeling methodology

• Reuse existing automation techniques

• Solvers for testing • MATLAB for simulation

1. Conduct grounded theory

study

32

Evaluation of effort

!!!

!Deductions (12 ADs):!• Commuting Expense !• Miscellaneous Expenses !• Spousal Expenses !• Special Expenses!• Extraordinary Expenses!!

Credits (3 ADs):!• Employment !• Pension !• Single parents

We modeled the deductions and credits associated with personal income taxes:

A Luxembourgish tax card

33

Models sizesN

umbe

r of e

lem

ents

0

10

20

30

40

50

60

70

80

Activity Diagrams

FD FO AC CE1 CE2 CE3 DS1 DS2 DS3 DS4 DS5 DS6 CIS CIP CIM

Resulting models have reasonable size

34

Measured effort

Approximately 3.3 person-hour per activity diagram!!!!!

!!

!

Effort spent to model deductions and credits for personal income taxes:

35

- Navigations !

- If statements !

- Operations on collections !

- Iterative operations

• AD tailored by our profile vs. manually-written OCL !• Metrics related to the identified complexity factors:

[Reynoso et al., 2004]

Complexity reduction (1)

36

Complexity reduction (2)

- Navigations: ↘ 45%!!

- If statements: ↘ 100%!!

- Operations on collections: ↘72% !

- Iterative operations: ↘ 53%

• AD tailored by our profile vs. manually-written OCL !• Metrics related to the identified complexity factors:

Limitations

• Some complexity carries over to the models

!

• Specific to prescriptive legal frameworks

37

What’s next?

• User studies

!

• Extension to declarative legal frameworks

!

• Study how models built using our approach can support simulation

38

NoTest cases

Actual software system

Traces

Traces

input t

o

input to Analyzable

interpretation of the law

Actual result

simulated result

Generates

Results match?

Yes

Impact of fiscal decisions

Simulates

Tax Law

30

2. Build UML profile

3. Use profile for transforming

models

• What information content should we expect?

• What are the complexity factors?

• Explicit means for capturing information requirements

• Basis for modeling methodology

• Reuse existing automation techniques

• Solvers for testing • MATLAB for simulation

1. Conduct grounded theory

studyTraceability Package

Legal Text

Legal Agent Record

Information Source

1..*

0..1

Process Package

Step

Data Object

*

1..*has as input

0..1

produces as output

1..*

1..* has as type

originates from

is derived from

Datatype Package

StringNumeric

SetDatatype

Boolean Domain Object

Age PercentageDistance Unit

Monetary Value

1*

DecisionOperation

Date

Legal Rule

1

context TaxPayer inv ResidentialStatus:

let hasLocalAddress:Boolean = self.addresses!select(a:Address | a.country = Country::LU)

!notEmpty() inif hasLocalAddress then

self.oclIsTypeOf(ResidentTaxPayer)else

let hasLocalIncomes:Boolean = self.incomes!select(i:Income | i.oclIsTypeOf(LocalIncome))

!notEmpty() inif hasLocalIncome then

self.oclIsTypeOf(NonResidentTaxPayer)else

falseendif

endif

no (false)

: MonetaryValue

«intermediate» expected_amount

«calculate» Normal rate per unit for declared distance

«assert» Check correctness of

deduction granted to taxpayer

«rule» «iterative»

inc : Income

«context» TaxPayer

OCL: self.incomes-> select(i:Income| i.year = tax_year)

«query» Agent type: OfficerQuestion: When was the request postmarked?

incomes«in»

tax_year«fromagent»

distance < maximal_distance

«fromrecord»

«in»

«calculate» Special flat rate for maximal distance

«formula»

«calculate»

No deduction

yes (true)

«query»

OCL: inc.getFD (tax_year).amount

actual_amount«in» «fromrecord»

«query»

OCL: inc.prorata_periodprorata_period«in» «fromrecord»

«query»

flat_rate

minimal_distance

maximal_distance

«fromlaw» «in»

«fromlaw» «in»

«fromlaw» «in»

maximal_flat_rate«fromlaw» «in»

yes (true)

no (false)«decision»

«decision»

distance > minimal_distance

«statement» actual_amount =

expected_amount

prorata_period * flat_rate * distance

«formula» prorata_period * maximal_flat_rate

«formula» 0 (zero)

distance«fromrecord» «in»

«query» OCL: inc.distance Source: Ministerial Regulation of February 6, 2012

Source: Art. 105bis of the LITL, 2013

«query»

Summary

39

Approximately 3.3 person-hour per activity diagram!

!!!!

!

Effort spent to model deductions and credits for personal income taxes:

- Navigations: ↘ 45%!!

- If statements: ↘ 100%!!

- Operations on collections: ↘72% !

- Iterative operations: ↘ 53%

Metrics related to the identified complexity factors:

Approach and a Study of Luxembourg’s Tax Law!

Ghanem [email protected]!

http://people.svv.lu/soltana/

University of Luxembourg, Luxembourg!

Using UML for Modeling Procedural Legal Rules

.lusoftware verification & validationVVS

Acknowledgements

• CTIE: Ludwig Balmer, Marc Blau, Yves Boland, Michaël Masseroni, Gautier Barrère

• ACD: Thierry Prommenschenkel, Guy Heintz, Vincent D'Angelo

• SnT: Domenico Bianculli

41

Modeling methodology

42

Relevant Legal Texts

Feedback

Analysis

Model the domain

Model legal rules

Domain Model

Formal Specification

ADToOCLTransformation

UML Profile

adequate input

Activity Diagram(legal rule)

OCL