Skip to content

Commit

Permalink
update other files using b_input
Browse files Browse the repository at this point in the history
  • Loading branch information
tanyongkiam committed Mar 6, 2024
1 parent 24289f6 commit 25dd2bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion examples/eval/eval_exampleProgScript.sml
Expand Up @@ -28,13 +28,14 @@ End

val res = translate trimr_def;

(* TODO changed but this file is broken *)
val fname_to_words = process_topdecs`
fun fname_to_words from_int fname =
List.map
(from_int o
Option.valOf o Int.fromNatString o
trimr)
(Option.valOf (TextIO.b_inputLinesFrom fname))
(Option.valOf (TextIO.b_inputLinesFrom #"\n" fname))
handle _ => (print "Error reading data to eval.\n";
Runtime.exit 1; [])`;

Expand Down
7 changes: 5 additions & 2 deletions examples/opentheory/readerProgScript.sml
Expand Up @@ -267,7 +267,7 @@ val _ = (append_prog o process_topdecs) `

val _ = (append_prog o process_topdecs) `
fun read_file file =
case TextIO.b_inputAllTokensFrom file is_newline tokenize of
case TextIO.b_inputAllTokensFrom #"\n" file is_newline tokenize of
None =>
TextIO.output TextIO.stdErr (msg_bad_name file)
| Some ls =>
Expand Down Expand Up @@ -366,7 +366,7 @@ Theorem b_inputAllTokensFrom_spec2:
FILENAME fn fnv ∧
hasFreeFD fs ⇒
app (p: 'ffi ffi_proj) TextIO_b_inputAllTokensFrom_v
[fnv; is_newline_v; tokenize_v]
[Litv (Char #"\n") ; fnv; is_newline_v; tokenize_v]
(STDIO fs)
(POSTv sv.
&OPTION_TYPE (LIST_TYPE (LIST_TYPE READER_COMMAND_TYPE))
Expand All @@ -378,6 +378,9 @@ Theorem b_inputAllTokensFrom_spec2:
STDIO fs)
Proof
strip_tac
\\ `all_lines fs fn = all_lines_gen #"\n" fs fn` by
rw[all_lines_def,all_lines_gen_def,lines_of_def,lines_of_gen_def,splitlines_at_def,splitlines_def,str_def]
\\ pop_assum SUBST_ALL_TAC
\\ irule b_inputAllTokensFrom_spec
\\ simp [theorem "is_newline_v_thm", tokenize_v_thm, is_newline_def]
QED
Expand Down

0 comments on commit 25dd2bb

Please sign in to comment.