add prolog/problog libraries

This commit is contained in:
Nicolas Sebastian Schuler
2025-08-05 08:41:43 +02:00
parent c324247dc3
commit a227795a1a
4 changed files with 38 additions and 0 deletions

View File

@@ -91,6 +91,7 @@ def main():
result = grounding(coding_description, labeled_image) result = grounding(coding_description, labeled_image)
# TODO: Feed this into the Prolog program and execute to reach final verdict # TODO: Feed this into the Prolog program and execute to reach final verdict
print(result) print(result)
print("End Abduction Demo")
if __name__ == "__main__": if __name__ == "__main__":

View File

@@ -95,6 +95,7 @@ def main():
result = grounding(coding_description, labeled_image) result = grounding(coding_description, labeled_image)
# TODO: Feed this into the Prolog program and execute to reach final verdict # TODO: Feed this into the Prolog program and execute to reach final verdict
print(result) print(result)
print("End Abduction Demo")
if __name__ == "__main__": if __name__ == "__main__":

View File

@@ -19,6 +19,8 @@ dependencies = [
"numpy>=2.3.2", "numpy>=2.3.2",
"opencv-python>=4.11.0.86", "opencv-python>=4.11.0.86",
"langchain-community>=0.3.27", "langchain-community>=0.3.27",
"pyswip>=0.3.3",
"problog>=2.2.7",
] ]
[tool.uv] [tool.uv]

34
uv.lock generated
View File

@@ -16,6 +16,8 @@ dependencies = [
{ name = "langchain-ollama", marker = "python_full_version >= '3.13'" }, { name = "langchain-ollama", marker = "python_full_version >= '3.13'" },
{ name = "numpy", marker = "python_full_version >= '3.13'" }, { name = "numpy", marker = "python_full_version >= '3.13'" },
{ name = "opencv-python", marker = "python_full_version >= '3.13'" }, { name = "opencv-python", marker = "python_full_version >= '3.13'" },
{ name = "problog", marker = "python_full_version >= '3.13'" },
{ name = "pyswip", marker = "python_full_version >= '3.13'" },
] ]
[package.dev-dependencies] [package.dev-dependencies]
@@ -33,6 +35,8 @@ requires-dist = [
{ name = "langchain-ollama", specifier = ">=0.3.6" }, { name = "langchain-ollama", specifier = ">=0.3.6" },
{ name = "numpy", specifier = ">=2.3.2" }, { name = "numpy", specifier = ">=2.3.2" },
{ name = "opencv-python", specifier = ">=4.11.0.86" }, { name = "opencv-python", specifier = ">=4.11.0.86" },
{ name = "problog", specifier = ">=2.2.7" },
{ name = "pyswip", specifier = ">=0.3.3" },
] ]
[package.metadata.requires-dev] [package.metadata.requires-dev]
@@ -667,6 +671,18 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538 }, { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538 },
] ]
[[package]]
name = "problog"
version = "2.2.7"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "setuptools", marker = "python_full_version >= '3.13'" },
]
sdist = { url = "https://files.pythonhosted.org/packages/4d/dc/caeea1cf8437f3c10c8c186b9451b478577fee84c51c2ea48923aeda398b/problog-2.2.7.tar.gz", hash = "sha256:df1886e60df1c85334673a00c31eb2b5c05051ccddf6d5a0eff1194104e3e92a", size = 1566437 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/c3/5e/eb0b23a42bbb0f2aaa716bb84c706a7206df9e31f4e9e78f3b06d4ee12d3/problog-2.2.7-py3-none-any.whl", hash = "sha256:c7131f7f0a2c6a1184cdf0b426b8c5937143e1896be8719a8c214262ed2e6cb7", size = 1965474 },
]
[[package]] [[package]]
name = "propcache" name = "propcache"
version = "0.3.2" version = "0.3.2"
@@ -796,6 +812,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/49/b6/b04e5c2f41a5ccad74a1a4759da41adb20b4bc9d59a5e08d29ba60084d07/pyright-1.1.403-py3-none-any.whl", hash = "sha256:c0eeca5aa76cbef3fcc271259bbd785753c7ad7bcac99a9162b4c4c7daed23b3", size = 5684504 }, { url = "https://files.pythonhosted.org/packages/49/b6/b04e5c2f41a5ccad74a1a4759da41adb20b4bc9d59a5e08d29ba60084d07/pyright-1.1.403-py3-none-any.whl", hash = "sha256:c0eeca5aa76cbef3fcc271259bbd785753c7ad7bcac99a9162b4c4c7daed23b3", size = 5684504 },
] ]
[[package]]
name = "pyswip"
version = "0.3.3"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/ff/75/96b326387af00edd34c7cca121ce98c10062d7b8dc5ec73324727997f678/pyswip-0.3.3.tar.gz", hash = "sha256:745cc6d86046a4cf9ba775a76f00d97f7d9129f7517515228391d7399bc4fe3d", size = 35963 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/b5/2b/c3bfc5a53714f7fb1b092aadb95277f133ce8c605f411f8888ca7ba340dd/pyswip-0.3.3-py3-none-any.whl", hash = "sha256:abddc4729917e3631e4a516e16211cbee93d4b701700eb116d6c3e8228ec3052", size = 36095 },
]
[[package]] [[package]]
name = "pytest" name = "pytest"
version = "8.4.1" version = "8.4.1"
@@ -890,6 +915,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/00/db/c376b0661c24cf770cb8815268190668ec1330eba8374a126ceef8c72d55/ruff-0.12.5-py3-none-win_arm64.whl", hash = "sha256:48cdbfc633de2c5c37d9f090ba3b352d1576b0015bfc3bc98eaf230275b7e805", size = 11951564 }, { url = "https://files.pythonhosted.org/packages/00/db/c376b0661c24cf770cb8815268190668ec1330eba8374a126ceef8c72d55/ruff-0.12.5-py3-none-win_arm64.whl", hash = "sha256:48cdbfc633de2c5c37d9f090ba3b352d1576b0015bfc3bc98eaf230275b7e805", size = 11951564 },
] ]
[[package]]
name = "setuptools"
version = "80.9.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/18/5d/3bf57dcd21979b887f014ea83c24ae194cfcd12b9e0fda66b957c69d1fca/setuptools-80.9.0.tar.gz", hash = "sha256:f36b47402ecde768dbfafc46e8e4207b4360c654f1f3bb84475f0a28628fb19c", size = 1319958 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/a3/dc/17031897dae0efacfea57dfd3a82fdd2a2aeb58e0ff71b77b87e44edc772/setuptools-80.9.0-py3-none-any.whl", hash = "sha256:062d34222ad13e0cc312a4c02d73f059e86a4acbfbdea8f8f76b28c99f306922", size = 1201486 },
]
[[package]] [[package]]
name = "sniffio" name = "sniffio"
version = "1.3.1" version = "1.3.1"