Drasil icon indicating copy to clipboard operation
Drasil copied to clipboard

`ConstrainedChunk` vs `ConstrConcept`, and their design

Open balacij opened this issue 7 months ago • 1 comments

Image Image

A ConstrainedChunk and ConstrConcept are very similar. Differences:

  1. The ConstrConcept extends a DefinedQuantityDict, and inherits two typeclass instances: Definition and ConceptDomain.
  2. The ConstrConcept is Expressible (in ModelExpr).

Depending on how #4061 is resolved (i.e., if D-Q-D and Q-D- are merged), these two chunks might just be merged as well!

However, regardless of the above, is the "extension" design correct here? Why aren't constraints a part of any variable definition (i.e., a part of [Defined]QuantityDict)?

balacij avatar Jun 02 '25 16:06 balacij

I'm pretty sure that these exist as separate chunks purely for technical reasons, i.e. because they extend slightly different chunks.

The bigger question is a good one: why not enable constraints for all variable definitions? I guess we wanted some things that assuredly had constraints, I think. But that may not really be needed, especially as it is a list and not a non-empty list. So pushing that list of constraints down one level and getting rid of these 2 chunks is probably fine.

JacquesCarette avatar Jun 02 '25 17:06 JacquesCarette