Law is a system of rules created by the state that form a framework to ensure a peaceful society. When these rules are broken sanctions can be imposed. The term can also be used to describe a body of rules that regulates a specific area of activity, for example the law on driving or the law on gambling.

The law serves many purposes but the four principal ones are establishing standards, maintaining order, resolving disputes and protecting liberties and rights. The law is a complex subject and there are a wide range of different theories about it. Some of the key theories are utilitarian, natural, and moral impact.

Utilitarian theory sees the purpose of the law as a means to promote social good. Bentham suggested that a good law is one that achieves its goals, for example by keeping the peace, reducing crime and disorder and promoting commerce. The other major theory is natural law, which argues that there are certain moral principles that people are inclined to obey. This philosophy emerged in ancient Greece and later re-entered the Western world through philosophers such as Jean-Jacques Rousseau.

Legal systems vary widely and there are many different definitions of the word ‘law’. The legal system that developed in medieval England is known as common law. It relies heavily on the articulation of legal principles in a historical succession of judicial decisions, known as case law. This is in contrast to civil law, which is based on legislation.

There are also differences in the way that laws are interpreted and applied. Some scholars use a hermeneutic approach to law, which seeks out the true meaning of authoritative texts and interprets them for contemporary situations. This is a very different approach to the apologetic view, which asserts that there are always clear meanings for legal words and that these can be applied in all cases.

Other scholars argue that the interpretation of a statute should take into account its context. For example, a new law may conflict with existing law in some way. In such a situation the judge should try to find a solution that is consistent with the overall legal framework. Another important rule is that a statute should be construed in pari materia with other statutes that cover the same general subject matter. If a construction of a statute would render them meaningless or inconsistent with other laws, it is not the correct interpretation. It is also important to consider whether a particular statute has been written with an ulterior motive, for example by seeking a political result. This is an area of debate, with some arguing that judges should not be influenced by their own politics. Others believe that this could lead to bias and unfairness in decision-making. In an adversarial legal system, there is also a strong incentive to challenge the meaning of a law if doing so might benefit one party over the other in a dispute.