Skip to content

Commit

Permalink
bool-inequality-function-notation
Browse files Browse the repository at this point in the history
  • Loading branch information
fvogels committed Nov 15, 2024
1 parent 6efd77a commit b876330
Show file tree
Hide file tree
Showing 8 changed files with 198 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: monospace, monospace;
}

.tooltipped {
position: relative;
}

.tooltip {
background-color: white;
visibility: hidden;
border: black 1px solid;
position: absolute;
z-index: 1;
padding: 1em;
top: 100%;
left: 0;
}

.tooltipped:hover {
border: 1px solid black;
}

.tooltipped:hover > .tooltip {
visibility: visible;
}
</style>
</head>
<body>
(*<
(generate (base-html-translation))
>*)
</body>
</html>
16 changes: 16 additions & 0 deletions tests/coq-tests/bool-inequality-function-notation/base.template.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
(*<
(generate (base-translation))
>*)

(*<
(if (untranslated-definitions?)
(generate "Theorem UNTRANSLATED_DEFINITIONS : False. Qed."))
>*)

(*
(*<
(generate (untranslated-definitions))
>*)
*)
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
(use-list-notations)

(ignore-all-overloads)
(ignore-pragmas "include_start"
"include_end"
"file_start"
"file_end"
"sail_internal")

(ignore-function-definition-predicate (lambda (identifier)
(or
(string-ends-with? "_of_num" identifier)
(string-starts-with? "num_of_" identifier)
(string-starts-with? "undefined_" identifier)
(string-starts-with? "regval_of_" identifier)
(string-ends-with? "_of_regval" identifier)
(contains? '(
"eq_unit"
"neq_int"
"neq_bool"
"neq_bits"
"slice_mask"
"_shl_int_general"
"_shr_int_general"
"fdiv_int"
"fmod_int"
"is_none"
"is_some"
"__id"
"sail_mask"
"sail_ones"
"concat_str_bits"
"concat_str_dec")
identifier))))

(ignore-type-definition-predicate (lambda (identifier)
(contains? '(
"option"
"register_value"
"bits"
"regstate")
identifier)))

(ignore-value-definition-predicate
(lambda (identifier)
(contains? '(
"default_capability"
"initial_regstate"
"initial_Capability"
)
identifier)))

(template "base.template.v")
(template "machine.template.v")
(template "base.template.html")
(template "machine.template.html")

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: monospace, monospace;
}

.tooltipped {
position: relative;
}

.tooltip {
background-color: white;
visibility: hidden;
border: black 1px solid;
position: absolute;
z-index: 1;
padding: 1em;
top: 100%;
left: 0;
}

.tooltipped:hover {
border: 1px solid black;
}

.tooltipped:hover > .tooltip {
visibility: visible;
}
</style>
</head>
<body>
(*<
(generate (program-html-translation))
>*)
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Require Export base.

(*<
(generate (program-translation))
>*)
9 changes: 9 additions & 0 deletions tests/coq-tests/bool-inequality-function-notation/model.sail
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
default Order dec

$include <prelude.sail>


val foo : (bool, bool) -> bool
function foo(x, y) = {
x != y
}
20 changes: 20 additions & 0 deletions tests/coq-tests/bool-inequality-function-notation/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

set -e

SAIL=sail
COQ=coqc

SAIL_SOURCES=model.sail
TESTED_FILE=microsail.v

if [ -n "$1" ]
then
OPT="-ddump_rewrite_ast intermediate"
else
OPT=
fi

$SAIL $OPT -katamaran -katamaran_config configuration.lisp $SAIL_SOURCES
$COQ base.v
$COQ machine.v
15 changes: 15 additions & 0 deletions tests/coq-tests/bool-inequality-function-notation/translate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
SAIL=sail
COQ=coqc

SAIL_SOURCES=model.sail
TESTED_FILE=microsail.v

if [ -n "$1" ]
then
OPT="-ddump_rewrite_ast intermediate"
else
OPT=
fi

$SAIL $OPT -katamaran -katamaran_config configuration.lisp $SAIL_SOURCES

0 comments on commit b876330

Please sign in to comment.