{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/on-exact-sampling-in-the-two-variable","title":"On Exact Sampling in the Two-Variable Fragment of First-Order Logic","arxiv_id":"2302.02730","date":"2023-02-06","proceeding":null,"authors":["Yuanhong Wang","Juhua Pu","Yuyi Wang","Ondřej Kuželka"],"abstract":"In this paper, we study the sampling problem for first-order logic proposed recently by Wang et al. -- how to efficiently sample a model of a given first-order sentence on a finite domain? We extend their result for the universally-quantified subfragment of two-variable logic $\\mathbf{FO}^2$ ($\\mathbf{UFO}^2$) to the entire fragment of $\\mathbf{FO}^2$. Specifically, we prove the domain-liftability under sampling of $\\mathbf{FO}^2$, meaning that there exists a sampling algorithm for $\\mathbf{FO}^2$ that runs in time polynomial in the domain size. We then further show that this result continues to hold even in the presence of counting constraints, such as $\\forall x\\exists_{=k} y: \\varphi(x,y)$ and $\\exists_{=k} x\\forall y: \\varphi(x,y)$, for some quantifier-free formula $\\varphi(x,y)$. Our proposed method is constructive, and the resulting sampling algorithms have potential applications in various areas, including the uniform generation of combinatorial structures and sampling in statistical-relational models such as Markov logic networks and probabilistic logic programs.","url_abs":"https://arxiv.org/abs/2302.02730v2","url_pdf":"https://arxiv.org/pdf/2302.02730v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"on-exact-sampling-in-the-two-variable","repo_url":"https://github.com/lucienwang1009/lifted_sampling_ufo2","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"none","reach":null}],"tasks":[{"task_slug":"sentence","task_name":"Sentence"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":null,"mcp":null,"developers":"https://syntology.ai/developers"},"arxiv_metadata":null,"syntology_extracted_results":null}