Law is a system of rules that governs crime, trade, social relations, property, and many other areas. It is enforced by a centralized government or society. It can be a constitution, statute, regulation, judicial precedent, or other type of law. It may also refer to the practice of a profession that involves advising clients or representing them in court.
Laws can be formulated to guide behaviour or to prevent certain types of behavior, for example laws against driving under the influence. They are a way to resolve disputes without fighting. For example, if two people claim to own the same piece of property, a judge can decide which one is the rightful owner. Laws can also be used to protect the rights of minorities against majorities, and to provide for orderly social change.
The nature of the rules themselves can vary, but the principle known as stare decisis — that courts should follow earlier rulings when making new decisions on similar cases — is generally considered an essential feature of law. Laws are generally written to be clear and accessible, and are made publicly available. They must be enforceable, and they must be based on objective considerations.
The law can be idealistic or realist in its purpose. The Romans and other ancient jurists defined the law in its idealistic sense, as a set of principles recognized and applied by the state to administer justice. This can be either distributive or corrective justice. H.L.A Hart defined it as a body of official content that guides governmental action.