Law is a set of rules created and enforced by social or governmental institutions to regulate behavior. Its precise definition is a matter of longstanding debate, and it has been variously described as a science and as an art. The law may be written or unwritten, or it may consist of a code, a body of case law, or both. Its purpose is to ensure social stability and justice.
Many countries have a common law system, wherein judges decide cases by applying existing laws to facts that are brought before them. In this system, court decisions become law (called precedent) unless challenged. Other nations use civil law systems, wherein judges rely on a written legal code to make their decisions. The goal of a civil law system is to create a standardized set of laws that can reduce the incidence of biased judgments from one judge to another.
Other types of law include criminal law, which deals with crimes such as murder and robbery, and administrative law, which involves government regulations, such as taxation and banking law. International law encompasses the rights of individuals to migrate and live in a country other than their own, such as immigration law and the problem of stateless people; family law covers marriage, divorce, and custody proceedings; and commercial law addresses contracts and property disputes. In addition, specialized fields of law include space and outer-space law, environmental law, and corporate and business law.