Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implement max_success/max_proof time also for summary output #39

Merged
merged 4 commits into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,15 @@ Typical output would look like this:

```
saatana-crypto.spark => (Flow => 9.0 ms,
Proof => 6.8 s)
Proof => 80.0 ms/80.0 ms/6.8 s)
saatana-crypto-phelix.spark => (Flow => 206.5 ms,
Proof => 568.7 s)
Proof => 174.3 s/206.4 s/568.7 s)
saatana.spark => (Flow => 464.0 µs,
Proof => 0.0 s)
Proof => 0.0 s/0.0 s/0.0 s)
saatana-crypto-lemmas.spark => (Flow => 2.1 ms,
Proof => 2.2 s)
Proof => 210.0 ms/210.0 ms/2.2 s)
test_phelix_api.spark => (Flow => 14.4 ms,
Proof => 23.1 s)
Proof => 240.0 ms/240.0 ms/23.1 s)
```

You can use the `--sort-by` option with `--summary`, either for an alphabetical
Expand All @@ -160,6 +160,8 @@ so files with the most time needed by the provers come first). The option
warning that what you requested has not been implemented yet. By default, no
particular order is imposed on the output.

For the meaning of the three timings after `Proof =>`, please see below.

*Note* that the `--details` option has no effect on the output here, this
option is designed to work with the `--report-mode` option only.

Expand Down
20 changes: 16 additions & 4 deletions src/run_spat-print_summary.adb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ begin
for File of Files loop
-- Can't use Files.Max_Length here, because we use the Simple_Name, not
-- the actual string stored.
-- FIXME: This assumes that everything is displayed, the actual output
-- might be less and the tabulation is a bit wide.
Second_Column :=
Ada.Text_IO.Count'Max (Second_Column,
Ada.Directories.Simple_Name
Expand Down Expand Up @@ -66,10 +68,20 @@ begin
New_Line => False);
Ada.Text_IO.Set_Col (File => Ada.Text_IO.Standard_Output,
To => Third_Column);
SPAT.Log.Message
(Message =>
"Proof => " &
SPAT.Image (Value => Info.Proof_Time (File => File)) & ")");

declare
Max_Success_Proof_Time : constant Duration :=
Info.Max_Success_Proof_Time (File => File);
begin
SPAT.Log.Message
(Message =>
"Proof => " &
(if Max_Success_Proof_Time = -1.0 -- nothing valid found
then "--"
else SPAT.Image (Value => Max_Success_Proof_Time)) & "/" &
SPAT.Image (Value => Info.Max_Proof_Time (File => File)) & "/" &
SPAT.Image (Value => Info.Proof_Time (File => File)) & ")");
end;
end if;
end loop;

Expand Down
70 changes: 70 additions & 0 deletions src/spat-spark_info.adb
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,39 @@ package body SPAT.Spark_Info is
return Sentinel.Cache.Max_Proof_Time;
end Max_Proof_Time;

---------------------------------------------------------------------------
-- Max_Proof_Time
---------------------------------------------------------------------------
not overriding
function Max_Proof_Time (This : in T;
File : in File_Name) return Duration
is
Result : Duration := -1.0;
File_Cursor : constant File_Sets.Cursor := This.Files.Find (Item => File);
use type File_Sets.Cursor;
begin
-- FIXME: We shouldn't need to iterate through all entities each time
-- this subprogram is called.
for Position in This.Entities.Iterate loop
if
Analyzed_Entities.Element (Position => Position).SPARK_File =
File_Cursor
then
declare
Reference : constant Analyzed_Entities.Constant_Reference_Type :=
This.Entities.Constant_Reference (Position => Position);
Sentinel : constant Proofs_Sentinel :=
Get_Sentinel (Node => Reference);
begin
Result := Duration'Max (Result,
Sentinel.Cache.Max_Proof_Time);
end;
end if;
end loop;

return Result;
end Max_Proof_Time;

---------------------------------------------------------------------------
-- Max_Success_Proof_Time
---------------------------------------------------------------------------
Expand All @@ -792,6 +825,43 @@ package body SPAT.Spark_Info is
return Sentinel.Cache.Max_Success_Proof_Time;
end Max_Success_Proof_Time;

---------------------------------------------------------------------------
-- Max_Success_Proof_Time
---------------------------------------------------------------------------
not overriding
function Max_Success_Proof_Time (This : in T;
File : in File_Name) return Duration
is
Result : Duration := -1.0;
File_Cursor : constant File_Sets.Cursor := This.Files.Find (Item => File);
use type File_Sets.Cursor;
begin
-- FIXME: We shouldn't need to iterate through all entities each time
-- this subprogram is called.
for Position in This.Entities.Iterate loop
if
Analyzed_Entities.Element (Position => Position).SPARK_File =
File_Cursor
then
declare
Reference : constant Analyzed_Entities.Constant_Reference_Type :=
This.Entities.Constant_Reference (Position => Position);
Sentinel : constant Proofs_Sentinel :=
Get_Sentinel (Node => Reference);
begin
if Sentinel.Cache.Has_Unproved_Attempts then
null; -- Unproved, so skip.
else
Result := Duration'Max (Result,
Sentinel.Cache.Max_Success_Proof_Time);
end if;
end;
end if;
end loop;

return Result;
end Max_Success_Proof_Time;

---------------------------------------------------------------------------
-- Num_Flows
---------------------------------------------------------------------------
Expand Down
17 changes: 17 additions & 0 deletions src/spat-spark_info.ads
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,23 @@ package SPAT.Spark_Info is
function Proof_Time (This : in T;
File : in File_Name) return Duration;

---------------------------------------------------------------------------
-- Max_Proof_Time
---------------------------------------------------------------------------
not overriding
function Max_Proof_Time (This : in T;
File : in File_Name) return Duration;

---------------------------------------------------------------------------
-- Max_Success_Proof_Time
--
-- Reported time for the longest successful proof.
-- If the time returned is -1.0, then nothing is proven.
---------------------------------------------------------------------------
not overriding
function Max_Success_Proof_Time (This : in T;
File : in File_Name) return Duration;

---------------------------------------------------------------------------
-- Max_Proof_Time
--
Expand Down
2 changes: 1 addition & 1 deletion test/spat.test-issues.sca.template
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
2 changes: 1 addition & 1 deletion test/spat.test-issues.scs.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Warning: Sorting files by success time not implemented yet, falling back to maximum time.
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
2 changes: 1 addition & 1 deletion test/spat.test-issues.sct.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Warning: Sorting files by success time not implemented yet, falling back to maximum time.
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
2 changes: 1 addition & 1 deletion test/spat.test-issues.sdca.template
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
2 changes: 1 addition & 1 deletion test/spat.test-issues.sdcs.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Warning: Sorting files by success time not implemented yet, falling back to maximum time.
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
2 changes: 1 addition & 1 deletion test/spat.test-issues.sdct.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Warning: Sorting files by success time not implemented yet, falling back to maximum time.
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
2 changes: 1 addition & 1 deletion test/spat.test-issues.sraca.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
RFLX.RFLX_Types => 0.0 s/0.0 s/0.0 s
RFLX.RFLX_Types.Byte_Index => 10.0 ms/10.0 ms/30.0 ms
RFLX.RFLX_Types.First_Bit_Index => 0.0 s/0.0 s/0.0 s
Expand Down
2 changes: 1 addition & 1 deletion test/spat.test-issues.sracs.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Warning: Sorting files by success time not implemented yet, falling back to maximum time.
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
RFLX.RFLX_Types.U64_Insert => 54.2 s/120.0 s/1.6 ks
RFLX.RFLX_Types.U64_Extract => 37.9 s/120.0 s/1.8 ks
RFLX.RFLX_Types.U64_Extract_Remaining => 10.1 s/120.0 s/376.5 s
Expand Down
2 changes: 1 addition & 1 deletion test/spat.test-issues.sract.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Warning: Sorting files by success time not implemented yet, falling back to maximum time.
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
RFLX.RFLX_Types.U64_Extract => 37.9 s/120.0 s/1.8 ks
RFLX.RFLX_Types.U64_Insert => 54.2 s/120.0 s/1.6 ks
RFLX.RFLX_Types.U64_Extract_Intermediate => 6.7 s/120.0 s/617.3 s
Expand Down
2 changes: 1 addition & 1 deletion test/spat.test-issues.sradca.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
RFLX.RFLX_Types => 0.0 s/0.0 s/0.0 s
RFLX.RFLX_Types.Byte_Index => 10.0 ms/10.0 ms/30.0 ms
`-VC_DIVISION_CHECK rflx-rflx_generic_types.ads:36:36 => 10.0 ms/10.0 ms/10.0 ms
Expand Down
2 changes: 1 addition & 1 deletion test/spat.test-issues.sradcs.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Warning: Sorting files by success time not implemented yet, falling back to maximum time.
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
RFLX.RFLX_Types.U64_Insert => 54.2 s/120.0 s/1.6 ks
`-VC_PRECONDITION rflx-rflx_generic_types.adb:221:39 => 5.2 s/120.0 s/490.6 s
`-CVC4: 120.0 s (Timeout,-1 steps)
Expand Down
2 changes: 1 addition & 1 deletion test/spat.test-issues.sradct.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Warning: Sorting files by success time not implemented yet, falling back to maximum time.
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
RFLX.RFLX_Types.U64_Extract => 37.9 s/120.0 s/1.8 ks
`-VC_PRECONDITION rflx-rflx_generic_types.adb:131:29 => 37.9 s/120.0 s/1.1 ks
`-Z3: 120.0 s (Timeout,-1 steps)
Expand Down
2 changes: 1 addition & 1 deletion test/spat.test-issues.srfca.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
RFLX.RFLX_Types.U64_Extract => 37.9 s/120.0 s/1.8 ks
RFLX.RFLX_Types.U64_Extract.D => 4.7 s/9.5 s/70.6 s
RFLX.RFLX_Types.U64_Extract_Intermediate => 6.7 s/120.0 s/617.3 s
Expand Down
2 changes: 1 addition & 1 deletion test/spat.test-issues.srfcs.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Warning: Sorting files by success time not implemented yet, falling back to maximum time.
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
RFLX.RFLX_Types.U64_Insert => 54.2 s/120.0 s/1.6 ks
RFLX.RFLX_Types.U64_Extract => 37.9 s/120.0 s/1.8 ks
RFLX.RFLX_Types.U64_Extract_Remaining => 10.1 s/120.0 s/376.5 s
Expand Down
2 changes: 1 addition & 1 deletion test/spat.test-issues.srfct.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Warning: Sorting files by success time not implemented yet, falling back to maximum time.
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
RFLX.RFLX_Types.U64_Extract => 37.9 s/120.0 s/1.8 ks
RFLX.RFLX_Types.U64_Insert => 54.2 s/120.0 s/1.6 ks
RFLX.RFLX_Types.U64_Extract_Intermediate => 6.7 s/120.0 s/617.3 s
Expand Down
2 changes: 1 addition & 1 deletion test/spat.test-issues.srfdca.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
RFLX.RFLX_Types.U64_Extract => 37.9 s/120.0 s/1.8 ks
`-VC_PRECONDITION rflx-rflx_generic_types.adb:131:29 => 37.9 s/120.0 s/1.1 ks
`-Z3: 120.0 s (Timeout,-1 steps)
Expand Down
2 changes: 1 addition & 1 deletion test/spat.test-issues.srfdcs.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Warning: Sorting files by success time not implemented yet, falling back to maximum time.
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
RFLX.RFLX_Types.U64_Insert => 54.2 s/120.0 s/1.6 ks
`-VC_PRECONDITION rflx-rflx_generic_types.adb:221:39 => 5.2 s/120.0 s/490.6 s
`-CVC4: 120.0 s (Timeout,-1 steps)
Expand Down
2 changes: 1 addition & 1 deletion test/spat.test-issues.srfdct.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Warning: Sorting files by success time not implemented yet, falling back to maximum time.
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
RFLX.RFLX_Types.U64_Extract => 37.9 s/120.0 s/1.8 ks
`-VC_PRECONDITION rflx-rflx_generic_types.adb:131:29 => 37.9 s/120.0 s/1.1 ks
`-Z3: 120.0 s (Timeout,-1 steps)
Expand Down
2 changes: 1 addition & 1 deletion test/spat.test-issues.srjca.template
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
2 changes: 1 addition & 1 deletion test/spat.test-issues.srjcs.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Warning: Sorting files by success time not implemented yet, falling back to maximum time.
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
2 changes: 1 addition & 1 deletion test/spat.test-issues.srjct.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Warning: Sorting files by success time not implemented yet, falling back to maximum time.
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
2 changes: 1 addition & 1 deletion test/spat.test-issues.srjdca.template
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
2 changes: 1 addition & 1 deletion test/spat.test-issues.srjdcs.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Warning: Sorting files by success time not implemented yet, falling back to maximum time.
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
2 changes: 1 addition & 1 deletion test/spat.test-issues.srjdct.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Warning: Sorting files by success time not implemented yet, falling back to maximum time.
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
2 changes: 1 addition & 1 deletion test/spat.test-issues.sruca.template
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
2 changes: 1 addition & 1 deletion test/spat.test-issues.srucs.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Warning: Sorting files by success time not implemented yet, falling back to maximum time.
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
2 changes: 1 addition & 1 deletion test/spat.test-issues.sruct.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Warning: Sorting files by success time not implemented yet, falling back to maximum time.
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
2 changes: 1 addition & 1 deletion test/spat.test-issues.srudca.template
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
2 changes: 1 addition & 1 deletion test/spat.test-issues.srudcs.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Warning: Sorting files by success time not implemented yet, falling back to maximum time.
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
2 changes: 1 addition & 1 deletion test/spat.test-issues.srudct.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Warning: Sorting files by success time not implemented yet, falling back to maximum time.
rflx-rflx_types.spark => (Flow => 7.2 ms,
Proof => 4.5 ks)
Proof => 54.2 s/120.0 s/4.5 ks)
10 changes: 5 additions & 5 deletions test/spat.test-saatana.sca.template
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
saatana.spark => (Flow => 464.0 µs,
Proof => 0.0 s)
Proof => 0.0 s/0.0 s/0.0 s)
saatana-crypto.spark => (Flow => 9.0 ms,
Proof => 6.8 s)
Proof => 80.0 ms/80.0 ms/6.8 s)
saatana-crypto-lemmas.spark => (Flow => 2.1 ms,
Proof => 2.2 s)
Proof => 210.0 ms/210.0 ms/2.2 s)
saatana-crypto-phelix.spark => (Flow => 206.5 ms,
Proof => 568.7 s)
Proof => 174.3 s/206.4 s/568.7 s)
test_phelix_api.spark => (Flow => 14.4 ms,
Proof => 23.1 s)
Proof => 240.0 ms/240.0 ms/23.1 s)
10 changes: 5 additions & 5 deletions test/spat.test-saatana.scs.template
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Warning: Sorting files by success time not implemented yet, falling back to maximum time.
saatana-crypto-phelix.spark => (Flow => 206.5 ms,
Proof => 568.7 s)
Proof => 174.3 s/206.4 s/568.7 s)
test_phelix_api.spark => (Flow => 14.4 ms,
Proof => 23.1 s)
Proof => 240.0 ms/240.0 ms/23.1 s)
saatana-crypto.spark => (Flow => 9.0 ms,
Proof => 6.8 s)
Proof => 80.0 ms/80.0 ms/6.8 s)
saatana-crypto-lemmas.spark => (Flow => 2.1 ms,
Proof => 2.2 s)
Proof => 210.0 ms/210.0 ms/2.2 s)
saatana.spark => (Flow => 464.0 µs,
Proof => 0.0 s)
Proof => 0.0 s/0.0 s/0.0 s)
10 changes: 5 additions & 5 deletions test/spat.test-saatana.sct.template
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Warning: Sorting files by success time not implemented yet, falling back to maximum time.
saatana-crypto-phelix.spark => (Flow => 206.5 ms,
Proof => 568.7 s)
Proof => 174.3 s/206.4 s/568.7 s)
test_phelix_api.spark => (Flow => 14.4 ms,
Proof => 23.1 s)
Proof => 240.0 ms/240.0 ms/23.1 s)
saatana-crypto.spark => (Flow => 9.0 ms,
Proof => 6.8 s)
Proof => 80.0 ms/80.0 ms/6.8 s)
saatana-crypto-lemmas.spark => (Flow => 2.1 ms,
Proof => 2.2 s)
Proof => 210.0 ms/210.0 ms/2.2 s)
saatana.spark => (Flow => 464.0 µs,
Proof => 0.0 s)
Proof => 0.0 s/0.0 s/0.0 s)
Loading