Skip to content

Downward inference from fully quantified universal #80

@NaweedAghmad

Description

@NaweedAghmad

@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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions