-
Notifications
You must be signed in to change notification settings - Fork 0
/
param woes
28 lines (15 loc) · 1.03 KB
/
param woes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
goal: group<T> for any type
- also group<set<T>> etc
problem: parameterization is just syntactic
- can have groups of different types
- but can't have isomorphisms between groups of different types
attempted solution: have an unrestricted group<Any> base class that restricted versions extend
problem: scope explosion (6 or 20 million clauses)
final solution?: composition instead of inheritance
- all Groups can only have Elems
- Elems can optionally have anything attached as data
- i've come to realize that the efficiency of alloy programs is directly negatively correlated with code quality.
- loosely speaking, good code is extensible and you can do a lot of things with it, and alloy works by trying every possible thing you could do with the code.
- so it kinda makes sense
- having an extensible module and then restraining it in a using module only works so well, because you still get all the original clauses from the first module
- getting around this would require high-level reduction stage before the reduction to CNF