Skip to content

Commit

Permalink
Add function signature only in interface mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
maximebuyse committed Nov 28, 2024
1 parent eb63300 commit 1727e58
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
8 changes: 5 additions & 3 deletions engine/backends/fstar/fstar_backend.ml
Original file line number Diff line number Diff line change
Expand Up @@ -959,9 +959,11 @@ struct

let intf = F.decl ~fsti:true (F.AST.Val (name, arrow_typ)) in

if is_erased then intf :: erased_impl name arrow_typ []
else if interface_mode then [ impl; intf ]
else [ full ]
let erased = erased_impl name arrow_typ [] in
let impl, full =
if is_erased then (erased, erased) else ([ impl ], [ full ])
in
if interface_mode then intf :: impl else full
| TyAlias { name; generics; ty } ->
let pat =
F.pat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,4 @@ class t_T (v_Self: Type0) = {

[@@ FStar.Tactics.Typeclasses.tcinstance]
val impl_T_for_u8:t_T u8

val c:u8
'''
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@ open FStar.Mul
/// modifier, `f` is still extractable as an interface.
/// Expressions within type are still extracted, as well as pre- and
/// post-conditions.
val f (x: u8)
: Prims.Pure (t_Array u8 (sz 4))
(requires x <. 254uy)
(ensures
fun r ->
let r:t_Array u8 (sz 4) = r in
(r.[ sz 0 ] <: u8) >. x)

assume
val f': x: u8
-> Prims.Pure (t_Array u8 (sz 4))
Expand Down Expand Up @@ -81,8 +73,6 @@ val impl_1': Core.Convert.t_From t_Bar u8

let impl_1 = impl_1'

val from__from: u8 -> t_Bar

assume
val from__from': u8 -> t_Bar

Expand Down

0 comments on commit 1727e58

Please sign in to comment.