vaticle / typedb

TypeDB: the polymorphic database powered by types
https://typedb.com
Mozilla Public License 2.0
3.72k stars 338 forks source link

Fix Role resolution in rules #6973

Closed krishnangovindraj closed 5 months ago

krishnangovindraj commented 5 months ago

Usage and product changes

Fixes how rules resolve roles, fixing validation that types referenced in rules cannot be deleted.

Implementation

vaticle-bot commented 5 months ago

PR Review Checklist

Do not edit the content of this comment. The PR reviewer should simply update this comment by ticking each review item below, as they get completed.


Trivial Change

Code

Architecture

krishnangovindraj commented 5 months ago

The bug this fixes would be caught by type-inference at commit time. Further, this makes the validation for the same bug caused byset_supertype more complicated if we want to be consistent with when we flag unsatisfiable rules.

krishnangovindraj commented 5 months ago

I forget type-inference automatically downcasts to subtypes based on their relates/owns/plays constraints. This, role types cannot always be uniquely resolved.