Skip to content

Commit

Permalink
Refactor assert into RuntimeProg
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoBecker committed Mar 3, 2020
1 parent 89ada40 commit fcce77b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 27 deletions.
22 changes: 0 additions & 22 deletions basis/AssertProgScript.sml

This file was deleted.

4 changes: 2 additions & 2 deletions basis/OptionProgScript.sml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
(*
Module about the option tyoe.
*)
open preamble ml_translatorLib ml_progLib AssertProgTheory
open preamble ml_translatorLib ml_progLib RuntimeProgTheory
mloptionTheory

val _ = new_theory"OptionProg"

val _ = translation_extends "AssertProg"
val _ = translation_extends "RuntimeProg"

val _ = ml_prog_update (open_module "Option");

Expand Down
3 changes: 0 additions & 3 deletions basis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ A module about Arrays for the CakeML standard basis library.
[ArrayProofScript.sml](ArrayProofScript.sml):
Proofs about the Array module.

[AssertProgScript.sml](AssertProgScript.sml):
Module about CakeML assertions

[CharProgScript.sml](CharProgScript.sml):
A module about the char type for the CakeML standard basis library.

Expand Down
8 changes: 8 additions & 0 deletions basis/RuntimeProgScript.sml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ val abort = process_topdecs `fun abort u = case u of () => exit 1`

val _ = append_prog abort

val _ = process_topdecs `
fun assert cond msg =
if (cond)
then ()
else (debugMsg (String.^ ("Assertion Failure: ") (msg));
abort());`
|> append_prog;

val _ = ml_prog_update (close_module NONE);

val _ = export_theory();

0 comments on commit fcce77b

Please sign in to comment.