{"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/a-probabilistic-neuro-symbolic-layer-for","title":"A Probabilistic Neuro-symbolic Layer for Algebraic Constraint Satisfaction","arxiv_id":"2503.19466","date":"2025-03-25","proceeding":null,"authors":["Leander Kurscheidt","Paolo Morettin","Roberto Sebastiani","Andrea Passerini","Antonio Vergari"],"abstract":"In safety-critical applications, guaranteeing the satisfaction of constraints over continuous environments is crucial, e.g., an autonomous agent should never crash into obstacles or go off-road. Neural models struggle in the presence of these constraints, especially when they involve intricate algebraic relationships. To address this, we introduce a differentiable probabilistic layer that guarantees the satisfaction of non-convex algebraic constraints over continuous variables. This probabilistic algebraic layer (PAL) can be seamlessly plugged into any neural architecture and trained via maximum likelihood without requiring approximations. PAL defines a distribution over conjunctions and disjunctions of linear inequalities, parameterized by polynomials. This formulation enables efficient and exact renormalization via symbolic integration, which can be amortized across different data points and easily parallelized on a GPU. We showcase PAL and our integration scheme on a number of benchmarks for algebraic constraint integration and on real-world trajectory data.","url_abs":"https://arxiv.org/abs/2503.19466v1","url_pdf":"https://arxiv.org/pdf/2503.19466v1.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":"a-probabilistic-neuro-symbolic-layer-for","repo_url":"https://github.com/april-tools/pal","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"a-probabilistic-neuro-symbolic-layer-for","repo_url":"https://github.com/april-tools/constrained-sdd","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":null,"task_name":"GPU"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2503.19466","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2503.19466"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/april-tools/constrained-sdd","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/april-tools/pal","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":10},"by_repo_kind":{"official":{"samples":10,"ran":0,"repositories":2}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"2c4716f262ada199","entry":"box_to_lra","repo":"april-tools/pal","repo_kind":"official","path":"pal/logic/lra.py","file_url":"https://github.com/april-tools/pal/blob/HEAD/pal/logic/lra.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2c4716f262ada199"}},{"code_sha256_prefix":"3583b4279da1a9b2","entry":"compute_reordering_of_parameter_positions2d","repo":"april-tools/pal","repo_kind":"official","path":"pal/distribution/spline_distribution.py","file_url":"https://github.com/april-tools/pal/blob/HEAD/pal/distribution/spline_distribution.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3583b4279da1a9b2"}},{"code_sha256_prefix":"415a055f196109f8","entry":"filter_moving_trajectories","repo":"april-tools/constrained-sdd","repo_kind":"official","path":"sdd/constrained_sdd.py","file_url":"https://github.com/april-tools/constrained-sdd/blob/HEAD/sdd/constrained_sdd.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"415a055f196109f8"}},{"code_sha256_prefix":"b3d4a7499e985638","entry":"gather_variables","repo":"april-tools/pal","repo_kind":"official","path":"pal/logic/lra.py","file_url":"https://github.com/april-tools/pal/blob/HEAD/pal/logic/lra.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b3d4a7499e985638"}},{"code_sha256_prefix":"75f0e912b17006e1","entry":"generate_monomial","repo":"april-tools/pal","repo_kind":"official","path":"pal/distribution/torch_polynomial.py","file_url":"https://github.com/april-tools/pal/blob/HEAD/pal/distribution/torch_polynomial.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"75f0e912b17006e1"}},{"code_sha256_prefix":"7b0973fdc27b3ee1","entry":"hash_torch_tensor","repo":"april-tools/pal","repo_kind":"official","path":"pal/distribution/torch_polynomial.py","file_url":"https://github.com/april-tools/pal/blob/HEAD/pal/distribution/torch_polynomial.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7b0973fdc27b3ee1"}},{"code_sha256_prefix":"6914c7f136289f15","entry":"neutral_box","repo":"april-tools/pal","repo_kind":"official","path":"pal/logic/lra.py","file_url":"https://github.com/april-tools/pal/blob/HEAD/pal/logic/lra.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6914c7f136289f15"}},{"code_sha256_prefix":"c1607733f992458f","entry":"single_trajectory_to_dataset_horizon_non_sampled","repo":"april-tools/constrained-sdd","repo_kind":"official","path":"sdd/constrained_sdd.py","file_url":"https://github.com/april-tools/constrained-sdd/blob/HEAD/sdd/constrained_sdd.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c1607733f992458f"}},{"code_sha256_prefix":"4e9a66d0740cebfb","entry":"stable_np_sum","repo":"april-tools/pal","repo_kind":"official","path":"pal/distribution/torch_polynomial.py","file_url":"https://github.com/april-tools/pal/blob/HEAD/pal/distribution/torch_polynomial.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4e9a66d0740cebfb"}},{"code_sha256_prefix":"b998396ef168dacb","entry":"trajectories_to_dataset_horizon","repo":"april-tools/constrained-sdd","repo_kind":"official","path":"sdd/constrained_sdd.py","file_url":"https://github.com/april-tools/constrained-sdd/blob/HEAD/sdd/constrained_sdd.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b998396ef168dacb"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}