A Brief Overview
Deontic logic is the study of the logical relationships among propositions that assert that certain actions or states of affairs are morally obligatory, morally permissible, morally right or morally wrong. Mally developed the first such deontic logic. In his monograph, Grundgesetze des Sollens: Elemente der Logik des Willens (Graz: Leuschner & Lubensky, 1926), he presented axioms for the notion ‘p ought to be the case’, using the formal notation ‘!p’ to represent this claim.
Unfortunately, one can derive from Mally's axioms the claim that p ought to be if and only if p obtains (formally: !p ≡ p). But, there are lots of counterexamples to this result, for there are states of affairs that obtain but which ought not to be, and there are states of affairs which ought to be but which don't obtain.
For a more complete description of Mally's deontic logic, and some suggestions for how to repair it, see Gert-Jan Lokhorst's entry in the Stanford Encyclopedia of Philosophy:
Mally's Deontic LogicFor a complete introduction to deontic logic, see Paul McNamara's entry in the Stanford Encyclopedia of Philosophy:
Deontic LogicSee also D. Follesdal and R. Hilpinen's article, "Deontic Logic: An Introduction" (in Deontic Logic: Introductory and Systematic Readings,, R. Hilpinen (ed.), Dordrecht: D. Reidel, 1970).