feat(Foundations/Logic/Belnap): add BelnapLevel and gates with four-valued logic#481
feat(Foundations/Logic/Belnap): add BelnapLevel and gates with four-valued logic#481matthunz wants to merge 1 commit intoleanprover:mainfrom
BelnapLevel and gates with four-valued logic#481Conversation
|
Hi! I haven't spent enough time trying to make it work out, but I suspect we can find a way to avoid defining that You still have to cook up the lattice operations, but it might be a bit easier this way. A completely different approach would be to notice the lattice you've defined is exactly the powerset lattice of a two-element set. So you could define EDIT: I think the latter is the right way — I'm not familiar with Belnap's work, but judging from the wikipedia article viewing |
Adds
BelnapLeveland primitive gates with four-valued logic which can be used to model information that may be inconsistent or incomplete:I'm currently using this in
circuitlibto model digital circuits, where⊥represents a disconnection and⊤represents a short, but I've also seen this four-valued logic used to model things like values in a database and threading in programming languages.A big part of this PR is the instance for
Latticewhich I'm not super confident in - a customPreorderthat doesn't definetrue > falseis required to prove the gates areMonotone, which helps for modeling things like real-world circuit gates that can't physically gain information. I like the generalMonotoneproofs so I'm leaning towards it being useful but it might be better without it if the customPreorderisn't expected by users.