The role of DataValue#id #75
Unanswered
mtf90
asked this question in
AutomataLib Q & A
Replies: 1 comment 2 replies
-
I would be in favor of decoupling |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm currently trying to clean up generic type definitions and wanted to make the
DataType
class typed according to its given base typeClass<T>
. I assume the intention is that upon creating aDataValue(type, id)
theid
should always match the specified type?The problem I encountered is that
Parameter
s (orSymbolicDataValue
s in general) are implemented asDataValue<Integer>
. Now, for example, theParValuation
constructs from a given (word of)PSymbolInstance
parameters using the symbol'sDataValue<?>
types but assigns to it an integer id which causes the compiler to complain (rightfully so, because instantiated symbols may reference non-integer types).Throughout the code, I have only found calls to
DataValue
that set a numeric value for theid
field, so would anint id
field be more appropriate? This would mean that we expect users to encode parameter values with a symbolic identification themselves. If arbitrary (but apparently unrelated) types should be supported, maybeObject
would be a better fit than a generic type? In this case, given the discussion #73, what remaining use does the base class have, if the name alone seems to be the primary identifier for a type? Or should the currentSymbolicDataValue
implementation be decoupled fromDataValue
s?Beta Was this translation helpful? Give feedback.
All reactions