Law is the set of rules imposed by a society or community that members are bound to obey. It has a broad scope, including not only criminal and civil law, but also economic and social rights, property, contracts, the environment and intellectual property. The precise nature of law is a subject of longstanding debate, and many schools of thought have developed competing theories.
A system of law can be established by a group legislature through statutes; by the executive, through decrees and regulations; or by judges through the legal system of precedent (also known as stare decisis). The latter is a complex, multi-stage process wherein a judge decides a case on its facts, and articulates rulings that serve to guide future cases based on similar circumstances. The result is that the law as a whole gradually shapes itself through legal reasoning, analogy and consensus.
Law can also be based on religious precepts, as in Jewish Halakha and Islamic Sharia law. Religious law often implies unalterable authority and obligation of obedience on the part of those governed, but these laws can be further elaborated through human interpretation, Qiyas (reasoning by analogy) and Ijma (consensus). Law can also be created in a more limited, centralized way, through agency regulation and formal legislative procedures. Examples include the modern law of company formation, based on the common law principle of separate ownership and control; commercial law (contract, insurance, bills of exchange, insolvency and bankruptcy) rooted in medieval Lex Mercatoria; and tax law, which is largely codified through statutes.