From 5cf262563802ca371ceea66decab1c9180905364 Mon Sep 17 00:00:00 2001 From: tronmon <137589782+tronmon@users.noreply.github.com> Date: Tue, 3 Mar 2026 16:18:38 +0530 Subject: [PATCH 1/2] Fix typo in usage example for adding formulae --- docsrc/source/usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docsrc/source/usage.md b/docsrc/source/usage.md index e5ba0706..c6174acc 100644 --- a/docsrc/source/usage.md +++ b/docsrc/source/usage.md @@ -93,7 +93,7 @@ The API follows a hierarchy of interacting components, allowing designers to con from lnn import World formulae = [ - Smoking_causes_Cancer + Smoking_causes_Cancer, Smokers_befriend_Smokers ] model.add_knowledge(*formulae, world=World.AXIOM) From 19653fb136541e225ceae5b4359cd188e5a14300 Mon Sep 17 00:00:00 2001 From: tronmon <137589782+tronmon@users.noreply.github.com> Date: Tue, 3 Mar 2026 16:58:02 +0530 Subject: [PATCH 2/2] Fix documentation: remove .name from model.add_data() example in usage.md Updated comments and corrected dictionary keys for data model. --- docsrc/source/usage.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docsrc/source/usage.md b/docsrc/source/usage.md index c6174acc..14adced1 100644 --- a/docsrc/source/usage.md +++ b/docsrc/source/usage.md @@ -132,7 +132,8 @@ The API follows a hierarchy of interacting components, allowing designers to con 3. Tables of Data ```python from lnn import Fact - + # NOTE: Using .name returns a string, but add_data() expects a Formula object. + # This causes: TypeError: formula expected of type Formula, received str # add data to the model model.add_data({ Friends: { @@ -143,12 +144,12 @@ The API follows a hierarchy of interacting components, allowing designers to con ('Anna', 'Frank'): Fact.TRUE, ('Frank', 'Anna'): Fact.TRUE, ('Bob', 'Chris'): Fact.TRUE}, - Smokes.name: { + Smokes: { 'Anna': Fact.TRUE, 'Edward': Fact.TRUE, 'Frank': Fact.TRUE, 'Gary': Fact.TRUE}, - Cancer.name: { + Cancer: { 'Anna': Fact.TRUE, 'Edward': Fact.TRUE} })