AdaCore / adareducer

GNU General Public License v3.0
13 stars 2 forks source link

Remove aspects during reduction #11

Closed yakobowski closed 2 years ago

yakobowski commented 2 years ago

On the following project, adareduce seems to preserver the aspects on the type tree. After the first reduction, I obtained

   type Tree (Capacity : Count_Type) is tagged private
     with Constant_Indexing => Constant_Reference,
          Variable_Indexing => Reference,
          Default_Iterator  => Iterate,
          Iterator_Element  => Element_Type,
          Preelaborable_Initialization
                            => Element_Type'Preelaborable_Initialization;

In turn, this keeps quite a few subprograms "alive", even though they are in fact not relevant.

Note that my first oracle did not force a compilation of the source code, and I think those aspects ended up being removed in that run. Here, for the reduction to succeed here, the aspect must be removed in a first time; only then can the subprograms can be eliminated.