HIERARCHICAL REPRESENTATION OF LEGAL KNOWLEDGE WITH METAPROGRAMMING IN LOGIC
We present an application of metaprogramming in logic that, unlike most metaprogramming applications, is not primarily concerned with controlling the execution of logic programs. Metalevel computation is used to define theories from schemata that were either given explicitly or obtained by abstraction from other theories. Our main application is a representation of legal knowledge in a metalogic programming language. We argue that legal knowledge is multilayered and therefore a single level representation language lacks the needed expressiveness. We show that legal rules can be partitioned into primary, secondary, tertiary, quaternary, and higher level rules. Our classification enables us to define a multilevel model of legal knowledge and a one-to-one correspondence with levels of metaprogramming in logic. We show that this framework has a potential for capturing important legal interpretation principles such as analogia legis, lex specialis Zegi generuli derogut, etc. We have a running example from commercial law that utilizes rules up to the tertiary level, emphasizing unulogiu legis. The example is expressed in a multilevel metalogic programming language that provides a naming convention and employs reflection between levels.