comp.lang.ada
 help / color / mirror / Atom feed
From: "Phil Thornley" <phil.thornley@baesystems.com>
Subject: Re: [Spark] Converting Arrays
Date: Wed, 12 Mar 2003 08:43:17 -0000
Date: 2003-03-12T08:43:17+00:00	[thread overview]
Message-ID: <3e6ef2ad$1@baen1673807.greenlnk.net> (raw)
In-Reply-To: ON9GtiBcskb+IwAh@diphi.demon.co.uk

"JP Thornley" <jpt@diphi.demon.co.uk> wrote in message
news:ON9GtiBcskb+IwAh@diphi.demon.co.uk...

> You can then write the proof rule for Length_Of_Path:
>     to_fullpath_rules(100): length_of_path may_be_replaced_by
>                             path__last - path__first + 1 .
>
> Append this to the generated rule file before running the Simplifier.
> (The rule number needs to be larger than the highest rule number
> generated by the Examiner).

Perhaps I should add that this is a slightly quick and dirty way of
getting the proof rule in. It has the advantage that the Simplifier will
be able to use it, but the disadvantage that the rule has to be created
for every subprogram that calls To_Fullpath as well as for To_Fullpath
itself (and I'm sure that no-one would ever contemplate creating a
different rule for different situations :-).

The more 'correct' way is to write a new rule family. Create a file
called (say) test.rls with contents:
   rule_family test:
      X requires [X:any].
   test_rule(1): length_of_path may_be_replaced_by
                            path__last - path__first + 1 .

(Warning - the above is as written, and unchecked.)

Then 'consult' this file in the Checker and use the rule in a 'replace'
command.

The advantage of this is that the rule is only written once, so there
can't be any mistakes made in duplicating it, but has the disadvantage
that the Simplifier won't be able to do anything with 'length_of_path'
and you end up with more VCs to prove in the Checker.

Cheers,

Phil

--
Phil Thornley
BAE SYSTEMS





  reply	other threads:[~2003-03-12  8:43 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-10 17:06 [Spark] Converting Arrays Lutz Donnerhacke
2003-03-10 20:03 ` James S. Rogers
2003-03-10 22:33   ` Lutz Donnerhacke
2003-03-11 10:14 ` Rod Chapman
2003-03-11 10:51   ` Lutz Donnerhacke
2003-03-11 10:52   ` Lutz Donnerhacke
2003-03-11 20:46     ` JP Thornley
2003-03-12  8:43       ` Phil Thornley [this message]
2003-03-12 11:57         ` Lutz Donnerhacke
2003-03-12 18:46           ` JP Thornley
2003-03-13 10:14             ` Lutz Donnerhacke
2003-03-12  9:43     ` Rod Chapman
2003-03-12 10:15       ` Lutz Donnerhacke
  -- strict thread matches above, loose matches on Subject: below --
2003-03-13  5:55 Grein, Christoph
2003-03-13  9:47 ` Peter Amey
2003-03-13 10:15   ` Lutz Donnerhacke
2003-03-21 15:05     ` Peter Amey
2003-03-21 15:17       ` Lutz Donnerhacke
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox