aboutsummaryrefslogtreecommitdiff
path: root/src/PushButtonSynthesis
diff options
context:
space:
mode:
authorGravatar Jason Gross <jgross@mit.edu>2019-02-01 16:14:30 -0500
committerGravatar Jason Gross <jasongross9@gmail.com>2019-02-02 18:22:15 -0500
commitd2b8d2b69b239ffd343d87078addab0c82ad1c43 (patch)
tree16793af5e92f3d0bcae0a4c5413b01cd2106d731 /src/PushButtonSynthesis
parentaf2d2226b1fa739ed9ba9a279fe771109c7a9751 (diff)
Rename docstring generator based on Andres' suggestion
Diffstat (limited to 'src/PushButtonSynthesis')
-rw-r--r--src/PushButtonSynthesis/Primitives.v24
-rw-r--r--src/PushButtonSynthesis/SaturatedSolinas.v6
-rw-r--r--src/PushButtonSynthesis/UnsaturatedSolinas.v28
-rw-r--r--src/PushButtonSynthesis/WordByWordMontgomery.v28
4 files changed, 43 insertions, 43 deletions
diff --git a/src/PushButtonSynthesis/Primitives.v b/src/PushButtonSynthesis/Primitives.v
index 392a63c78..96c57f132 100644
--- a/src/PushButtonSynthesis/Primitives.v
+++ b/src/PushButtonSynthesis/Primitives.v
@@ -565,21 +565,21 @@ Module CorrectnessStringification.
let res := strip_lambdas res in
res.
- Notation stringify_correctness_with_ctx ctx evalf pre_extra correctness
+ Notation docstring_with_summary_from_lemma_with_ctx ctx evalf pre_extra correctness
:= (fun fname arg_var_data out_var_data
=> ltac:(let res := stringify ctx correctness evalf fname arg_var_data out_var_data in
refine (List.app (pre_extra fname) res))) (only parsing).
- Notation stringify_correctness evalf pre_extra correctness
+ Notation docstring_with_summary_from_lemma evalf pre_extra correctness
:= (match dyn_context.nil with
- | ctx' => stringify_correctness_with_ctx ctx' evalf pre_extra correctness
+ | ctx' => docstring_with_summary_from_lemma_with_ctx ctx' evalf pre_extra correctness
end)
(only parsing).
End CorrectnessStringification.
-Notation "'stringify_correctness_with_ctx!' ctx evalf pre_extra correctness"
- := (CorrectnessStringification.stringify_correctness_with_ctx ctx evalf pre_extra correctness) (only parsing, at level 10, ctx at next level, evalf at next level, pre_extra at next level, correctness at next level).
-Notation "'stringify_correctness!' evalf pre_extra correctness"
- := (CorrectnessStringification.stringify_correctness evalf pre_extra correctness) (only parsing, at level 10, evalf at next level, pre_extra at next level, correctness at next level).
+Notation "'docstring_with_summary_from_lemma_with_ctx!' ctx evalf pre_extra correctness"
+ := (CorrectnessStringification.docstring_with_summary_from_lemma_with_ctx ctx evalf pre_extra correctness) (only parsing, at level 10, ctx at next level, evalf at next level, pre_extra at next level, correctness at next level).
+Notation "'docstring_with_summary_from_lemma!' evalf pre_extra correctness"
+ := (CorrectnessStringification.docstring_with_summary_from_lemma evalf pre_extra correctness) (only parsing, at level 10, evalf at next level, pre_extra at next level, correctness at next level).
Section __.
Context (n : nat)
@@ -622,7 +622,7 @@ Section __.
:= Eval cbv beta in
FromPipelineToString
prefix "selectznz" selectznz
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
evalf
(fun fname : string => ["The function " ++ fname ++ " is a multi-limb conditional select."]%string)
(selectznz_correct dummy_weight n saturated_bounds_list)).
@@ -642,7 +642,7 @@ Section __.
:= Eval cbv beta in
FromPipelineToString
prefix ("mulx_u" ++ decimal_string_of_Z s) (mulx s)
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
evalf
(fun fname : string => ["The function " ++ fname ++ " is a multiplication, returning the full double-width result."]%string)
(mulx_correct s)).
@@ -663,7 +663,7 @@ Section __.
:= Eval cbv beta in
FromPipelineToString
prefix ("addcarryx_u" ++ decimal_string_of_Z s) (addcarryx s)
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
evalf
(fun fname : string => ["The function " ++ fname ++ " is an addition with carry."]%string)
(addcarryx_correct s)).
@@ -683,7 +683,7 @@ Section __.
:= Eval cbv beta in
FromPipelineToString
prefix ("subborrowx_u" ++ decimal_string_of_Z s) (subborrowx s)
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
evalf
(fun fname : string => ["The function " ++ fname ++ " is a subtraction with borrow."]%string)
(subborrowx_correct s)).
@@ -704,7 +704,7 @@ Section __.
:= Eval cbv beta in
FromPipelineToString
prefix ("cmovznz_u" ++ decimal_string_of_Z s) (cmovznz s)
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
evalf
(fun fname : string => ["The function " ++ fname ++ " is a single-word conditional move."]%string)
(cmovznz_correct s)).
diff --git a/src/PushButtonSynthesis/SaturatedSolinas.v b/src/PushButtonSynthesis/SaturatedSolinas.v
index 6de66a50f..47431eb09 100644
--- a/src/PushButtonSynthesis/SaturatedSolinas.v
+++ b/src/PushButtonSynthesis/SaturatedSolinas.v
@@ -138,8 +138,8 @@ Section __.
Local Notation weightf := (weight machine_wordsize 1).
Local Notation evalf := (eval weightf n).
Local Notation initial_ctx := (CorrectnessStringification.dyn_context.nil).
- Local Notation "'stringify_correctness!' pre_extra correctness"
- := (stringify_correctness_with_ctx!
+ Local Notation "'docstring_with_summary_from_lemma!' pre_extra correctness"
+ := (docstring_with_summary_from_lemma_with_ctx!
initial_ctx
evalf
pre_extra
@@ -161,7 +161,7 @@ Section __.
:= Eval cbv beta in
FromPipelineToString
prefix "mul" mul
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
(fun fname : string => ["The function " ++ fname ++ " multiplies two field elements."]%string)
(mul_correct weightf n m boundsn)).
diff --git a/src/PushButtonSynthesis/UnsaturatedSolinas.v b/src/PushButtonSynthesis/UnsaturatedSolinas.v
index e443e7296..b25d648ea 100644
--- a/src/PushButtonSynthesis/UnsaturatedSolinas.v
+++ b/src/PushButtonSynthesis/UnsaturatedSolinas.v
@@ -261,8 +261,8 @@ else:
Local Notation weightf := (weight (Qnum limbwidth) (QDen limbwidth)).
Local Notation evalf := (eval weightf n).
Local Notation initial_ctx := (CorrectnessStringification.dyn_context.cons m "m"%string CorrectnessStringification.dyn_context.nil).
- Local Notation "'stringify_correctness!' pre_extra correctness"
- := (stringify_correctness_with_ctx!
+ Local Notation "'docstring_with_summary_from_lemma!' pre_extra correctness"
+ := (docstring_with_summary_from_lemma_with_ctx!
initial_ctx
evalf
pre_extra
@@ -284,7 +284,7 @@ else:
:= Eval cbv beta in
FromPipelineToString
prefix "carry_mul" carry_mul
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
(fun fname : string => ["The function " ++ fname ++ " multiplies two field elements and reduces the result."]%string)
(carry_mul_correct weightf n m tight_bounds loose_bounds)).
@@ -303,7 +303,7 @@ else:
:= Eval cbv beta in
FromPipelineToString
prefix "carry_square" carry_square
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
(fun fname : string => ["The function " ++ fname ++ " squares a field element and reduces the result."]%string)
(carry_square_correct weightf n m tight_bounds loose_bounds)).
@@ -322,7 +322,7 @@ else:
:= Eval cbv beta in
FromPipelineToString
prefix ("carry_scmul_" ++ decimal_string_of_Z x) (carry_scmul_const x)
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
(fun fname : string => ["The function " ++ fname ++ " multiplies a field element by " ++ decimal_string_of_Z x ++ " and reduces the result."]%string)
(carry_scmul_const_correct weightf n m tight_bounds loose_bounds x)).
@@ -341,7 +341,7 @@ else:
:= Eval cbv beta in
FromPipelineToString
prefix "carry" carry
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
(fun fname : string => ["The function " ++ fname ++ " reduces a field element."]%string)
(carry_correct weightf n m tight_bounds loose_bounds)).
@@ -360,7 +360,7 @@ else:
:= Eval cbv beta in
FromPipelineToString
prefix "add" add
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
(fun fname : string => ["The function " ++ fname ++ " adds two field elements."]%string)
(add_correct weightf n m tight_bounds loose_bounds)).
@@ -379,7 +379,7 @@ else:
:= Eval cbv beta in
FromPipelineToString
prefix "sub" sub
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
(fun fname : string => ["The function " ++ fname ++ " subtracts two field elements."]%string)
(sub_correct weightf n m tight_bounds loose_bounds)).
@@ -398,7 +398,7 @@ else:
:= Eval cbv beta in
FromPipelineToString
prefix "opp" opp
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
(fun fname : string => ["The function " ++ fname ++ " negates a field element."]%string)
(opp_correct weightf n m tight_bounds loose_bounds)).
@@ -417,7 +417,7 @@ else:
:= Eval cbv beta in
FromPipelineToString
prefix "to_bytes" to_bytes
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
(fun fname : string => ["The function " ++ fname ++ " serializes a field element to bytes in little-endian order."]%string)
(to_bytes_correct weightf n n_bytes m tight_bounds)).
@@ -436,7 +436,7 @@ else:
:= Eval cbv beta in
FromPipelineToString
prefix "from_bytes" from_bytes
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
(fun fname : string => ["The function " ++ fname ++ " deserializes a field element from bytes in little-endian order."]%string)
(from_bytes_correct weightf n n_bytes m s tight_bounds)).
@@ -455,7 +455,7 @@ else:
:= Eval cbv beta in
FromPipelineToString
prefix "encode" encode
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
(fun fname : string => ["The function " ++ fname ++ " encodes an integer as a field element."]%string)
(encode_correct weightf n m tight_bounds)).
@@ -474,7 +474,7 @@ else:
:= Eval cbv beta in
FromPipelineToString
prefix "zero" zero
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
(fun fname => ["The function " ++ fname ++ " returns the field element zero."]%string)
(zero_correct weightf n m tight_bounds)).
@@ -493,7 +493,7 @@ else:
:= Eval cbv beta in
FromPipelineToString
prefix "one" one
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
(fun fname => ["The function " ++ fname ++ " returns the field element one."]%string)
(one_correct weightf n m tight_bounds)).
diff --git a/src/PushButtonSynthesis/WordByWordMontgomery.v b/src/PushButtonSynthesis/WordByWordMontgomery.v
index b368f352e..864c5c2eb 100644
--- a/src/PushButtonSynthesis/WordByWordMontgomery.v
+++ b/src/PushButtonSynthesis/WordByWordMontgomery.v
@@ -240,8 +240,8 @@ Section __.
(@eval 8 n_bytes) "bytes_eval"%string
CorrectnessStringification.dyn_context.nil))))
(only parsing).
- Local Notation "'stringify_correctness!' prefix pre_extra correctness"
- := (stringify_correctness_with_ctx!
+ Local Notation "'docstring_with_summary_from_lemma!' prefix pre_extra correctness"
+ := (docstring_with_summary_from_lemma_with_ctx!
(initial_ctx prefix)
evalf
pre_extra
@@ -263,7 +263,7 @@ Section __.
:= Eval cbv beta in
FromPipelineToString
prefix "mul" mul
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
prefix
(fun fname : string => ["The function " ++ fname ++ " multiplies two field elements in the Montgomery domain."]%string)
(mul_correct machine_wordsize n m valid from_montgomery_res)).
@@ -283,7 +283,7 @@ Section __.
:= Eval cbv beta in
FromPipelineToString
prefix "square" square
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
prefix
(fun fname : string => ["The function " ++ fname ++ " squares a field element in the Montgomery domain."]%string)
(square_correct machine_wordsize n m valid from_montgomery_res)).
@@ -303,7 +303,7 @@ Section __.
:= Eval cbv beta in
FromPipelineToString
prefix "add" add
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
prefix
(fun fname : string => ["The function " ++ fname ++ " adds two field elements in the Montgomery domain."]%string)
(add_correct machine_wordsize n m valid from_montgomery_res)).
@@ -323,7 +323,7 @@ Section __.
:= Eval cbv beta in
FromPipelineToString
prefix "sub" sub
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
prefix
(fun fname : string => ["The function " ++ fname ++ " subtracts two field elements in the Montgomery domain."]%string)
(sub_correct machine_wordsize n m valid from_montgomery_res)).
@@ -343,7 +343,7 @@ Section __.
:= Eval cbv beta in
FromPipelineToString
prefix "opp" opp
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
prefix
(fun fname : string => ["The function " ++ fname ++ " negates a field element in the Montgomery domain."]%string)
(opp_correct machine_wordsize n m valid from_montgomery_res)).
@@ -363,7 +363,7 @@ Section __.
:= Eval cbv beta in
FromPipelineToString
prefix "from_montgomery" from_montgomery
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
prefix
(fun fname : string => ["The function " ++ fname ++ " translates a field element out of the Montgomery domain."]%string)
(from_montgomery_correct machine_wordsize n m r' valid)).
@@ -382,7 +382,7 @@ Section __.
:= Eval cbv beta in
FromPipelineToString
prefix "nonzero" nonzero
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
prefix
(fun fname : string => ["The function " ++ fname ++ " outputs a single non-zero word if the input is non-zero and zero otherwise."]%string)
(nonzero_correct machine_wordsize n m valid from_montgomery_res)).
@@ -402,7 +402,7 @@ Section __.
:= Eval cbv beta in
FromPipelineToString
prefix "to_bytes" to_bytes
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
prefix
(fun fname : string => ["The function " ++ fname ++ " serializes a field element in the Montgomery domain to bytes in little-endian order."]%string)
(to_bytes_correct machine_wordsize n n_bytes m valid)).
@@ -422,7 +422,7 @@ Section __.
:= Eval cbv beta in
FromPipelineToString
prefix "from_bytes" from_bytes
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
prefix
(fun fname : string => ["The function " ++ fname ++ " deserializes a field element in the Montgomery domain from bytes in little-endian order."]%string)
(from_bytes_correct machine_wordsize n n_bytes m valid bytes_valid)).
@@ -442,7 +442,7 @@ Section __.
:= Eval cbv beta in
FromPipelineToString
prefix "encode" encode
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
prefix
(fun fname : string => ["The function " ++ fname ++ " encodes an integer as a field element in the Montgomery domain."]%string)
(encode_correct machine_wordsize n m valid from_montgomery_res)).
@@ -462,7 +462,7 @@ Section __.
:= Eval cbv beta in
FromPipelineToString
prefix "zero" zero
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
prefix
(fun fname => ["The function " ++ fname ++ " returns the field element zero in the Montgomery domain."]%string)
(zero_correct machine_wordsize n m valid from_montgomery_res)).
@@ -482,7 +482,7 @@ Section __.
:= Eval cbv beta in
FromPipelineToString
prefix "one" one
- (stringify_correctness!
+ (docstring_with_summary_from_lemma!
prefix
(fun fname => ["The function " ++ fname ++ " returns the field element one in the Montgomery domain."]%string)
(one_correct machine_wordsize n m valid from_montgomery_res)).