Skip to content
New issue

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

Downward inference from fully quantified universal #80

Open
NaweedAghmad opened this issue Mar 3, 2023 · 0 comments
Open

Downward inference from fully quantified universal #80

NaweedAghmad opened this issue Mar 3, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@NaweedAghmad
Copy link
Collaborator

@KyleErwin the code below seems to have two issues

  1. Setting the truth of the universal quantifier doesn't directly update the proposition
  2. Downward inference from the universal seems to break
from lnn import *
x = Variable('x')
cry = Predicate('Cry')
sad = Predicate('Sad')
rule = Forall(x, Implies(cry(x), sad(x)))

model = Model()
model.add_knowledge(rule, cry)
model.add_data({
    cry: {
        'John': Fact.TRUE,
        'Bob': Fact.TRUE,
    },
    rule: Fact.TRUE,
})

model.print()
model.infer()
model.print()
File "lnn/symbolic/logic/unary_operator.py", line 165, in downward
  return self._fully_quantified_downward()
File "lnn/symbolic/logic/unary_operator.py", line 270, in _fully_quantified_downward
  return operand.neuron.aggregate_bounds(groundings, bounds[..., 0])
IndexError: index 0 is out of bounds for dimension 1 with size 0
@NaweedAghmad NaweedAghmad changed the title Downward in Downward inference from universal Mar 3, 2023
@NaweedAghmad NaweedAghmad changed the title Downward inference from universal Downward inference from fully quantified universal Mar 3, 2023
@NaweedAghmad NaweedAghmad added the bug Something isn't working label Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants