We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It's related to:
https://ibm.github.io/LNN/education/examples/reasoning.html#more-complex-reasoning-example
the code is:
from lnn import (Predicate, Variable, Join, And, Exists, Implies, Forall, Model, Fact, World) model = Model() # Instantiate a model. x, y, z, w = map(Variable, ['x', 'y', 'z', 'w']) # Define and add predicates to the model. owns = model['owns'] = Predicate('owns', 2) # binary predicate missile = model['missile'] = Predicate('missile') american = model['american'] = Predicate('american') enemy = model['enemy'] = Predicate('enemy', 2) hostile = model['hostile'] = Predicate('hostile') criminal = model['criminal'] = Predicate('criminal') weapon = model['weapon'] = Predicate('weapon') sells = model['sells'] = Predicate('sells', 3) # ternary predicate # Define and add the background knowledge to the model. america_enemies = ( Forall(x, Implies(enemy(x, (y, 'America')), hostile(x), ), world=World.AXIOM) ) model.add_knowledge(america_enemies) # Define queries query = Exists(x, criminal(x)) model.add_knowledge(query) # Add facts to model. model.set_facts({ owns: {('Nono', 'M1'): Fact.TRUE}, missile: {'M1': Fact.TRUE}, american: {'West': Fact.TRUE}, enemy: {('Nono', 'America'): Fact.TRUE}, }) model.infer() print(model[query].true_groundings)
and it says
Traceback (most recent call last): File "/home/sungjin/home/lnn-examples/complex2.py", line 1, in <module> from lnn import (Predicate, Variable, Join, And, ImportError: cannot import name 'Join' from 'lnn' (/home/sungjin/.virtualenvs/lnn/lib/python3.10/site-packages/lnn/__init__.py)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It's related to:
https://ibm.github.io/LNN/education/examples/reasoning.html#more-complex-reasoning-example
the code is:
and it says
The text was updated successfully, but these errors were encountered: