Skip to content

What tactic is needed to rewrite a sub-expression in the goal state? #2752

Answered by mtzguido
klinvill asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Kirby. The rewrite primitive only works for equalities with a variable on the LHS, and basically does substitution. To rewrite general term equalities, there is grewrite_eq, but it does not work in this example since the inferred equality type for your h5 binder is seq UInt8.t, but the bytes_to_seq b1 subterm is inferred at the refined type.

This variation works for me, maybe it can unblock you, but this is something to fix for sure.

module Test

open FStar.Seq
open FStar.Bytes

// Total function to convert a bytes type to a sequence of bytes
assume val bytes_to_seq (l: bytes) : seq byte

assume val __lemma_bytes_to_seq (l: bytes) : Lemma
  (ensures bytes_to_seq l == Bytes.reveal l)

let 

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@klinvill
Comment options

@mtzguido
Comment options

Answer selected by klinvill
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants