diff options
author | Yann Herklotz <git@yannherklotz.com> | 2022-09-26 13:13:51 +0100 |
---|---|---|
committer | Yann Herklotz <git@yannherklotz.com> | 2022-09-26 13:13:51 +0100 |
commit | d3abe2547c8921d2b324da67370822b7fb89b6c0 (patch) | |
tree | 081f017f6c6ce801306d8a7bd70b1c100db88cab /src/hls/GiblePargen.v | |
parent | 20aae726fa959272ed1568b39b78a0ff501b4882 (diff) | |
download | vericert-d3abe2547c8921d2b324da67370822b7fb89b6c0.tar.gz vericert-d3abe2547c8921d2b324da67370822b7fb89b6c0.zip |
Add global monad notation using Instances
This was mostly inspired by the std++ library.
Diffstat (limited to 'src/hls/GiblePargen.v')
-rw-r--r-- | src/hls/GiblePargen.v | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/hls/GiblePargen.v b/src/hls/GiblePargen.v index 0ca7ead..af09ee6 100644 --- a/src/hls/GiblePargen.v +++ b/src/hls/GiblePargen.v @@ -241,10 +241,10 @@ Definition is_initial_pred (f: forest) (p: positive) := | _ => None end. -Definition update (fop : option (pred_op * forest)) (i : instr): option (pred_op * forest) := - do (pred, f) <- fop; +Definition update (fop : pred_op * forest) (i : instr): option (pred_op * forest) := + let (pred, f) := fop in match i with - | RBnop => fop + | RBnop => Some fop | RBop p op rl r => do pruned <- prune_predicated @@ -298,7 +298,7 @@ Get a sequence from the basic block. |*) Definition abstract_sequence (b : list instr) : option forest := - Option.map snd (fold_left update b (Some (Ptrue, empty))). + Option.map snd (mfold_left update b (Some (Ptrue, empty))). (*| Check equivalence of control flow instructions. As none of the basic blocks |