From: digitig <digitig@gmail.com>
Subject: Puzzled by SPARK global aspect
Date: Fri, 30 Jun 2017 14:29:36 -0700 (PDT)
Date: 2017-06-30T14:29:36-07:00 [thread overview]
Message-ID: <7f7a804e-b90d-4a60-b759-21ae14da3835@googlegroups.com> (raw)
Suppose in my package specification I have
type Quadrant_Specification_Array is
array(Global.Quadrant_X_Index'Range, Global.Quadrant_Y_Index'Range)
of Quadrant_Specification;
(With QuadrantSpecification being a record type) and in my package body I have:
function N_Total_Klingons return Global.Klingon_Counter
with
Refined_Global => (Input => Quadrant_Specifications)
is
Total: Global.Klingon_Counter := 0;
begin
for X in Quadrant_Specifications'Range loop
for Y in Quadrant_Specifications'Range(2) loop
Total := Total + Quadrant_Specifications(X, Y).N_Klingons;
end loop;
end loop;
return Total;
end N_Total_Klingons;
Spark gives me an error
useless refinement, subprogram "N_Total_Klingons" does not depend on abstract state with visible refinement
But if I take the Refined_Global specification out I get the error
"Quadrant_Specifications" must be listed in the Global aspect of "N_Total_Klingons"
I feel I'm losing either way - if I do specify it I'm wrong, if I don't specify it I'm wrong.
How *do* I fix this?
next reply other threads:[~2017-06-30 21:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-30 21:29 digitig [this message]
2017-07-01 15:51 ` Puzzled by SPARK global aspect Anh Vo
2017-07-01 18:25 ` digitig
2017-07-02 0:45 ` Anh Vo
2017-07-02 0:59 ` Anh Vo
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox