Skip to content
Draft
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
11 changes: 4 additions & 7 deletions basis/CommandLineProofScript.sml
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,9 @@ Proof
\\ fs[cfHeapsBaseTheory.IOx_def,cl_ffi_part_def,COMMANDLINE_def,IO_def]
\\ xsimpl
\\ qmatch_goalsub_abbrev_tac `FFI_part s u ns`
\\ qexistsl [‘[]’, `emp`, `s`, `u`, `ns`, `events`]
\\ qexistsl [`emp`, `s`, `u`, `ns`, `events`]
\\ xsimpl
\\ unabbrev_all_tac \\ fs []
\\ rewrite_tac [mlstringTheory.implode_def]
\\ fs[cfHeapsBaseTheory.mk_ffi_next_def,ffi_get_arg_length_def,
GSYM cfHeapsBaseTheory.encode_list_def,LENGTH_EQ_NUM_compute]
\\ fs [wfcl_def] \\ xsimpl
Expand All @@ -178,10 +177,9 @@ Proof
\\ qabbrev_tac `extra = W8ARRAY av [n2w (strlen x); n2w (strlen x DIV 256)]`
\\ xsimpl
\\ qmatch_goalsub_abbrev_tac `FFI_part s u ns`
\\ qexistsl [‘[]’, `extra`, `s`, `u`, `ns`, `events`]
\\ qexistsl [`extra`, `s`, `u`, `ns`, `events`]
\\ xsimpl
\\ unabbrev_all_tac \\ fs []
\\ rewrite_tac [mlstringTheory.implode_def]
\\ fs[cfHeapsBaseTheory.mk_ffi_next_def,ffi_get_arg_def,
GSYM cfHeapsBaseTheory.encode_list_def,LENGTH_EQ_NUM_compute]
\\ fs [wfcl_def,SUC_SUC_MAX2,two_byte_sum] \\ xsimpl
Expand Down Expand Up @@ -210,7 +208,7 @@ Proof
\\ `strlen x = LENGTH (MAP ((n2w:num->word8) ∘ ORD) (explode x))` by fs [mlstringTheory.LENGTH_explode]
\\ asm_rewrite_tac [TAKE_LENGTH_APPEND]
\\ full_simp_tac std_ss [GSYM APPEND_ASSOC,APPEND,EL_LENGTH_APPEND,NULL,HD]
\\ fs [MAP_MAP_o, CHR_w2n_n2w_ORD, GSYM mlstringTheory.implode_def]
\\ fs [MAP_MAP_o, CHR_w2n_n2w_ORD]
\\ fs[DROP_APPEND,DROP_LENGTH_TOO_LONG]
QED

Expand Down Expand Up @@ -238,9 +236,8 @@ Proof
\\ fs[cfHeapsBaseTheory.IOx_def,cl_ffi_part_def,IO_def]
\\ xsimpl
\\ qmatch_goalsub_abbrev_tac `FFI_part s u ns`
\\ qexistsl [‘[]’, `emp`, `s`, `u`, `ns`, `events`]
\\ qexistsl [`emp`, `s`, `u`, `ns`, `events`]
\\ xsimpl
\\ rewrite_tac [mlstringTheory.implode_def]
\\ unabbrev_all_tac \\ fs []
\\ fs[cfHeapsBaseTheory.mk_ffi_next_def,ffi_get_arg_count_def,
GSYM cfHeapsBaseTheory.encode_list_def]
Expand Down
4 changes: 2 additions & 2 deletions basis/StringProgScript.sml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ val result = translate strcat_def;
val _ = trans "^" mlstringSyntax.strcat_tm;
val _ = trans "=" “((=):mlstring -> mlstring -> bool)”;

val result = translate (extract_def |> REWRITE_RULE [implode_def]);
val result = translate extract_def;

val extract_side_def = definition"extract_side_def";
val extract_side_thm = Q.prove(
`!s i opt. extract_side s i opt`,
rw [extract_side_def, arithmeticTheory.MIN_DEF] ) |> update_precondition

val _ = ml_prog_update open_local_block;
val res = translate (concatWith_aux_def |> REWRITE_RULE [implode_def]);
val res = translate concatWith_aux_def;
val _ = ml_prog_update open_local_in_block;

val _ = next_ml_names := ["concatWith"];
Expand Down
6 changes: 3 additions & 3 deletions basis/TextIOProgScript.sml
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ End
val _ = next_ml_names := ["stdOut","stdErr"];

val r = stdOut_def
|> SIMP_RULE (srw_ss()) [mlstringTheory.implode_def, MarshallingTheory.n2w8_def]
|> SIMP_RULE (srw_ss()) [MarshallingTheory.n2w8_def]
|> translate;

val r = stdErr_def
|> SIMP_RULE (srw_ss()) [mlstringTheory.implode_def, MarshallingTheory.n2w8_def]
|> SIMP_RULE (srw_ss()) [MarshallingTheory.n2w8_def]
|> translate ;


Expand All @@ -149,7 +149,7 @@ End
val _ = next_ml_names := ["raw_stdIn"];

val r = raw_stdIn_def
|> SIMP_RULE (srw_ss()) [mlstringTheory.implode_def, MarshallingTheory.n2w8_def]
|> SIMP_RULE (srw_ss()) [MarshallingTheory.n2w8_def]
|> translate;

Quote add_cakeml:
Expand Down
Loading