We propose LicenseScript, a language for digital rights management (DRM) based on multiset rewriting and logic programming. LicenseScript enjoys a precise syntax and semantics, and it is rich enough to embed other rights expression languages (REL). We show that LicenseScript is expressive and flexible by exploring several application domains representing different aspects of DRM. We present an implementation. Finally, we extend the core of the language to account for multiple devices in authorized domains.