Giter Site home page Giter Site logo

Comments (2)

andrew-appel avatar andrew-appel commented on June 28, 2024

In case we want to do the latter (get change_compspecs to handle cstring), here's the code to do it:

Lemma change_compspecs_cstring: forall cs1 cs2: compspecs, (* put this in Floyd *)
    @cstring cs1 = @cstring cs2.
Proof.
intros.
extensionality sh s p.
unfold cstring.
f_equal.
set (u := map _ _). clearbody u.
set (n := Zlength _ + _). clearbody n.
unfold data_at.
unfold field_at.
f_equal.
f_equal.
unfold field_compatible.
f_equal; auto.
f_equal; auto.
f_equal; auto.
f_equal; auto.
unfold align_compatible.
destruct p; simpl; auto.
apply prop_ext; split; intro;
(apply align_compatible_rec_Tarray; intros j ?;
 apply align_compatible_rec_Tarray_inv with (i:=j) in H; auto;
 inv H; econstructor; eauto).
Qed.

Ltac forward.change_compspecs cs :=
  match goal with
  | |- context [ ?cs' ] =>
        match type of cs' with
        | compspecs =>
            try (constr_eq cs cs'; fail 1); 
            first [rewrite !(change_compspecs_cstring cs' cs)  (* new! *)
                  | change_compspecs' cs' cs];
            repeat change_compspecs' cs cs'
        end
  end.

from vst.

lennartberinger avatar lennartberinger commented on June 28, 2024

I believe this is a more general issue (and somewhat related to the fact that computational aspects of compspecs are built into floyd rather early), so it would be good if a solution with a minimal (or perhaps even better: arbitrary but not automatically instantiated) compspecs could be realized.

from vst.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.