LNN icon indicating copy to clipboard operation
LNN copied to clipboard

Model equivalence

Open NaweedAghmad opened this issue 2 years ago • 3 comments

Allow two models to be compared to one another using __eq__ dunder. This compares all the formulae, their connectivity and corresponding facts at convergence (i.e. does not consider any gradient computations)

NaweedAghmad avatar Apr 17 '22 21:04 NaweedAghmad

What are the important slots to compare in _Formula?

I have these slots compared for equivalence:

  • name
  • world
  • arity
  • variables
  • operands
  • unique_vars

What other slots are important for comparison? Is grounding_table also important?

Thomasparsley avatar Apr 23 '22 09:04 Thomasparsley

We also want groundings and corresponding truth values. One idea is to compare all groundings gotten from this and then compare their states or more directly their truth tensors. Comparing tensors is more general and applies to fuzzy truth values whereas states are limited to classical logic since for fuzzy logic the state just says it's fuzzy.

nDiv avatar Apr 23 '22 14:04 nDiv

#71 included the equivalence checks for objects to allow neurons and symbols to be matched. Since each model is simply a collection of connected formulae, we should have all objects required for this --- each formula will directly tell us about the following:

name world arity variables operands unique_vars

Its still required to pull out the equivalence of different models, which requires us to store/match the variables in the model:

  • nodes
  • node_names
  • query etc.

NaweedAghmad avatar Mar 01 '23 09:03 NaweedAghmad