aboutsummaryrefslogtreecommitdiff
path: root/src/fancy_with_casts_rewrite_head.out
diff options
context:
space:
mode:
Diffstat (limited to 'src/fancy_with_casts_rewrite_head.out')
-rw-r--r--src/fancy_with_casts_rewrite_head.out12579
1 files changed, 4474 insertions, 8105 deletions
diff --git a/src/fancy_with_casts_rewrite_head.out b/src/fancy_with_casts_rewrite_head.out
index 551fd7e18..c5f1388d8 100644
--- a/src/fancy_with_casts_rewrite_head.out
+++ b/src/fancy_with_casts_rewrite_head.out
@@ -178,1232 +178,1890 @@ match idc in (Compilers.ident t) return (Compile.value' true t) with
((match x with
| @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
- (@expr.Ident _ _ _ t0 idc0))
- (@expr.Ident _ _ _ t1 idc1 @ (@expr.Ident _ _ _ t2 idc2 @ x4 @ x3))%expr_pat =>
- match x4 with
- | @expr.Ident _ _ _ t3 idc3 =>
- match x3 with
- | @expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t4 idc4) x5 =>
- (args <- invert_bind_args idc4 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc3 Raw.ident.Literal;
- _ <- invert_bind_args idc2 Raw.ident.Z_land;
- args2 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args3 <- invert_bind_args idc0 Raw.ident.Literal;
- _ <- invert_bind_args idc Raw.ident.Z_mul;
- match
- pattern.type.unify_extracted (ℤ -> ℤ -> ℤ)%ptype
- ((projT1 args3) -> (projT1 args0) -> s4)%ptype
- with
- | Some (_, (_, _))%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (ℤ -> ℤ -> ℤ)%ptype
- ((projT1 args3) -> (projT1 args0) -> s4)%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args3);
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- v <- type.try_make_transport_cps s4 ℤ;
- fv <- (x6 <- (if
- ((let (x6, _) := xv0 in x6) =?
- 2
- ^ (2 *
- Z.log2_up
- (let (x6, _) := xv0 in x6) / 2) -
- 1) &&
- (ZRange.normalize
- (ZRange.constant
- (let (x6, _) := xv0 in x6)) &'
- ZRange.normalize args <=?
- ZRange.normalize args2)%zrange
- then
- x6 <- invert_low
- (2 *
- Z.log2_up
- (let (x6, _) := xv0 in x6))
- (let (x6, _) := xv in x6);
- Some
- (#(Z_cast range)%expr @
- (#(fancy_mulll
- (2 *
- Z.log2_up
- (let (x7, _) := xv0 in x7)))%expr @
- ((##x6)%expr,
- #(Z_cast args)%expr @
- v (Compile.reflect x5))))%expr_pat
- else None);
- Some (Base x6));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end);;
- args <- invert_bind_args idc4 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc3 Raw.ident.Literal;
- _ <- invert_bind_args idc2 Raw.ident.Z_land;
- args2 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args3 <- invert_bind_args idc0 Raw.ident.Literal;
- _ <- invert_bind_args idc Raw.ident.Z_mul;
- match
- pattern.type.unify_extracted (ℤ -> ℤ -> ℤ)%ptype
- ((projT1 args3) -> (projT1 args0) -> s4)%ptype
- with
- | Some (_, (_, _))%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (ℤ -> ℤ -> ℤ)%ptype
- ((projT1 args3) -> (projT1 args0) -> s4)%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args3);
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- v <- type.try_make_transport_cps s4 ℤ;
- fv <- (x6 <- (if
- ((let (x6, _) := xv0 in x6) =?
- 2
- ^ (2 *
- Z.log2_up
- (let (x6, _) := xv0 in x6) / 2) -
- 1) &&
- (ZRange.normalize
- (ZRange.constant
- (let (x6, _) := xv0 in x6)) &'
- ZRange.normalize args <=?
- ZRange.normalize args2)%zrange
- then
- x6 <- invert_high
- (2 *
- Z.log2_up
- (let (x6, _) := xv0 in x6))
- (let (x6, _) := xv in x6);
- Some
- (#(Z_cast range)%expr @
- (#(fancy_mulhl
- (2 *
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat)
+ (@expr.Ident _ _ _ t2 idc2 @ (@expr.Ident _ _ _ t3 idc3 @ x5 @ x4))%expr_pat =>
+ match x5 with
+ | @expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t4 idc4) x6 =>
+ match x4 with
+ | @expr.App _ _ _ s6 _ (@expr.Ident _ _ _ t5 idc5) x7 =>
+ match x7 with
+ | @expr.Ident _ _ _ t6 idc6 =>
+ args <- invert_bind_args idc6 Raw.ident.Literal;
+ args0 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc4 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc3 Raw.ident.Z_land;
+ args3 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args4 <- invert_bind_args idc1 Raw.ident.Literal;
+ args5 <- invert_bind_args idc0 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc Raw.ident.Z_mul;
+ match
+ pattern.type.unify_extracted (ℤ -> ℤ -> ℤ)%ptype
+ ((projT1 args4) -> s5 -> (projT1 args))%ptype
+ with
+ | Some (_, (_, _))%zrange =>
+ if
+ type.type_beq base.type base.type.type_beq
+ (ℤ -> ℤ -> ℤ)%ptype
+ ((projT1 args4) -> s5 -> (projT1 args))%ptype
+ then
+ xv <- ident.unify pattern.ident.Literal
+ ##(projT2 args4);
+ v <- type.try_make_transport_cps s5 ℤ;
+ xv0 <- ident.unify pattern.ident.Literal
+ ##(projT2 args);
+ fv <- (x8 <- (if
+ ((let (x8, _) := xv0 in x8) =?
+ 2
+ ^ (2 *
+ Z.log2_up
+ (let (x8, _) := xv0 in x8) /
+ 2) - 1) &&
+ (ZRange.normalize args1 &'
+ ZRange.normalize
+ (ZRange.constant
+ (let (x8, _) := xv0 in x8)) <=?
+ ZRange.normalize args3)%zrange &&
+ is_bounded_by_bool
+ (let (x8, _) := xv in x8)
+ (ZRange.normalize args5) &&
+ is_bounded_by_bool
+ (let (x8, _) := xv0 in x8)
+ (ZRange.normalize args0)
+ then
+ x8 <- invert_low
+ (2 *
+ Z.log2_up
+ (let (x8, _) := xv0 in
+ x8))
+ (let (x8, _) := xv in x8);
+ Some
+ (#(Z_cast range)%expr @
+ (#(fancy_mulll
+ (2 *
+ Z.log2_up
+ (let (x9, _) := xv0 in
+ x9)))%expr @
+ ((##x8)%expr,
+ #(Z_cast args1)%expr @
+ v (Compile.reflect x6))))%expr_pat
+ else None);
+ Some (Base x8));
+ Some (fv0 <-- fv;
+ Base fv0)%under_lets
+ else None
+ | None => None
+ end
+ | _ => None
+ end;;
+ match x6 with
+ | @expr.Ident _ _ _ t6 idc6 =>
+ (args <- invert_bind_args idc6 Raw.ident.Literal;
+ args0 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc4 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc3 Raw.ident.Z_land;
+ args3 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args4 <- invert_bind_args idc1 Raw.ident.Literal;
+ args5 <- invert_bind_args idc0 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc Raw.ident.Z_mul;
+ match
+ pattern.type.unify_extracted (ℤ -> ℤ -> ℤ)%ptype
+ ((projT1 args4) -> (projT1 args) -> s6)%ptype
+ with
+ | Some (_, (_, _))%zrange =>
+ if
+ type.type_beq base.type base.type.type_beq
+ (ℤ -> ℤ -> ℤ)%ptype
+ ((projT1 args4) -> (projT1 args) -> s6)%ptype
+ then
+ xv <- ident.unify pattern.ident.Literal
+ ##(projT2 args4);
+ xv0 <- ident.unify pattern.ident.Literal
+ ##(projT2 args);
+ v <- type.try_make_transport_cps s6 ℤ;
+ fv <- (x8 <- (if
+ ((let (x8, _) := xv0 in x8) =?
+ 2
+ ^ (2 *
Z.log2_up
- (let (x7, _) := xv0 in x7)))%expr @
- ((##x6)%expr,
- #(Z_cast args)%expr @
- v (Compile.reflect x5))))%expr_pat
- else None);
- Some (Base x6));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
+ (let (x8, _) := xv0 in x8) /
+ 2) - 1) &&
+ (ZRange.normalize
+ (ZRange.constant
+ (let (x8, _) := xv0 in x8)) &'
+ ZRange.normalize args0 <=?
+ ZRange.normalize args3)%zrange &&
+ is_bounded_by_bool
+ (let (x8, _) := xv in x8)
+ (ZRange.normalize args5) &&
+ is_bounded_by_bool
+ (let (x8, _) := xv0 in x8)
+ (ZRange.normalize args1)
+ then
+ x8 <- invert_low
+ (2 *
+ Z.log2_up
+ (let (x8, _) := xv0 in
+ x8))
+ (let (x8, _) := xv in x8);
+ Some
+ (#(Z_cast range)%expr @
+ (#(fancy_mulll
+ (2 *
+ Z.log2_up
+ (let (x9, _) := xv0 in
+ x9)))%expr @
+ ((##x8)%expr,
+ #(Z_cast args0)%expr @
+ v (Compile.reflect x7))))%expr_pat
+ else None);
+ Some (Base x8));
+ Some (fv0 <-- fv;
+ Base fv0)%under_lets
+ else None
+ | None => None
+ end);;
+ args <- invert_bind_args idc6 Raw.ident.Literal;
+ args0 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc4 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc3 Raw.ident.Z_land;
+ args3 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args4 <- invert_bind_args idc1 Raw.ident.Literal;
+ args5 <- invert_bind_args idc0 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc Raw.ident.Z_mul;
+ match
+ pattern.type.unify_extracted (ℤ -> ℤ -> ℤ)%ptype
+ ((projT1 args4) -> (projT1 args) -> s6)%ptype
+ with
+ | Some (_, (_, _))%zrange =>
+ if
+ type.type_beq base.type base.type.type_beq
+ (ℤ -> ℤ -> ℤ)%ptype
+ ((projT1 args4) -> (projT1 args) -> s6)%ptype
+ then
+ xv <- ident.unify pattern.ident.Literal
+ ##(projT2 args4);
+ xv0 <- ident.unify pattern.ident.Literal
+ ##(projT2 args);
+ v <- type.try_make_transport_cps s6 ℤ;
+ fv <- (x8 <- (if
+ ((let (x8, _) := xv0 in x8) =?
+ 2
+ ^ (2 *
+ Z.log2_up
+ (let (x8, _) := xv0 in x8) /
+ 2) - 1) &&
+ (ZRange.normalize
+ (ZRange.constant
+ (let (x8, _) := xv0 in x8)) &'
+ ZRange.normalize args0 <=?
+ ZRange.normalize args3)%zrange &&
+ is_bounded_by_bool
+ (let (x8, _) := xv in x8)
+ (ZRange.normalize args5) &&
+ is_bounded_by_bool
+ (let (x8, _) := xv0 in x8)
+ (ZRange.normalize args1)
+ then
+ x8 <- invert_high
+ (2 *
+ Z.log2_up
+ (let (x8, _) := xv0 in
+ x8))
+ (let (x8, _) := xv in x8);
+ Some
+ (#(Z_cast range)%expr @
+ (#(fancy_mulhl
+ (2 *
+ Z.log2_up
+ (let (x9, _) := xv0 in
+ x9)))%expr @
+ ((##x8)%expr,
+ #(Z_cast args0)%expr @
+ v (Compile.reflect x7))))%expr_pat
+ else None);
+ Some (Base x8));
+ Some (fv0 <-- fv;
+ Base fv0)%under_lets
+ else None
+ | None => None
+ end
+ | _ => None
+ end;;
+ match x7 with
+ | @expr.Ident _ _ _ t6 idc6 =>
+ args <- invert_bind_args idc6 Raw.ident.Literal;
+ args0 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc4 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc3 Raw.ident.Z_land;
+ args3 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args4 <- invert_bind_args idc1 Raw.ident.Literal;
+ args5 <- invert_bind_args idc0 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc Raw.ident.Z_mul;
+ match
+ pattern.type.unify_extracted (ℤ -> ℤ -> ℤ)%ptype
+ ((projT1 args4) -> s5 -> (projT1 args))%ptype
+ with
+ | Some (_, (_, _))%zrange =>
+ if
+ type.type_beq base.type base.type.type_beq
+ (ℤ -> ℤ -> ℤ)%ptype
+ ((projT1 args4) -> s5 -> (projT1 args))%ptype
+ then
+ xv <- ident.unify pattern.ident.Literal
+ ##(projT2 args4);
+ v <- type.try_make_transport_cps s5 ℤ;
+ xv0 <- ident.unify pattern.ident.Literal
+ ##(projT2 args);
+ fv <- (x8 <- (if
+ ((let (x8, _) := xv0 in x8) =?
+ 2
+ ^ (2 *
+ Z.log2_up
+ (let (x8, _) := xv0 in x8) /
+ 2) - 1) &&
+ (ZRange.normalize args1 &'
+ ZRange.normalize
+ (ZRange.constant
+ (let (x8, _) := xv0 in x8)) <=?
+ ZRange.normalize args3)%zrange &&
+ is_bounded_by_bool
+ (let (x8, _) := xv in x8)
+ (ZRange.normalize args5) &&
+ is_bounded_by_bool
+ (let (x8, _) := xv0 in x8)
+ (ZRange.normalize args0)
+ then
+ x8 <- invert_high
+ (2 *
+ Z.log2_up
+ (let (x8, _) := xv0 in
+ x8))
+ (let (x8, _) := xv in x8);
+ Some
+ (#(Z_cast range)%expr @
+ (#(fancy_mulhl
+ (2 *
+ Z.log2_up
+ (let (x9, _) := xv0 in
+ x9)))%expr @
+ ((##x8)%expr,
+ #(Z_cast args1)%expr @
+ v (Compile.reflect x6))))%expr_pat
+ else None);
+ Some (Base x8));
+ Some (fv0 <-- fv;
+ Base fv0)%under_lets
+ else None
+ | None => None
+ end
+ | _ => None
end
- | @expr.App _ _ _ s4 _ ($_)%expr _ | @expr.App _ _ _ s4 _
- (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s4 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s4 _
+ | @expr.App _ _ _ s6 _ ($_)%expr _ | @expr.App _ _ _ s6 _
+ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s6 _
+ (_ @ _)%expr_pat _ | @expr.App _ _ _ s6 _
(@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end
- | @expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t3 idc3) x5 =>
- match x3 with
- | @expr.Ident _ _ _ t4 idc4 =>
- (args <- invert_bind_args idc4 Raw.ident.Literal;
- args0 <- invert_bind_args idc3 Raw.ident.Z_cast;
- _ <- invert_bind_args idc2 Raw.ident.Z_land;
- args2 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args3 <- invert_bind_args idc0 Raw.ident.Literal;
- _ <- invert_bind_args idc Raw.ident.Z_mul;
- match
- pattern.type.unify_extracted (ℤ -> ℤ -> ℤ)%ptype
- ((projT1 args3) -> s4 -> (projT1 args))%ptype
- with
- | Some (_, (_, _))%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (ℤ -> ℤ -> ℤ)%ptype
- ((projT1 args3) -> s4 -> (projT1 args))%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args3);
- v <- type.try_make_transport_cps s4 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x6 <- (if
- ((let (x6, _) := xv0 in x6) =?
- 2
- ^ (2 *
- Z.log2_up
- (let (x6, _) := xv0 in x6) / 2) -
- 1) &&
- (ZRange.normalize args0 &'
- ZRange.normalize
- (ZRange.constant
- (let (x6, _) := xv0 in x6)) <=?
- ZRange.normalize args2)%zrange
- then
- x6 <- invert_low
- (2 *
- Z.log2_up
- (let (x6, _) := xv0 in x6))
- (let (x6, _) := xv in x6);
- Some
- (#(Z_cast range)%expr @
- (#(fancy_mulll
- (2 *
- Z.log2_up
- (let (x7, _) := xv0 in x7)))%expr @
- ((##x6)%expr,
- #(Z_cast args0)%expr @
- v (Compile.reflect x5))))%expr_pat
- else None);
- Some (Base x6));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end);;
- args <- invert_bind_args idc4 Raw.ident.Literal;
- args0 <- invert_bind_args idc3 Raw.ident.Z_cast;
- _ <- invert_bind_args idc2 Raw.ident.Z_land;
- args2 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args3 <- invert_bind_args idc0 Raw.ident.Literal;
- _ <- invert_bind_args idc Raw.ident.Z_mul;
- match
- pattern.type.unify_extracted (ℤ -> ℤ -> ℤ)%ptype
- ((projT1 args3) -> s4 -> (projT1 args))%ptype
- with
- | Some (_, (_, _))%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (ℤ -> ℤ -> ℤ)%ptype
- ((projT1 args3) -> s4 -> (projT1 args))%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args3);
- v <- type.try_make_transport_cps s4 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x6 <- (if
- ((let (x6, _) := xv0 in x6) =?
- 2
- ^ (2 *
- Z.log2_up
- (let (x6, _) := xv0 in x6) / 2) -
- 1) &&
- (ZRange.normalize args0 &'
- ZRange.normalize
- (ZRange.constant
- (let (x6, _) := xv0 in x6)) <=?
- ZRange.normalize args2)%zrange
- then
- x6 <- invert_high
- (2 *
- Z.log2_up
- (let (x6, _) := xv0 in x6))
- (let (x6, _) := xv in x6);
- Some
- (#(Z_cast range)%expr @
- (#(fancy_mulhl
- (2 *
- Z.log2_up
- (let (x7, _) := xv0 in x7)))%expr @
- ((##x6)%expr,
- #(Z_cast args0)%expr @
- v (Compile.reflect x5))))%expr_pat
- else None);
- Some (Base x6));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
- end
- | @expr.App _ _ _ s4 _ ($_)%expr _ | @expr.App _ _ _ s4 _
- (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s4 _ (_ @ _)%expr_pat
- _ | @expr.App _ _ _ s4 _ (@expr.LetIn _ _ _ _ _ _ _) _ => None
+ | @expr.App _ _ _ s5 _ ($_)%expr _ | @expr.App _ _ _ s5 _
+ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s5 _ (_ @ _)%expr_pat
+ _ | @expr.App _ _ _ s5 _ (@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end;;
- match x4 with
- | @expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t3 idc3) x5 =>
- match x3 with
- | @expr.Ident _ _ _ t4 idc4 =>
- (args <- invert_bind_args idc4 Raw.ident.Literal;
- args0 <- invert_bind_args idc3 Raw.ident.Z_cast;
- _ <- invert_bind_args idc2 Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args3 <- invert_bind_args idc0 Raw.ident.Literal;
+ match x5 with
+ | @expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t4 idc4) x6 =>
+ match x4 with
+ | (@expr.Ident _ _ _ t5 idc5 @ @expr.Ident _ _ _ t6 idc6)%expr_pat =>
+ (args <- invert_bind_args idc6 Raw.ident.Literal;
+ args0 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc4 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc3 Raw.ident.Z_shiftr;
+ args3 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args4 <- invert_bind_args idc1 Raw.ident.Literal;
+ args5 <- invert_bind_args idc0 Raw.ident.Z_cast;
_ <- invert_bind_args idc Raw.ident.Z_mul;
match
pattern.type.unify_extracted (ℤ -> ℤ -> ℤ)%ptype
- ((projT1 args3) -> s4 -> (projT1 args))%ptype
+ ((projT1 args4) -> s5 -> (projT1 args))%ptype
with
| Some (_, (_, _))%zrange =>
if
type.type_beq base.type base.type.type_beq
(ℤ -> ℤ -> ℤ)%ptype
- ((projT1 args3) -> s4 -> (projT1 args))%ptype
+ ((projT1 args4) -> s5 -> (projT1 args))%ptype
then
xv <- ident.unify pattern.ident.Literal
- ##(projT2 args3);
- v <- type.try_make_transport_cps s4 ℤ;
+ ##(projT2 args4);
+ v <- type.try_make_transport_cps s5 ℤ;
xv0 <- ident.unify pattern.ident.Literal
##(projT2 args);
- fv <- (x6 <- (if
- (ZRange.normalize args0 >>
+ fv <- (x8 <- (if
+ (ZRange.normalize args1 >>
ZRange.normalize
(ZRange.constant
- (let (x6, _) := xv0 in x6)) <=?
- ZRange.normalize args2)%zrange
+ (let (x8, _) := xv0 in x8)) <=?
+ ZRange.normalize args3)%zrange &&
+ is_bounded_by_bool
+ (let (x8, _) := xv in x8)
+ (ZRange.normalize args5) &&
+ is_bounded_by_bool
+ (let (x8, _) := xv0 in x8)
+ (ZRange.normalize args0)
then
- x6 <- invert_low
+ x8 <- invert_low
(2 *
- (let (x6, _) := xv0 in x6))
- (let (x6, _) := xv in x6);
+ (let (x8, _) := xv0 in x8))
+ (let (x8, _) := xv in x8);
Some
(#(Z_cast range)%expr @
(#(fancy_mullh
(2 *
- (let (x7, _) := xv0 in x7)))%expr @
- ((##x6)%expr,
- #(Z_cast args0)%expr @
- v (Compile.reflect x5))))%expr_pat
+ (let (x9, _) := xv0 in x9)))%expr @
+ ((##x8)%expr,
+ #(Z_cast args1)%expr @
+ v (Compile.reflect x6))))%expr_pat
else None);
- Some (Base x6));
+ Some (Base x8));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end);;
- args <- invert_bind_args idc4 Raw.ident.Literal;
- args0 <- invert_bind_args idc3 Raw.ident.Z_cast;
- _ <- invert_bind_args idc2 Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args3 <- invert_bind_args idc0 Raw.ident.Literal;
+ args <- invert_bind_args idc6 Raw.ident.Literal;
+ args0 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc4 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc3 Raw.ident.Z_shiftr;
+ args3 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args4 <- invert_bind_args idc1 Raw.ident.Literal;
+ args5 <- invert_bind_args idc0 Raw.ident.Z_cast;
_ <- invert_bind_args idc Raw.ident.Z_mul;
match
pattern.type.unify_extracted (ℤ -> ℤ -> ℤ)%ptype
- ((projT1 args3) -> s4 -> (projT1 args))%ptype
+ ((projT1 args4) -> s5 -> (projT1 args))%ptype
with
| Some (_, (_, _))%zrange =>
if
type.type_beq base.type base.type.type_beq
(ℤ -> ℤ -> ℤ)%ptype
- ((projT1 args3) -> s4 -> (projT1 args))%ptype
+ ((projT1 args4) -> s5 -> (projT1 args))%ptype
then
xv <- ident.unify pattern.ident.Literal
- ##(projT2 args3);
- v <- type.try_make_transport_cps s4 ℤ;
+ ##(projT2 args4);
+ v <- type.try_make_transport_cps s5 ℤ;
xv0 <- ident.unify pattern.ident.Literal
##(projT2 args);
- fv <- (x6 <- (if
- (ZRange.normalize args0 >>
+ fv <- (x8 <- (if
+ (ZRange.normalize args1 >>
ZRange.normalize
(ZRange.constant
- (let (x6, _) := xv0 in x6)) <=?
- ZRange.normalize args2)%zrange
+ (let (x8, _) := xv0 in x8)) <=?
+ ZRange.normalize args3)%zrange &&
+ is_bounded_by_bool
+ (let (x8, _) := xv in x8)
+ (ZRange.normalize args5) &&
+ is_bounded_by_bool
+ (let (x8, _) := xv0 in x8)
+ (ZRange.normalize args0)
then
- x6 <- invert_high
- (2 * (let (x6, _) := xv0 in x6))
- (let (x6, _) := xv in x6);
+ x8 <- invert_high
+ (2 * (let (x8, _) := xv0 in x8))
+ (let (x8, _) := xv in x8);
Some
(#(Z_cast range)%expr @
(#(fancy_mulhh
- (2 * (let (x7, _) := xv0 in x7)))%expr @
- ((##x6)%expr,
- #(Z_cast args0)%expr @
- v (Compile.reflect x5))))%expr_pat
+ (2 * (let (x9, _) := xv0 in x9)))%expr @
+ ((##x8)%expr,
+ #(Z_cast args1)%expr @
+ v (Compile.reflect x6))))%expr_pat
else None);
- Some (Base x6));
+ Some (Base x8));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end
+ | (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (_ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _ _ _ _)%expr_pat =>
+ None
| _ => None
end
- | @expr.App _ _ _ s4 _ ($_)%expr _ | @expr.App _ _ _ s4 _
- (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s4 _ (_ @ _)%expr_pat
- _ | @expr.App _ _ _ s4 _ (@expr.LetIn _ _ _ _ _ _ _) _ => None
+ | @expr.App _ _ _ s5 _ ($_)%expr _ | @expr.App _ _ _ s5 _
+ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s5 _ (_ @ _)%expr_pat
+ _ | @expr.App _ _ _ s5 _ (@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end
| @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
- (@expr.Ident _ _ _ t0 idc0))
- (@expr.Ident _ _ _ t1 idc1 @ #(_))%expr_pat | @expr.App _ _ _ s _
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat)
+ (@expr.Ident _ _ _ t2 idc2 @ #(_))%expr_pat | @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
- (@expr.Ident _ _ _ t0 idc0))
- (@expr.Ident _ _ _ t1 idc1 @ ($_)%expr)%expr_pat | @expr.App _ _ _ s
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat)
+ (@expr.Ident _ _ _ t2 idc2 @ ($_)%expr)%expr_pat | @expr.App _ _ _ s
_
(@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
- (@expr.Ident _ _ _ t0 idc0))
- (@expr.Ident _ _ _ t1 idc1 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat)
+ (@expr.Ident _ _ _ t2 idc2 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
@expr.App _ _ _ s _
(@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
- (@expr.Ident _ _ _ t0 idc0))
- (@expr.Ident _ _ _ t1 idc1 @ (#(_) @ _))%expr_pat | @expr.App _ _ _ s
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat)
+ (@expr.Ident _ _ _ t2 idc2 @ (#(_) @ _))%expr_pat | @expr.App _ _ _ s
_
(@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
- (@expr.Ident _ _ _ t0 idc0))
- (@expr.Ident _ _ _ t1 idc1 @ (($_)%expr @ _))%expr_pat | @expr.App _
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat)
+ (@expr.Ident _ _ _ t2 idc2 @ (($_)%expr @ _))%expr_pat | @expr.App _
_ _ s _
(@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
- (@expr.Ident _ _ _ t0 idc0))
- (@expr.Ident _ _ _ t1 idc1 @ (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat)
+ (@expr.Ident _ _ _ t2 idc2 @ (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
@expr.App _ _ _ s _
(@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
- (@expr.Ident _ _ _ t0 idc0))
- (@expr.Ident _ _ _ t1 idc1 @ (($_)%expr @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat)
+ (@expr.Ident _ _ _ t2 idc2 @ (($_)%expr @ _ @ _))%expr_pat |
@expr.App _ _ _ s _
(@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
- (@expr.Ident _ _ _ t0 idc0))
- (@expr.Ident _ _ _ t1 idc1 @ (@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat)
+ (@expr.Ident _ _ _ t2 idc2 @ (@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
@expr.App _ _ _ s _
(@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
- (@expr.Ident _ _ _ t0 idc0))
- (@expr.Ident _ _ _ t1 idc1 @ (_ @ _ @ _ @ _))%expr_pat | @expr.App _
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat)
+ (@expr.Ident _ _ _ t2 idc2 @ (_ @ _ @ _ @ _))%expr_pat | @expr.App _
_ _ s _
(@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
- (@expr.Ident _ _ _ t0 idc0))
- (@expr.Ident _ _ _ t1 idc1 @ (@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat)
+ (@expr.Ident _ _ _ t2 idc2 @ (@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
@expr.App _ _ _ s _
(@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
- (@expr.Ident _ _ _ t0 idc0))
- (@expr.Ident _ _ _ t1 idc1 @ (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat)
+ (@expr.Ident _ _ _ t2 idc2 @ (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
@expr.App _ _ _ s _
(@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
- (@expr.Ident _ _ _ t0 idc0))
- (@expr.Ident _ _ _ t1 idc1 @ @expr.LetIn _ _ _ _ _ _ _)%expr_pat =>
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat)
+ (@expr.Ident _ _ _ t2 idc2 @ @expr.LetIn _ _ _ _ _ _ _)%expr_pat =>
None
| @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat)
+ #(_)%expr_pat | @expr.App _ _ _ s _
+ (@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat)
+ ($_)%expr | @expr.App _ _ _ s _
+ (@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat)
+ (@expr.Abs _ _ _ _ _ _) | @expr.App _ _ _ s _
+ (@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat)
+ (($_)%expr @ _)%expr_pat | @expr.App _ _ _ s _
+ (@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat)
+ (@expr.Abs _ _ _ _ _ _ @ _)%expr_pat | @expr.App _ _ _ s _
+ (@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat)
+ (_ @ _ @ _)%expr_pat | @expr.App _ _ _ s _
+ (@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat)
+ (@expr.LetIn _ _ _ _ _ _ _ @ _)%expr_pat | @expr.App _ _ _ s _
+ (@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat)
+ (@expr.LetIn _ _ _ _ _ _ _) => None
+ | @expr.App _ _ _ s _
+ (@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
(@expr.Ident _ _ _ t0 idc0 @ (@expr.Ident _ _ _ t1 idc1 @ x4 @ x3))%expr_pat)
x0 =>
match x4 with
- | @expr.Ident _ _ _ t2 idc2 =>
- match x3 with
- | @expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t3 idc3) x5 =>
- match x0 with
- | @expr.Ident _ _ _ t4 idc4 =>
- (args <- invert_bind_args idc4 Raw.ident.Literal;
- args0 <- invert_bind_args idc3 Raw.ident.Z_cast;
- args1 <- invert_bind_args idc2 Raw.ident.Literal;
- _ <- invert_bind_args idc1 Raw.ident.Z_land;
- args3 <- invert_bind_args idc0 Raw.ident.Z_cast;
- _ <- invert_bind_args idc Raw.ident.Z_mul;
- match
- pattern.type.unify_extracted ((ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args1) -> s4) -> (projT1 args))%ptype
- with
- | Some (_, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
+ | @expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5 =>
+ match x5 with
+ | @expr.Ident _ _ _ t3 idc3 =>
+ match x3 with
+ | @expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t4 idc4) x6 =>
+ match x0 with
+ | (@expr.Ident _ _ _ t5 idc5 @ @expr.Ident _ _ _ t6
+ idc6)%expr_pat =>
+ args <- invert_bind_args idc6 Raw.ident.Literal;
+ args0 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc4 Raw.ident.Z_cast;
+ args2 <- invert_bind_args idc3 Raw.ident.Literal;
+ args3 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc1 Raw.ident.Z_land;
+ args5 <- invert_bind_args idc0 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc Raw.ident.Z_mul;
+ match
+ pattern.type.unify_extracted
((ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args1) -> s4) -> (projT1 args))%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args1);
- v <- type.try_make_transport_cps s4 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x6 <- (if
- ((let (x6, _) := xv in x6) =?
- 2
- ^ (2 *
- Z.log2_up
- (let (x6, _) := xv in x6) /
- 2) - 1) &&
- (ZRange.normalize
- (ZRange.constant
- (let (x6, _) := xv in x6)) &'
- ZRange.normalize args0 <=?
- ZRange.normalize args3)%zrange
- then
- y <- invert_low
- (2 *
- Z.log2_up
- (let (x6, _) := xv in x6))
- (let (x6, _) := xv0 in x6);
- Some
- (#(Z_cast range)%expr @
- (#(fancy_mulll
- (2 *
- Z.log2_up
- (let (x6, _) := xv in
- x6)))%expr @
- (#(Z_cast args0)%expr @
- v (Compile.reflect x5),
- (##y)%expr)))%expr_pat
- else None);
- Some (Base x6));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end);;
- args <- invert_bind_args idc4 Raw.ident.Literal;
- args0 <- invert_bind_args idc3 Raw.ident.Z_cast;
- args1 <- invert_bind_args idc2 Raw.ident.Literal;
- _ <- invert_bind_args idc1 Raw.ident.Z_land;
- args3 <- invert_bind_args idc0 Raw.ident.Z_cast;
- _ <- invert_bind_args idc Raw.ident.Z_mul;
- match
- pattern.type.unify_extracted ((ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args1) -> s4) -> (projT1 args))%ptype
- with
- | Some (_, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- ((ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args1) -> s4) -> (projT1 args))%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args1);
- v <- type.try_make_transport_cps s4 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x6 <- (if
- ((let (x6, _) := xv in x6) =?
- 2
- ^ (2 *
- Z.log2_up
- (let (x6, _) := xv in x6) / 2) -
- 1) &&
- (ZRange.normalize
- (ZRange.constant
- (let (x6, _) := xv in x6)) &'
- ZRange.normalize args0 <=?
- ZRange.normalize args3)%zrange
- then
- y <- invert_high
- (2 *
+ (((projT1 args2) -> s5) -> (projT1 args))%ptype
+ with
+ | Some (_, _, _)%zrange =>
+ if
+ type.type_beq base.type base.type.type_beq
+ ((ℤ -> ℤ) -> ℤ)%ptype
+ (((projT1 args2) -> s5) -> (projT1 args))%ptype
+ then
+ xv <- ident.unify pattern.ident.Literal
+ ##(projT2 args2);
+ v <- type.try_make_transport_cps s5 ℤ;
+ xv0 <- ident.unify pattern.ident.Literal
+ ##(projT2 args);
+ fv <- (x8 <- (if
+ ((let (x8, _) := xv in x8) =?
+ 2
+ ^ (2 *
Z.log2_up
- (let (x6, _) := xv in x6))
- (let (x6, _) := xv0 in x6);
- Some
- (#(Z_cast range)%expr @
- (#(fancy_mullh
- (2 *
- Z.log2_up
- (let (x6, _) := xv in x6)))%expr @
- (#(Z_cast args0)%expr @
- v (Compile.reflect x5),
- (##y)%expr)))%expr_pat
- else None);
- Some (Base x6));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ x8 @ x7))%expr_pat =>
- match x8 with
- | @expr.Ident _ _ _ t6 idc6 =>
- match x7 with
- | @expr.App _ _ _ s8 _ (@expr.Ident _ _ _ t7 idc7)
- x9 =>
- args <- invert_bind_args idc7 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc6
- Raw.ident.Literal;
- _ <- invert_bind_args idc5 Raw.ident.Z_land;
- args2 <- invert_bind_args idc4 Raw.ident.Z_cast;
- args3 <- invert_bind_args idc3 Raw.ident.Z_cast;
- args4 <- invert_bind_args idc2
- Raw.ident.Literal;
- _ <- invert_bind_args idc1 Raw.ident.Z_land;
- args6 <- invert_bind_args idc0 Raw.ident.Z_cast;
- _ <- invert_bind_args idc Raw.ident.Z_mul;
- match
- pattern.type.unify_extracted
- ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- (((projT1 args4) -> s4) ->
- (projT1 args0) -> s8)%ptype
- with
- | Some (_, _, (_, _))%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- (((projT1 args4) -> s4) ->
- (projT1 args0) -> s8)%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args4);
- v <- type.try_make_transport_cps s4 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- v0 <- type.try_make_transport_cps s8 ℤ;
- fv <- (x10 <- (if
- ((let (x10, _) := xv in
- x10) =?
- 2
- ^ (2 *
+ (let (x8, _) := xv in x8) /
+ 2) - 1) &&
+ (ZRange.normalize
+ (ZRange.constant
+ (let (x8, _) := xv in x8)) &'
+ ZRange.normalize args1 <=?
+ ZRange.normalize args5)%zrange &&
+ is_bounded_by_bool
+ (let (x8, _) := xv0 in x8)
+ (ZRange.normalize args0) &&
+ is_bounded_by_bool
+ (let (x8, _) := xv in x8)
+ (ZRange.normalize args3)
+ then
+ y <- invert_low
+ (2 *
+ Z.log2_up
+ (let (x8, _) := xv in
+ x8))
+ (let (x8, _) := xv0 in
+ x8);
+ Some
+ (#(Z_cast range)%expr @
+ (#(fancy_mulll
+ (2 *
Z.log2_up
- (let (x10, _) :=
+ (let (x8, _) :=
xv in
- x10) / 2) - 1) &&
- ((let (x10, _) := xv0 in
- x10) =?
- 2
- ^ (2 *
+ x8)))%expr @
+ (#(Z_cast args1)%expr @
+ v (Compile.reflect x6),
+ (##y)%expr)))%expr_pat
+ else None);
+ Some (Base x8));
+ Some (fv0 <-- fv;
+ Base fv0)%under_lets
+ else None
+ | None => None
+ end
+ | (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (_ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _ _ _
+ _)%expr_pat => None
+ | _ => None
+ end
+ | @expr.App _ _ _ s5 _ ($_)%expr _ | @expr.App _ _ _ s5 _
+ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s5 _
+ (_ @ _)%expr_pat _ | @expr.App _ _ _ s5 _
+ (@expr.LetIn _ _ _ _ _ _ _) _ => None
+ | _ => None
+ end
+ | _ => None
+ end;;
+ match x3 with
+ | @expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t3 idc3) x6 =>
+ match x6 with
+ | @expr.Ident _ _ _ t4 idc4 =>
+ match x0 with
+ | (@expr.Ident _ _ _ t5 idc5 @ @expr.Ident _ _ _ t6
+ idc6)%expr_pat =>
+ args <- invert_bind_args idc6 Raw.ident.Literal;
+ args0 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc4 Raw.ident.Literal;
+ args2 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args3 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc1 Raw.ident.Z_land;
+ args5 <- invert_bind_args idc0 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc Raw.ident.Z_mul;
+ match
+ pattern.type.unify_extracted
+ ((ℤ -> ℤ) -> ℤ)%ptype
+ ((s4 -> (projT1 args1)) -> (projT1 args))%ptype
+ with
+ | Some (_, _, _)%zrange =>
+ if
+ type.type_beq base.type base.type.type_beq
+ ((ℤ -> ℤ) -> ℤ)%ptype
+ ((s4 -> (projT1 args1)) -> (projT1 args))%ptype
+ then
+ v <- type.try_make_transport_cps s4 ℤ;
+ xv <- ident.unify pattern.ident.Literal
+ ##(projT2 args1);
+ xv0 <- ident.unify pattern.ident.Literal
+ ##(projT2 args);
+ fv <- (x8 <- (if
+ ((let (x8, _) := xv in x8) =?
+ 2
+ ^ (2 *
+ Z.log2_up
+ (let (x8, _) := xv in x8) /
+ 2) - 1) &&
+ (ZRange.normalize args3 &'
+ ZRange.normalize
+ (ZRange.constant
+ (let (x8, _) := xv in x8)) <=?
+ ZRange.normalize args5)%zrange &&
+ is_bounded_by_bool
+ (let (x8, _) := xv0 in x8)
+ (ZRange.normalize args0) &&
+ is_bounded_by_bool
+ (let (x8, _) := xv in x8)
+ (ZRange.normalize args2)
+ then
+ y <- invert_low
+ (2 *
+ Z.log2_up
+ (let (x8, _) := xv in
+ x8))
+ (let (x8, _) := xv0 in
+ x8);
+ Some
+ (#(Z_cast range)%expr @
+ (#(fancy_mulll
+ (2 *
Z.log2_up
- (let (x10, _) :=
+ (let (x8, _) :=
xv in
- x10) / 2) - 1) &&
- (ZRange.normalize
- (ZRange.constant
- (let (x10, _) :=
- xv in
- x10)) &'
- ZRange.normalize args3 <=?
- ZRange.normalize args6)%zrange &&
- (ZRange.normalize
- (ZRange.constant
- (let (x10, _) :=
- xv0 in
- x10)) &'
- ZRange.normalize args <=?
- ZRange.normalize args2)%zrange
- then
- Some
- (#(Z_cast range)%expr @
- (#(fancy_mulll
- (2 *
- Z.log2_up
- (let
- (x10, _) :=
- xv in
- x10)))%expr @
- (#(Z_cast args3)%expr @
- v
- (Compile.reflect x5),
- #(Z_cast args)%expr @
- v0
- (Compile.reflect x9))))%expr_pat
- else None);
- Some (Base x10));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s8 _ ($_)%expr _ | @expr.App _ _
- _ s8 _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _
- _ s8 _ (_ @ _)%expr_pat _ | @expr.App _ _ _ s8 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
+ x8)))%expr @
+ (#(Z_cast args3)%expr @
+ v (Compile.reflect x5),
+ (##y)%expr)))%expr_pat
+ else None);
+ Some (Base x8));
+ Some (fv0 <-- fv;
+ Base fv0)%under_lets
+ else None
+ | None => None
end
- | @expr.App _ _ _ s8 _ (@expr.Ident _ _ _ t6 idc6)
- x9 =>
- match x7 with
- | @expr.Ident _ _ _ t7 idc7 =>
- args <- invert_bind_args idc7 Raw.ident.Literal;
- args0 <- invert_bind_args idc6 Raw.ident.Z_cast;
- _ <- invert_bind_args idc5 Raw.ident.Z_land;
- args2 <- invert_bind_args idc4 Raw.ident.Z_cast;
- args3 <- invert_bind_args idc3 Raw.ident.Z_cast;
- args4 <- invert_bind_args idc2
- Raw.ident.Literal;
- _ <- invert_bind_args idc1 Raw.ident.Z_land;
- args6 <- invert_bind_args idc0 Raw.ident.Z_cast;
- _ <- invert_bind_args idc Raw.ident.Z_mul;
- match
- pattern.type.unify_extracted
- ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- (((projT1 args4) -> s4) ->
- s8 -> (projT1 args))%ptype
- with
- | Some (_, _, (_, _))%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- (((projT1 args4) -> s4) ->
- s8 -> (projT1 args))%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args4);
- v <- type.try_make_transport_cps s4 ℤ;
- v0 <- type.try_make_transport_cps s8 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x10 <- (if
- ((let (x10, _) := xv in
- x10) =?
- 2
- ^ (2 *
+ | (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (_ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _ _ _
+ _)%expr_pat => None
+ | _ => None
+ end
+ | _ => None
+ end;;
+ match x5 with
+ | @expr.Ident _ _ _ t4 idc4 =>
+ match x0 with
+ | (@expr.Ident _ _ _ t5 idc5 @ @expr.Ident _ _ _ t6
+ idc6)%expr_pat =>
+ args <- invert_bind_args idc6 Raw.ident.Literal;
+ args0 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc4 Raw.ident.Literal;
+ args2 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args3 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc1 Raw.ident.Z_land;
+ args5 <- invert_bind_args idc0 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc Raw.ident.Z_mul;
+ match
+ pattern.type.unify_extracted
+ ((ℤ -> ℤ) -> ℤ)%ptype
+ (((projT1 args1) -> s5) -> (projT1 args))%ptype
+ with
+ | Some (_, _, _)%zrange =>
+ if
+ type.type_beq base.type base.type.type_beq
+ ((ℤ -> ℤ) -> ℤ)%ptype
+ (((projT1 args1) -> s5) -> (projT1 args))%ptype
+ then
+ xv <- ident.unify pattern.ident.Literal
+ ##(projT2 args1);
+ v <- type.try_make_transport_cps s5 ℤ;
+ xv0 <- ident.unify pattern.ident.Literal
+ ##(projT2 args);
+ fv <- (x8 <- (if
+ ((let (x8, _) := xv in x8) =?
+ 2
+ ^ (2 *
+ Z.log2_up
+ (let (x8, _) := xv in x8) /
+ 2) - 1) &&
+ (ZRange.normalize
+ (ZRange.constant
+ (let (x8, _) := xv in x8)) &'
+ ZRange.normalize args2 <=?
+ ZRange.normalize args5)%zrange &&
+ is_bounded_by_bool
+ (let (x8, _) := xv0 in x8)
+ (ZRange.normalize args0) &&
+ is_bounded_by_bool
+ (let (x8, _) := xv in x8)
+ (ZRange.normalize args3)
+ then
+ y <- invert_high
+ (2 *
+ Z.log2_up
+ (let (x8, _) := xv in
+ x8))
+ (let (x8, _) := xv0 in
+ x8);
+ Some
+ (#(Z_cast range)%expr @
+ (#(fancy_mullh
+ (2 *
Z.log2_up
- (let (x10, _) :=
+ (let (x8, _) :=
xv in
- x10) / 2) - 1) &&
- ((let (x10, _) := xv0 in
- x10) =?
- 2
- ^ (2 *
+ x8)))%expr @
+ (#(Z_cast args2)%expr @
+ v (Compile.reflect x6),
+ (##y)%expr)))%expr_pat
+ else None);
+ Some (Base x8));
+ Some (fv0 <-- fv;
+ Base fv0)%under_lets
+ else None
+ | None => None
+ end
+ | (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (_ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _ _ _
+ _)%expr_pat => None
+ | _ => None
+ end
+ | _ => None
+ end;;
+ match x6 with
+ | @expr.Ident _ _ _ t4 idc4 =>
+ match x0 with
+ | (@expr.Ident _ _ _ t5 idc5 @ @expr.Ident _ _ _ t6
+ idc6)%expr_pat =>
+ args <- invert_bind_args idc6 Raw.ident.Literal;
+ args0 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc4 Raw.ident.Literal;
+ args2 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args3 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc1 Raw.ident.Z_land;
+ args5 <- invert_bind_args idc0 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc Raw.ident.Z_mul;
+ match
+ pattern.type.unify_extracted
+ ((ℤ -> ℤ) -> ℤ)%ptype
+ ((s4 -> (projT1 args1)) -> (projT1 args))%ptype
+ with
+ | Some (_, _, _)%zrange =>
+ if
+ type.type_beq base.type base.type.type_beq
+ ((ℤ -> ℤ) -> ℤ)%ptype
+ ((s4 -> (projT1 args1)) -> (projT1 args))%ptype
+ then
+ v <- type.try_make_transport_cps s4 ℤ;
+ xv <- ident.unify pattern.ident.Literal
+ ##(projT2 args1);
+ xv0 <- ident.unify pattern.ident.Literal
+ ##(projT2 args);
+ fv <- (x8 <- (if
+ ((let (x8, _) := xv in x8) =?
+ 2
+ ^ (2 *
+ Z.log2_up
+ (let (x8, _) := xv in x8) /
+ 2) - 1) &&
+ (ZRange.normalize args3 &'
+ ZRange.normalize
+ (ZRange.constant
+ (let (x8, _) := xv in x8)) <=?
+ ZRange.normalize args5)%zrange &&
+ is_bounded_by_bool
+ (let (x8, _) := xv0 in x8)
+ (ZRange.normalize args0) &&
+ is_bounded_by_bool
+ (let (x8, _) := xv in x8)
+ (ZRange.normalize args2)
+ then
+ y <- invert_high
+ (2 *
+ Z.log2_up
+ (let (x8, _) := xv in
+ x8))
+ (let (x8, _) := xv0 in
+ x8);
+ Some
+ (#(Z_cast range)%expr @
+ (#(fancy_mullh
+ (2 *
Z.log2_up
- (let (x10, _) :=
- xv in
- x10) / 2) - 1) &&
- (ZRange.normalize
- (ZRange.constant
- (let (x10, _) :=
+ (let (x8, _) :=
xv in
- x10)) &'
- ZRange.normalize args3 <=?
- ZRange.normalize args6)%zrange &&
- (ZRange.normalize args0 &'
- ZRange.normalize
- (ZRange.constant
- (let (x10, _) :=
- xv0 in
- x10)) <=?
- ZRange.normalize args2)%zrange
- then
- Some
- (#(Z_cast range)%expr @
- (#(fancy_mulll
- (2 *
- Z.log2_up
- (let
- (x10, _) :=
- xv in
- x10)))%expr @
- (#(Z_cast args3)%expr @
- v
- (Compile.reflect x5),
- #(Z_cast args0)%expr @
- v0
- (Compile.reflect x9))))%expr_pat
- else None);
- Some (Base x10));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
+ x8)))%expr @
+ (#(Z_cast args3)%expr @
+ v (Compile.reflect x5),
+ (##y)%expr)))%expr_pat
+ else None);
+ Some (Base x8));
+ Some (fv0 <-- fv;
+ Base fv0)%under_lets
+ else None
+ | None => None
end
- | @expr.App _ _ _ s8 _ ($_)%expr _ | @expr.App _ _ _ s8
- _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s8 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s8 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
+ | (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (_ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _ _ _
+ _)%expr_pat => None
| _ => None
- end;;
- match x8 with
- | @expr.App _ _ _ s8 _ (@expr.Ident _ _ _ t6 idc6)
- x9 =>
- match x7 with
- | @expr.Ident _ _ _ t7 idc7 =>
- args <- invert_bind_args idc7 Raw.ident.Literal;
- args0 <- invert_bind_args idc6 Raw.ident.Z_cast;
- _ <- invert_bind_args idc5 Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc4 Raw.ident.Z_cast;
- args3 <- invert_bind_args idc3 Raw.ident.Z_cast;
- args4 <- invert_bind_args idc2
- Raw.ident.Literal;
- _ <- invert_bind_args idc1 Raw.ident.Z_land;
- args6 <- invert_bind_args idc0 Raw.ident.Z_cast;
- _ <- invert_bind_args idc Raw.ident.Z_mul;
- match
- pattern.type.unify_extracted
- ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- (((projT1 args4) -> s4) ->
- s8 -> (projT1 args))%ptype
- with
- | Some (_, _, (_, _))%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- (((projT1 args4) -> s4) ->
- s8 -> (projT1 args))%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args4);
- v <- type.try_make_transport_cps s4 ℤ;
- v0 <- type.try_make_transport_cps s8 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x10 <- (if
- ((let (x10, _) := xv in
- x10) =?
- 2
- ^ (2 *
- (let (x10, _) :=
- xv0 in
- x10) / 2) - 1) &&
- (ZRange.normalize
- (ZRange.constant
- (let (x10, _) :=
- xv in
- x10)) &'
- ZRange.normalize args3 <=?
- ZRange.normalize args6)%zrange &&
- (ZRange.normalize args0 >>
- ZRange.normalize
- (ZRange.constant
- (let (x10, _) :=
- xv0 in
- x10)) <=?
- ZRange.normalize args2)%zrange
- then
- Some
- (#(Z_cast range)%expr @
- (#(fancy_mullh
- (2 *
- (let (x10, _) :=
- xv0 in
- x10)))%expr @
- (#(Z_cast args3)%expr @
- v
- (Compile.reflect x5),
- #(Z_cast args0)%expr @
- v0
- (Compile.reflect x9))))%expr_pat
- else None);
- Some (Base x10));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
+ end
+ | _ => None
+ end;;
+ match x5 with
+ | @expr.Ident _ _ _ t4 idc4 =>
+ match x0 with
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Ident _ _ _ t8
+ idc8) @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t9 idc9) x11))%expr_pat =>
+ args <- invert_bind_args idc9 Raw.ident.Z_cast;
+ args0 <- invert_bind_args idc8 Raw.ident.Literal;
+ args1 <- invert_bind_args idc7 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc6 Raw.ident.Z_land;
+ args3 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ args4 <- invert_bind_args idc4 Raw.ident.Literal;
+ args5 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args6 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc1 Raw.ident.Z_land;
+ args8 <- invert_bind_args idc0 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc Raw.ident.Z_mul;
+ match
+ pattern.type.unify_extracted
+ ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
+ (((projT1 args4) -> s5) ->
+ (projT1 args0) -> s10)%ptype
+ with
+ | Some (_, _, (_, _))%zrange =>
+ if
+ type.type_beq base.type base.type.type_beq
+ ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
+ (((projT1 args4) -> s5) ->
+ (projT1 args0) -> s10)%ptype
+ then
+ xv <- ident.unify pattern.ident.Literal
+ ##(projT2 args4);
+ v <- type.try_make_transport_cps s5 ℤ;
+ xv0 <- ident.unify pattern.ident.Literal
+ ##(projT2 args0);
+ v0 <- type.try_make_transport_cps s10 ℤ;
+ fv <- (x12 <- (if
+ ((let (x12, _) := xv in x12) =?
+ 2
+ ^ (2 *
+ Z.log2_up
+ (let (x12, _) := xv in
+ x12) / 2) - 1) &&
+ ((let (x12, _) := xv0 in x12) =?
+ 2
+ ^ (2 *
+ Z.log2_up
+ (let (x12, _) := xv in
+ x12) / 2) - 1) &&
+ (ZRange.normalize
+ (ZRange.constant
+ (let (x12, _) := xv in
+ x12)) &'
+ ZRange.normalize args5 <=?
+ ZRange.normalize args8)%zrange &&
+ (ZRange.normalize
+ (ZRange.constant
+ (let (x12, _) := xv0 in
+ x12)) &'
+ ZRange.normalize args <=?
+ ZRange.normalize args3)%zrange &&
+ is_bounded_by_bool
+ (let (x12, _) := xv in x12)
+ (ZRange.normalize args6) &&
+ is_bounded_by_bool
+ (let (x12, _) := xv0 in x12)
+ (ZRange.normalize args1)
+ then
+ Some
+ (#(Z_cast range)%expr @
+ (#(fancy_mulll
+ (2 *
+ Z.log2_up
+ (let (x12, _) :=
+ xv in
+ x12)))%expr @
+ (#(Z_cast args5)%expr @
+ v (Compile.reflect x6),
+ #(Z_cast args)%expr @
+ v0 (Compile.reflect x11))))%expr_pat
+ else None);
+ Some (Base x12));
+ Some (fv0 <-- fv;
+ Base fv0)%under_lets
+ else None
+ | None => None
end
- | @expr.App _ _ _ s8 _ ($_)%expr _ | @expr.App _ _ _ s8
- _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s8 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s8 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Ident _ _ _ t8
+ idc8) @ @expr.App _ _ _ s10 _ ($_)%expr _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Ident _ _ _ t8
+ idc8) @ @expr.App _ _ _ s10 _
+ (@expr.Abs _ _ _ _ _ _) _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Ident _ _ _ t8
+ idc8) @ @expr.App _ _ _ s10 _ (_ @ _) _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Ident _ _ _ t8
+ idc8) @ @expr.App _ _ _ s10 _
+ (@expr.LetIn _ _ _ _ _ _ _) _))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Ident _ _ _ t8
+ idc8) @ #(_)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Ident _ _ _ t8
+ idc8) @ ($_)%expr))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Ident _ _ _ t8
+ idc8) @ @expr.Abs _ _ _ _ _ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Ident _ _ _ t8
+ idc8) @ @expr.LetIn _ _ _ _ _ _ _))%expr_pat =>
+ None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ ($_)%expr) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Abs _ _ _ _ _ _) @
+ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ (_ @ _)) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.LetIn _ _ _ _ _
+ _ _) @ _))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ #(_) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _ _ _ _ @
+ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ (($_)%expr @ _) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Abs _ _ _ _ _ _ @ _) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ (_ @ _ @ _) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _ _ _ _ _
+ _ @ _))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @ #(_))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (#(_) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _ _ _
+ _)%expr_pat => None
| _ => None
end
- | (@expr.Ident _ _ _ t4 idc4 @ #(_))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (#(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (_ @ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.LetIn _ _ _ _ _ _ _)%expr_pat =>
- None
| _ => None
- end
- | @expr.App _ _ _ s4 _ ($_)%expr _ | @expr.App _ _ _ s4 _
- (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s4 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s4 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | @expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5 =>
- match x3 with
- | @expr.Ident _ _ _ t3 idc3 =>
- match x0 with
+ end;;
+ match x6 with
| @expr.Ident _ _ _ t4 idc4 =>
- (args <- invert_bind_args idc4 Raw.ident.Literal;
- args0 <- invert_bind_args idc3 Raw.ident.Literal;
- args1 <- invert_bind_args idc2 Raw.ident.Z_cast;
- _ <- invert_bind_args idc1 Raw.ident.Z_land;
- args3 <- invert_bind_args idc0 Raw.ident.Z_cast;
- _ <- invert_bind_args idc Raw.ident.Z_mul;
- match
- pattern.type.unify_extracted ((ℤ -> ℤ) -> ℤ)%ptype
- ((s4 -> (projT1 args0)) -> (projT1 args))%ptype
- with
- | Some (_, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- ((ℤ -> ℤ) -> ℤ)%ptype
- ((s4 -> (projT1 args0)) -> (projT1 args))%ptype
- then
- v <- type.try_make_transport_cps s4 ℤ;
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x6 <- (if
- ((let (x6, _) := xv in x6) =?
- 2
- ^ (2 *
- Z.log2_up
- (let (x6, _) := xv in x6) /
- 2) - 1) &&
- (ZRange.normalize args1 &'
- ZRange.normalize
- (ZRange.constant
- (let (x6, _) := xv in x6)) <=?
- ZRange.normalize args3)%zrange
- then
- y <- invert_low
- (2 *
+ match x0 with
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Ident _ _ _ t8
+ idc8) @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t9 idc9) x11))%expr_pat =>
+ args <- invert_bind_args idc9 Raw.ident.Z_cast;
+ args0 <- invert_bind_args idc8 Raw.ident.Literal;
+ args1 <- invert_bind_args idc7 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc6 Raw.ident.Z_land;
+ args3 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ args4 <- invert_bind_args idc4 Raw.ident.Literal;
+ args5 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args6 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc1 Raw.ident.Z_land;
+ args8 <- invert_bind_args idc0 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc Raw.ident.Z_mul;
+ match
+ pattern.type.unify_extracted
+ ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
+ ((s4 -> (projT1 args4)) ->
+ (projT1 args0) -> s10)%ptype
+ with
+ | Some (_, _, (_, _))%zrange =>
+ if
+ type.type_beq base.type base.type.type_beq
+ ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
+ ((s4 -> (projT1 args4)) ->
+ (projT1 args0) -> s10)%ptype
+ then
+ v <- type.try_make_transport_cps s4 ℤ;
+ xv <- ident.unify pattern.ident.Literal
+ ##(projT2 args4);
+ xv0 <- ident.unify pattern.ident.Literal
+ ##(projT2 args0);
+ v0 <- type.try_make_transport_cps s10 ℤ;
+ fv <- (x12 <- (if
+ ((let (x12, _) := xv in x12) =?
+ 2
+ ^ (2 *
Z.log2_up
- (let (x6, _) := xv in x6))
- (let (x6, _) := xv0 in x6);
- Some
- (#(Z_cast range)%expr @
- (#(fancy_mulll
- (2 *
- Z.log2_up
- (let (x6, _) := xv in
- x6)))%expr @
- (#(Z_cast args1)%expr @
- v (Compile.reflect x5),
- (##y)%expr)))%expr_pat
- else None);
- Some (Base x6));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end);;
- args <- invert_bind_args idc4 Raw.ident.Literal;
- args0 <- invert_bind_args idc3 Raw.ident.Literal;
- args1 <- invert_bind_args idc2 Raw.ident.Z_cast;
- _ <- invert_bind_args idc1 Raw.ident.Z_land;
- args3 <- invert_bind_args idc0 Raw.ident.Z_cast;
- _ <- invert_bind_args idc Raw.ident.Z_mul;
- match
- pattern.type.unify_extracted ((ℤ -> ℤ) -> ℤ)%ptype
- ((s4 -> (projT1 args0)) -> (projT1 args))%ptype
- with
- | Some (_, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- ((ℤ -> ℤ) -> ℤ)%ptype
- ((s4 -> (projT1 args0)) -> (projT1 args))%ptype
- then
- v <- type.try_make_transport_cps s4 ℤ;
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x6 <- (if
- ((let (x6, _) := xv in x6) =?
- 2
- ^ (2 *
- Z.log2_up
- (let (x6, _) := xv in x6) / 2) -
- 1) &&
- (ZRange.normalize args1 &'
- ZRange.normalize
- (ZRange.constant
- (let (x6, _) := xv in x6)) <=?
- ZRange.normalize args3)%zrange
- then
- y <- invert_high
- (2 *
- Z.log2_up
- (let (x6, _) := xv in x6))
- (let (x6, _) := xv0 in x6);
- Some
- (#(Z_cast range)%expr @
- (#(fancy_mullh
- (2 *
+ (let (x12, _) := xv in
+ x12) / 2) - 1) &&
+ ((let (x12, _) := xv0 in x12) =?
+ 2
+ ^ (2 *
Z.log2_up
- (let (x6, _) := xv in x6)))%expr @
- (#(Z_cast args1)%expr @
- v (Compile.reflect x5),
- (##y)%expr)))%expr_pat
- else None);
- Some (Base x6));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
+ (let (x12, _) := xv in
+ x12) / 2) - 1) &&
+ (ZRange.normalize args6 &'
+ ZRange.normalize
+ (ZRange.constant
+ (let (x12, _) := xv in
+ x12)) <=?
+ ZRange.normalize args8)%zrange &&
+ (ZRange.normalize
+ (ZRange.constant
+ (let (x12, _) := xv0 in
+ x12)) &'
+ ZRange.normalize args <=?
+ ZRange.normalize args3)%zrange &&
+ is_bounded_by_bool
+ (let (x12, _) := xv in x12)
+ (ZRange.normalize args5) &&
+ is_bounded_by_bool
+ (let (x12, _) := xv0 in x12)
+ (ZRange.normalize args1)
+ then
+ Some
+ (#(Z_cast range)%expr @
+ (#(fancy_mulll
+ (2 *
+ Z.log2_up
+ (let (x12, _) :=
+ xv in
+ x12)))%expr @
+ (#(Z_cast args6)%expr @
+ v (Compile.reflect x5),
+ #(Z_cast args)%expr @
+ v0 (Compile.reflect x11))))%expr_pat
+ else None);
+ Some (Base x12));
+ Some (fv0 <-- fv;
+ Base fv0)%under_lets
+ else None
+ | None => None
+ end
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Ident _ _ _ t8
+ idc8) @ @expr.App _ _ _ s10 _ ($_)%expr _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Ident _ _ _ t8
+ idc8) @ @expr.App _ _ _ s10 _
+ (@expr.Abs _ _ _ _ _ _) _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Ident _ _ _ t8
+ idc8) @ @expr.App _ _ _ s10 _ (_ @ _) _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Ident _ _ _ t8
+ idc8) @ @expr.App _ _ _ s10 _
+ (@expr.LetIn _ _ _ _ _ _ _) _))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Ident _ _ _ t8
+ idc8) @ #(_)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Ident _ _ _ t8
+ idc8) @ ($_)%expr))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Ident _ _ _ t8
+ idc8) @ @expr.Abs _ _ _ _ _ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Ident _ _ _ t8
+ idc8) @ @expr.LetIn _ _ _ _ _ _ _))%expr_pat =>
+ None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ ($_)%expr) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Abs _ _ _ _ _ _) @
+ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ (_ @ _)) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.LetIn _ _ _ _ _
+ _ _) @ _))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ #(_) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _ _ _ _ @
+ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ (($_)%expr @ _) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Abs _ _ _ _ _ _ @ _) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ (_ @ _ @ _) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _ _ _ _ _
+ _ @ _))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @ #(_))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (#(_) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _ _ _
+ _)%expr_pat => None
+ | _ => None
end
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ x8 @ x7))%expr_pat =>
- match x8 with
- | @expr.Ident _ _ _ t6 idc6 =>
- match x7 with
- | @expr.App _ _ _ s8 _ (@expr.Ident _ _ _ t7 idc7)
- x9 =>
- args <- invert_bind_args idc7 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc6
- Raw.ident.Literal;
- _ <- invert_bind_args idc5 Raw.ident.Z_land;
- args2 <- invert_bind_args idc4 Raw.ident.Z_cast;
- args3 <- invert_bind_args idc3
- Raw.ident.Literal;
- args4 <- invert_bind_args idc2 Raw.ident.Z_cast;
- _ <- invert_bind_args idc1 Raw.ident.Z_land;
- args6 <- invert_bind_args idc0 Raw.ident.Z_cast;
- _ <- invert_bind_args idc Raw.ident.Z_mul;
- match
- pattern.type.unify_extracted
- ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- ((s4 -> (projT1 args3)) ->
- (projT1 args0) -> s8)%ptype
- with
- | Some (_, _, (_, _))%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- ((s4 -> (projT1 args3)) ->
- (projT1 args0) -> s8)%ptype
- then
- v <- type.try_make_transport_cps s4 ℤ;
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args3);
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- v0 <- type.try_make_transport_cps s8 ℤ;
- fv <- (x10 <- (if
- ((let (x10, _) := xv in
- x10) =?
- 2
- ^ (2 *
- Z.log2_up
- (let (x10, _) :=
- xv in
- x10) / 2) - 1) &&
- ((let (x10, _) := xv0 in
- x10) =?
- 2
- ^ (2 *
- Z.log2_up
- (let (x10, _) :=
- xv in
- x10) / 2) - 1) &&
- (ZRange.normalize args4 &'
- ZRange.normalize
- (ZRange.constant
- (let (x10, _) :=
- xv in
- x10)) <=?
- ZRange.normalize args6)%zrange &&
- (ZRange.normalize
- (ZRange.constant
- (let (x10, _) :=
- xv0 in
- x10)) &'
- ZRange.normalize args <=?
- ZRange.normalize args2)%zrange
- then
- Some
- (#(Z_cast range)%expr @
- (#(fancy_mulll
- (2 *
- Z.log2_up
- (let
- (x10, _) :=
- xv in
- x10)))%expr @
- (#(Z_cast args4)%expr @
- v
- (Compile.reflect x5),
- #(Z_cast args)%expr @
- v0
- (Compile.reflect x9))))%expr_pat
- else None);
- Some (Base x10));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s8 _ ($_)%expr _ | @expr.App _ _
- _ s8 _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _
- _ s8 _ (_ @ _)%expr_pat _ | @expr.App _ _ _ s8 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
+ | _ => None
+ end;;
+ match x5 with
+ | @expr.Ident _ _ _ t4 idc4 =>
+ match x0 with
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9)))%expr_pat =>
+ args <- invert_bind_args idc9 Raw.ident.Literal;
+ args0 <- invert_bind_args idc8 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc7 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc6 Raw.ident.Z_land;
+ args3 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ args4 <- invert_bind_args idc4 Raw.ident.Literal;
+ args5 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args6 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc1 Raw.ident.Z_land;
+ args8 <- invert_bind_args idc0 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc Raw.ident.Z_mul;
+ match
+ pattern.type.unify_extracted
+ ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
+ (((projT1 args4) -> s5) -> s9 -> (projT1 args))%ptype
+ with
+ | Some (_, _, (_, _))%zrange =>
+ if
+ type.type_beq base.type base.type.type_beq
+ ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
+ (((projT1 args4) -> s5) ->
+ s9 -> (projT1 args))%ptype
+ then
+ xv <- ident.unify pattern.ident.Literal
+ ##(projT2 args4);
+ v <- type.try_make_transport_cps s5 ℤ;
+ v0 <- type.try_make_transport_cps s9 ℤ;
+ xv0 <- ident.unify pattern.ident.Literal
+ ##(projT2 args);
+ fv <- (x12 <- (if
+ ((let (x12, _) := xv in x12) =?
+ 2
+ ^ (2 *
+ Z.log2_up
+ (let (x12, _) := xv in
+ x12) / 2) - 1) &&
+ ((let (x12, _) := xv0 in x12) =?
+ 2
+ ^ (2 *
+ Z.log2_up
+ (let (x12, _) := xv in
+ x12) / 2) - 1) &&
+ (ZRange.normalize
+ (ZRange.constant
+ (let (x12, _) := xv in
+ x12)) &'
+ ZRange.normalize args5 <=?
+ ZRange.normalize args8)%zrange &&
+ (ZRange.normalize args1 &'
+ ZRange.normalize
+ (ZRange.constant
+ (let (x12, _) := xv0 in
+ x12)) <=?
+ ZRange.normalize args3)%zrange &&
+ is_bounded_by_bool
+ (let (x12, _) := xv in x12)
+ (ZRange.normalize args6) &&
+ is_bounded_by_bool
+ (let (x12, _) := xv0 in x12)
+ (ZRange.normalize args0)
+ then
+ Some
+ (#(Z_cast range)%expr @
+ (#(fancy_mulll
+ (2 *
+ Z.log2_up
+ (let (x12, _) :=
+ xv in
+ x12)))%expr @
+ (#(Z_cast args5)%expr @
+ v (Compile.reflect x6),
+ #(Z_cast args1)%expr @
+ v0 (Compile.reflect x10))))%expr_pat
+ else None);
+ Some (Base x12));
+ Some (fv0 <-- fv;
+ Base fv0)%under_lets
+ else None
+ | None => None
end
- | @expr.App _ _ _ s8 _ (@expr.Ident _ _ _ t6 idc6)
- x9 =>
- match x7 with
- | @expr.Ident _ _ _ t7 idc7 =>
- args <- invert_bind_args idc7 Raw.ident.Literal;
- args0 <- invert_bind_args idc6 Raw.ident.Z_cast;
- _ <- invert_bind_args idc5 Raw.ident.Z_land;
- args2 <- invert_bind_args idc4 Raw.ident.Z_cast;
- args3 <- invert_bind_args idc3
- Raw.ident.Literal;
- args4 <- invert_bind_args idc2 Raw.ident.Z_cast;
- _ <- invert_bind_args idc1 Raw.ident.Z_land;
- args6 <- invert_bind_args idc0 Raw.ident.Z_cast;
- _ <- invert_bind_args idc Raw.ident.Z_mul;
- match
- pattern.type.unify_extracted
- ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- ((s4 -> (projT1 args3)) ->
- s8 -> (projT1 args))%ptype
- with
- | Some (_, _, (_, _))%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- ((s4 -> (projT1 args3)) ->
- s8 -> (projT1 args))%ptype
- then
- v <- type.try_make_transport_cps s4 ℤ;
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args3);
- v0 <- type.try_make_transport_cps s8 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x10 <- (if
- ((let (x10, _) := xv in
- x10) =?
- 2
- ^ (2 *
- Z.log2_up
- (let (x10, _) :=
- xv in
- x10) / 2) - 1) &&
- ((let (x10, _) := xv0 in
- x10) =?
- 2
- ^ (2 *
- Z.log2_up
- (let (x10, _) :=
- xv in
- x10) / 2) - 1) &&
- (ZRange.normalize args4 &'
- ZRange.normalize
- (ZRange.constant
- (let (x10, _) :=
- xv in
- x10)) <=?
- ZRange.normalize args6)%zrange &&
- (ZRange.normalize args0 &'
- ZRange.normalize
- (ZRange.constant
- (let (x10, _) :=
- xv0 in
- x10)) <=?
- ZRange.normalize args2)%zrange
- then
- Some
- (#(Z_cast range)%expr @
- (#(fancy_mulll
- (2 *
- Z.log2_up
- (let
- (x10, _) :=
- xv in
- x10)))%expr @
- (#(Z_cast args4)%expr @
- v
- (Compile.reflect x5),
- #(Z_cast args0)%expr @
- v0
- (Compile.reflect x9))))%expr_pat
- else None);
- Some (Base x10));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Ident _ _ _ t8 idc8 @ ($_)%expr)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Abs _ _ _ _ _ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Ident _ _ _ t8 idc8 @ (_ @ _))))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.LetIn _ _ _ _ _
+ _ _)))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ #(_)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ ($_)%expr))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ @expr.Abs _ _ _ _
+ _ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ (($_)%expr @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Abs _ _ _ _ _ _ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ (_ @ _ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ @expr.LetIn _ _ _
+ _ _ _ _))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ ($_)%expr _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Abs _ _ _ _ _ _) _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (_ @ _) _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.LetIn _ _ _ _ _ _ _) _ @ _))%expr_pat =>
+ None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ #(_) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _ _ _ _ @
+ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _ _ _ _ _
+ _ @ _))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @ #(_))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (#(_) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _ _ _
+ _)%expr_pat => None
+ | _ => None
+ end
+ | _ => None
+ end;;
+ match x6 with
+ | @expr.Ident _ _ _ t4 idc4 =>
+ match x0 with
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9)))%expr_pat =>
+ args <- invert_bind_args idc9 Raw.ident.Literal;
+ args0 <- invert_bind_args idc8 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc7 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc6 Raw.ident.Z_land;
+ args3 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ args4 <- invert_bind_args idc4 Raw.ident.Literal;
+ args5 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args6 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc1 Raw.ident.Z_land;
+ args8 <- invert_bind_args idc0 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc Raw.ident.Z_mul;
+ match
+ pattern.type.unify_extracted
+ ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
+ ((s4 -> (projT1 args4)) -> s9 -> (projT1 args))%ptype
+ with
+ | Some (_, _, (_, _))%zrange =>
+ if
+ type.type_beq base.type base.type.type_beq
+ ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
+ ((s4 -> (projT1 args4)) ->
+ s9 -> (projT1 args))%ptype
+ then
+ v <- type.try_make_transport_cps s4 ℤ;
+ xv <- ident.unify pattern.ident.Literal
+ ##(projT2 args4);
+ v0 <- type.try_make_transport_cps s9 ℤ;
+ xv0 <- ident.unify pattern.ident.Literal
+ ##(projT2 args);
+ fv <- (x12 <- (if
+ ((let (x12, _) := xv in x12) =?
+ 2
+ ^ (2 *
+ Z.log2_up
+ (let (x12, _) := xv in
+ x12) / 2) - 1) &&
+ ((let (x12, _) := xv0 in x12) =?
+ 2
+ ^ (2 *
+ Z.log2_up
+ (let (x12, _) := xv in
+ x12) / 2) - 1) &&
+ (ZRange.normalize args6 &'
+ ZRange.normalize
+ (ZRange.constant
+ (let (x12, _) := xv in
+ x12)) <=?
+ ZRange.normalize args8)%zrange &&
+ (ZRange.normalize args1 &'
+ ZRange.normalize
+ (ZRange.constant
+ (let (x12, _) := xv0 in
+ x12)) <=?
+ ZRange.normalize args3)%zrange &&
+ is_bounded_by_bool
+ (let (x12, _) := xv in x12)
+ (ZRange.normalize args5) &&
+ is_bounded_by_bool
+ (let (x12, _) := xv0 in x12)
+ (ZRange.normalize args0)
+ then
+ Some
+ (#(Z_cast range)%expr @
+ (#(fancy_mulll
+ (2 *
+ Z.log2_up
+ (let (x12, _) :=
+ xv in
+ x12)))%expr @
+ (#(Z_cast args6)%expr @
+ v (Compile.reflect x5),
+ #(Z_cast args1)%expr @
+ v0 (Compile.reflect x10))))%expr_pat
+ else None);
+ Some (Base x12));
+ Some (fv0 <-- fv;
+ Base fv0)%under_lets
+ else None
+ | None => None
end
- | @expr.App _ _ _ s8 _ ($_)%expr _ | @expr.App _ _ _ s8
- _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s8 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s8 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Ident _ _ _ t8 idc8 @ ($_)%expr)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Abs _ _ _ _ _ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Ident _ _ _ t8 idc8 @ (_ @ _))))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.LetIn _ _ _ _ _
+ _ _)))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ #(_)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ ($_)%expr))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ @expr.Abs _ _ _ _
+ _ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ (($_)%expr @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Abs _ _ _ _ _ _ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ (_ @ _ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ @expr.LetIn _ _ _
+ _ _ _ _))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ ($_)%expr _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Abs _ _ _ _ _ _) _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (_ @ _) _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.LetIn _ _ _ _ _ _ _) _ @ _))%expr_pat =>
+ None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ #(_) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _ _ _ _ @
+ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _ _ _ _ _
+ _ @ _))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @ #(_))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (#(_) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _ _ _
+ _)%expr_pat => None
| _ => None
- end;;
- match x8 with
- | @expr.App _ _ _ s8 _ (@expr.Ident _ _ _ t6 idc6)
- x9 =>
- match x7 with
- | @expr.Ident _ _ _ t7 idc7 =>
- args <- invert_bind_args idc7 Raw.ident.Literal;
- args0 <- invert_bind_args idc6 Raw.ident.Z_cast;
- _ <- invert_bind_args idc5 Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc4 Raw.ident.Z_cast;
- args3 <- invert_bind_args idc3
- Raw.ident.Literal;
- args4 <- invert_bind_args idc2 Raw.ident.Z_cast;
- _ <- invert_bind_args idc1 Raw.ident.Z_land;
- args6 <- invert_bind_args idc0 Raw.ident.Z_cast;
- _ <- invert_bind_args idc Raw.ident.Z_mul;
- match
- pattern.type.unify_extracted
- ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- ((s4 -> (projT1 args3)) ->
- s8 -> (projT1 args))%ptype
- with
- | Some (_, _, (_, _))%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- ((s4 -> (projT1 args3)) ->
- s8 -> (projT1 args))%ptype
- then
- v <- type.try_make_transport_cps s4 ℤ;
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args3);
- v0 <- type.try_make_transport_cps s8 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x10 <- (if
- ((let (x10, _) := xv in
- x10) =?
- 2
- ^ (2 *
- (let (x10, _) :=
- xv0 in
- x10) / 2) - 1) &&
- (ZRange.normalize args4 &'
- ZRange.normalize
- (ZRange.constant
- (let (x10, _) :=
- xv in
- x10)) <=?
- ZRange.normalize args6)%zrange &&
- (ZRange.normalize args0 >>
- ZRange.normalize
- (ZRange.constant
- (let (x10, _) :=
- xv0 in
- x10)) <=?
- ZRange.normalize args2)%zrange
- then
- Some
- (#(Z_cast range)%expr @
- (#(fancy_mullh
- (2 *
- (let (x10, _) :=
- xv0 in
- x10)))%expr @
- (#(Z_cast args4)%expr @
- v
- (Compile.reflect x5),
- #(Z_cast args0)%expr @
- v0
- (Compile.reflect x9))))%expr_pat
- else None);
- Some (Base x10));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
+ end
+ | _ => None
+ end;;
+ match x5 with
+ | @expr.Ident _ _ _ t4 idc4 =>
+ match x0 with
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9)))%expr_pat =>
+ args <- invert_bind_args idc9 Raw.ident.Literal;
+ args0 <- invert_bind_args idc8 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc7 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc6 Raw.ident.Z_shiftr;
+ args3 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ args4 <- invert_bind_args idc4 Raw.ident.Literal;
+ args5 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args6 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc1 Raw.ident.Z_land;
+ args8 <- invert_bind_args idc0 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc Raw.ident.Z_mul;
+ match
+ pattern.type.unify_extracted
+ ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
+ (((projT1 args4) -> s5) -> s9 -> (projT1 args))%ptype
+ with
+ | Some (_, _, (_, _))%zrange =>
+ if
+ type.type_beq base.type base.type.type_beq
+ ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
+ (((projT1 args4) -> s5) ->
+ s9 -> (projT1 args))%ptype
+ then
+ xv <- ident.unify pattern.ident.Literal
+ ##(projT2 args4);
+ v <- type.try_make_transport_cps s5 ℤ;
+ v0 <- type.try_make_transport_cps s9 ℤ;
+ xv0 <- ident.unify pattern.ident.Literal
+ ##(projT2 args);
+ fv <- (x12 <- (if
+ ((let (x12, _) := xv in x12) =?
+ 2
+ ^ (2 *
+ (let (x12, _) := xv0 in
+ x12) / 2) - 1) &&
+ (ZRange.normalize
+ (ZRange.constant
+ (let (x12, _) := xv in
+ x12)) &'
+ ZRange.normalize args5 <=?
+ ZRange.normalize args8)%zrange &&
+ (ZRange.normalize args1 >>
+ ZRange.normalize
+ (ZRange.constant
+ (let (x12, _) := xv0 in
+ x12)) <=?
+ ZRange.normalize args3)%zrange &&
+ is_bounded_by_bool
+ (let (x12, _) := xv in x12)
+ (ZRange.normalize args6) &&
+ is_bounded_by_bool
+ (let (x12, _) := xv0 in x12)
+ (ZRange.normalize args0)
+ then
+ Some
+ (#(Z_cast range)%expr @
+ (#(fancy_mullh
+ (2 *
+ (let (x12, _) :=
+ xv0 in
+ x12)))%expr @
+ (#(Z_cast args5)%expr @
+ v (Compile.reflect x6),
+ #(Z_cast args1)%expr @
+ v0 (Compile.reflect x10))))%expr_pat
+ else None);
+ Some (Base x12));
+ Some (fv0 <-- fv;
+ Base fv0)%under_lets
+ else None
+ | None => None
end
- | @expr.App _ _ _ s8 _ ($_)%expr _ | @expr.App _ _ _ s8
- _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s8 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s8 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Ident _ _ _ t8 idc8 @ ($_)%expr)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Abs _ _ _ _ _ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Ident _ _ _ t8 idc8 @ (_ @ _))))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.LetIn _ _ _ _ _
+ _ _)))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ #(_)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ ($_)%expr))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ @expr.Abs _ _ _ _
+ _ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ (($_)%expr @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Abs _ _ _ _ _ _ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ (_ @ _ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ @expr.LetIn _ _ _
+ _ _ _ _))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ ($_)%expr _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Abs _ _ _ _ _ _) _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (_ @ _) _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.LetIn _ _ _ _ _ _ _) _ @ _))%expr_pat =>
+ None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ #(_) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _ _ _ _ @
+ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _ _ _ _ _
+ _ @ _))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @ #(_))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (#(_) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _ _ _
+ _)%expr_pat => None
+ | _ => None
+ end
+ | _ => None
+ end;;
+ match x6 with
+ | @expr.Ident _ _ _ t4 idc4 =>
+ match x0 with
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9)))%expr_pat =>
+ args <- invert_bind_args idc9 Raw.ident.Literal;
+ args0 <- invert_bind_args idc8 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc7 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc6 Raw.ident.Z_shiftr;
+ args3 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ args4 <- invert_bind_args idc4 Raw.ident.Literal;
+ args5 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args6 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc1 Raw.ident.Z_land;
+ args8 <- invert_bind_args idc0 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc Raw.ident.Z_mul;
+ match
+ pattern.type.unify_extracted
+ ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
+ ((s4 -> (projT1 args4)) -> s9 -> (projT1 args))%ptype
+ with
+ | Some (_, _, (_, _))%zrange =>
+ if
+ type.type_beq base.type base.type.type_beq
+ ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
+ ((s4 -> (projT1 args4)) ->
+ s9 -> (projT1 args))%ptype
+ then
+ v <- type.try_make_transport_cps s4 ℤ;
+ xv <- ident.unify pattern.ident.Literal
+ ##(projT2 args4);
+ v0 <- type.try_make_transport_cps s9 ℤ;
+ xv0 <- ident.unify pattern.ident.Literal
+ ##(projT2 args);
+ fv <- (x12 <- (if
+ ((let (x12, _) := xv in x12) =?
+ 2
+ ^ (2 *
+ (let (x12, _) := xv0 in
+ x12) / 2) - 1) &&
+ (ZRange.normalize args6 &'
+ ZRange.normalize
+ (ZRange.constant
+ (let (x12, _) := xv in
+ x12)) <=?
+ ZRange.normalize args8)%zrange &&
+ (ZRange.normalize args1 >>
+ ZRange.normalize
+ (ZRange.constant
+ (let (x12, _) := xv0 in
+ x12)) <=?
+ ZRange.normalize args3)%zrange &&
+ is_bounded_by_bool
+ (let (x12, _) := xv in x12)
+ (ZRange.normalize args5) &&
+ is_bounded_by_bool
+ (let (x12, _) := xv0 in x12)
+ (ZRange.normalize args0)
+ then
+ Some
+ (#(Z_cast range)%expr @
+ (#(fancy_mullh
+ (2 *
+ (let (x12, _) :=
+ xv0 in
+ x12)))%expr @
+ (#(Z_cast args6)%expr @
+ v (Compile.reflect x5),
+ #(Z_cast args1)%expr @
+ v0 (Compile.reflect x10))))%expr_pat
+ else None);
+ Some (Base x12));
+ Some (fv0 <-- fv;
+ Base fv0)%under_lets
+ else None
+ | None => None
+ end
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Ident _ _ _ t8 idc8 @ ($_)%expr)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Abs _ _ _ _ _ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Ident _ _ _ t8 idc8 @ (_ @ _))))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.LetIn _ _ _ _ _
+ _ _)))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ #(_)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ ($_)%expr))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ @expr.Abs _ _ _ _
+ _ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ (($_)%expr @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.Abs _ _ _ _ _ _ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ (_ @ _ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t7 idc7) x10 @ @expr.LetIn _ _ _
+ _ _ _ _))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ ($_)%expr _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.Abs _ _ _ _ _ _) _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (_ @ _) _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s9 _
+ (@expr.LetIn _ _ _ _ _ _ _) _ @ _))%expr_pat =>
+ None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ #(_) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _ _ _ _ @
+ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _ _ _ _ _
+ _ @ _))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @ #(_))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (#(_) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _ _ _
+ _)%expr_pat => None
| _ => None
end
- | (@expr.Ident _ _ _ t4 idc4 @ #(_))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (#(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (_ @ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.LetIn _ _ _ _ _ _ _)%expr_pat =>
- None
| _ => None
end
+ | @expr.App _ _ _ s5 _ ($_)%expr _ | @expr.App _ _ _ s5 _
+ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s5 _
+ (_ @ _)%expr_pat _ | @expr.App _ _ _ s5 _
+ (@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end
| @expr.App _ _ _ s4 _ ($_)%expr _ | @expr.App _ _ _ s4 _
@@ -1414,371 +2072,462 @@ match idc in (Compilers.ident t) return (Compile.value' true t) with
match x4 with
| @expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5 =>
match x3 with
- | @expr.Ident _ _ _ t3 idc3 =>
+ | (@expr.Ident _ _ _ t3 idc3 @ @expr.Ident _ _ _ t4 idc4)%expr_pat =>
match x0 with
- | @expr.Ident _ _ _ t4 idc4 =>
- (args <- invert_bind_args idc4 Raw.ident.Literal;
- args0 <- invert_bind_args idc3 Raw.ident.Literal;
- args1 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ | (@expr.Ident _ _ _ t5 idc5 @ @expr.Ident _ _ _ t6 idc6)%expr_pat =>
+ (args <- invert_bind_args idc6 Raw.ident.Literal;
+ args0 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc4 Raw.ident.Literal;
+ args2 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args3 <- invert_bind_args idc2 Raw.ident.Z_cast;
_ <- invert_bind_args idc1 Raw.ident.Z_shiftr;
- args3 <- invert_bind_args idc0 Raw.ident.Z_cast;
+ args5 <- invert_bind_args idc0 Raw.ident.Z_cast;
_ <- invert_bind_args idc Raw.ident.Z_mul;
match
pattern.type.unify_extracted ((ℤ -> ℤ) -> ℤ)%ptype
- ((s4 -> (projT1 args0)) -> (projT1 args))%ptype
+ ((s4 -> (projT1 args1)) -> (projT1 args))%ptype
with
| Some (_, _, _)%zrange =>
if
type.type_beq base.type base.type.type_beq
((ℤ -> ℤ) -> ℤ)%ptype
- ((s4 -> (projT1 args0)) -> (projT1 args))%ptype
+ ((s4 -> (projT1 args1)) -> (projT1 args))%ptype
then
v <- type.try_make_transport_cps s4 ℤ;
xv <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
+ ##(projT2 args1);
xv0 <- ident.unify pattern.ident.Literal
##(projT2 args);
- fv <- (x6 <- (if
- (ZRange.normalize args1 >>
+ fv <- (x8 <- (if
+ (ZRange.normalize args3 >>
ZRange.normalize
(ZRange.constant
- (let (x6, _) := xv in x6)) <=?
- ZRange.normalize args3)%zrange
+ (let (x8, _) := xv in x8)) <=?
+ ZRange.normalize args5)%zrange &&
+ is_bounded_by_bool
+ (let (x8, _) := xv0 in x8)
+ (ZRange.normalize args0) &&
+ is_bounded_by_bool
+ (let (x8, _) := xv in x8)
+ (ZRange.normalize args2)
then
y <- invert_low
(2 *
- (let (x6, _) := xv in x6))
- (let (x6, _) := xv0 in x6);
+ (let (x8, _) := xv in x8))
+ (let (x8, _) := xv0 in x8);
Some
(#(Z_cast range)%expr @
(#(fancy_mulhl
(2 *
- (let (x6, _) := xv in x6)))%expr @
- (#(Z_cast args1)%expr @
+ (let (x8, _) := xv in x8)))%expr @
+ (#(Z_cast args3)%expr @
v (Compile.reflect x5),
(##y)%expr)))%expr_pat
else None);
- Some (Base x6));
+ Some (Base x8));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end);;
- args <- invert_bind_args idc4 Raw.ident.Literal;
- args0 <- invert_bind_args idc3 Raw.ident.Literal;
- args1 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args <- invert_bind_args idc6 Raw.ident.Literal;
+ args0 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc4 Raw.ident.Literal;
+ args2 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args3 <- invert_bind_args idc2 Raw.ident.Z_cast;
_ <- invert_bind_args idc1 Raw.ident.Z_shiftr;
- args3 <- invert_bind_args idc0 Raw.ident.Z_cast;
+ args5 <- invert_bind_args idc0 Raw.ident.Z_cast;
_ <- invert_bind_args idc Raw.ident.Z_mul;
match
pattern.type.unify_extracted ((ℤ -> ℤ) -> ℤ)%ptype
- ((s4 -> (projT1 args0)) -> (projT1 args))%ptype
+ ((s4 -> (projT1 args1)) -> (projT1 args))%ptype
with
| Some (_, _, _)%zrange =>
if
type.type_beq base.type base.type.type_beq
((ℤ -> ℤ) -> ℤ)%ptype
- ((s4 -> (projT1 args0)) -> (projT1 args))%ptype
+ ((s4 -> (projT1 args1)) -> (projT1 args))%ptype
then
v <- type.try_make_transport_cps s4 ℤ;
xv <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
+ ##(projT2 args1);
xv0 <- ident.unify pattern.ident.Literal
##(projT2 args);
- fv <- (x6 <- (if
- (ZRange.normalize args1 >>
+ fv <- (x8 <- (if
+ (ZRange.normalize args3 >>
ZRange.normalize
(ZRange.constant
- (let (x6, _) := xv in x6)) <=?
- ZRange.normalize args3)%zrange
+ (let (x8, _) := xv in x8)) <=?
+ ZRange.normalize args5)%zrange &&
+ is_bounded_by_bool
+ (let (x8, _) := xv0 in x8)
+ (ZRange.normalize args0) &&
+ is_bounded_by_bool
+ (let (x8, _) := xv in x8)
+ (ZRange.normalize args2)
then
y <- invert_high
(2 *
- (let (x6, _) := xv in x6))
- (let (x6, _) := xv0 in x6);
+ (let (x8, _) := xv in x8))
+ (let (x8, _) := xv0 in x8);
Some
(#(Z_cast range)%expr @
(#(fancy_mulhh
(2 *
- (let (x6, _) := xv in x6)))%expr @
- (#(Z_cast args1)%expr @
+ (let (x8, _) := xv in x8)))%expr @
+ (#(Z_cast args3)%expr @
v (Compile.reflect x5),
(##y)%expr)))%expr_pat
else None);
- Some (Base x6));
+ Some (Base x8));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ x8 @ x7))%expr_pat =>
- match x8 with
- | @expr.Ident _ _ _ t6 idc6 =>
- match x7 with
- | @expr.App _ _ _ s8 _ (@expr.Ident _ _ _ t7 idc7)
- x9 =>
- args <- invert_bind_args idc7 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc6
- Raw.ident.Literal;
- _ <- invert_bind_args idc5 Raw.ident.Z_land;
- args2 <- invert_bind_args idc4 Raw.ident.Z_cast;
- args3 <- invert_bind_args idc3
- Raw.ident.Literal;
- args4 <- invert_bind_args idc2 Raw.ident.Z_cast;
- _ <- invert_bind_args idc1 Raw.ident.Z_shiftr;
- args6 <- invert_bind_args idc0 Raw.ident.Z_cast;
- _ <- invert_bind_args idc Raw.ident.Z_mul;
- match
- pattern.type.unify_extracted
- ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- ((s4 -> (projT1 args3)) ->
- (projT1 args0) -> s8)%ptype
- with
- | Some (_, _, (_, _))%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- ((s4 -> (projT1 args3)) ->
- (projT1 args0) -> s8)%ptype
- then
- v <- type.try_make_transport_cps s4 ℤ;
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args3);
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- v0 <- type.try_make_transport_cps s8 ℤ;
- fv <- (x10 <- (if
- ((let (x10, _) := xv0 in
- x10) =?
- 2
- ^ (2 *
- (let (x10, _) := xv in
- x10) / 2) - 1) &&
- (ZRange.normalize args4 >>
- ZRange.normalize
- (ZRange.constant
- (let (x10, _) :=
- xv in
- x10)) <=?
- ZRange.normalize args6)%zrange &&
- (ZRange.normalize
- (ZRange.constant
- (let (x10, _) :=
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ x9 @ x8))%expr_pat =>
+ match x9 with
+ | @expr.App _ _ _ s9 _ (@expr.Ident _ _ _ t7 idc7)
+ x10 =>
+ match x10 with
+ | @expr.Ident _ _ _ t8 idc8 =>
+ match x8 with
+ | @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t9 idc9) x11 =>
+ args <- invert_bind_args idc9
+ Raw.ident.Z_cast;
+ args0 <- invert_bind_args idc8
+ Raw.ident.Literal;
+ args1 <- invert_bind_args idc7
+ Raw.ident.Z_cast;
+ _ <- invert_bind_args idc6 Raw.ident.Z_land;
+ args3 <- invert_bind_args idc5
+ Raw.ident.Z_cast;
+ args4 <- invert_bind_args idc4
+ Raw.ident.Literal;
+ args5 <- invert_bind_args idc3
+ Raw.ident.Z_cast;
+ args6 <- invert_bind_args idc2
+ Raw.ident.Z_cast;
+ _ <- invert_bind_args idc1
+ Raw.ident.Z_shiftr;
+ args8 <- invert_bind_args idc0
+ Raw.ident.Z_cast;
+ _ <- invert_bind_args idc Raw.ident.Z_mul;
+ match
+ pattern.type.unify_extracted
+ ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
+ ((s4 -> (projT1 args4)) ->
+ (projT1 args0) -> s10)%ptype
+ with
+ | Some (_, _, (_, _))%zrange =>
+ if
+ type.type_beq base.type
+ base.type.type_beq
+ ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
+ ((s4 -> (projT1 args4)) ->
+ (projT1 args0) -> s10)%ptype
+ then
+ v <- type.try_make_transport_cps s4 ℤ;
+ xv <- ident.unify
+ pattern.ident.Literal
+ ##(projT2 args4);
+ xv0 <- ident.unify
+ pattern.ident.Literal
+ ##(projT2 args0);
+ v0 <- type.try_make_transport_cps s10 ℤ;
+ fv <- (x12 <- (if
+ ((let (x12, _) :=
+ xv0 in
+ x12) =?
+ 2
+ ^ (2 *
+ (let (x12, _) :=
+ xv in
+ x12) / 2) - 1) &&
+ (ZRange.normalize
+ args6 >>
+ ZRange.normalize
+ (ZRange.constant
+ (let (x12, _) :=
+ xv in
+ x12)) <=?
+ ZRange.normalize
+ args8)%zrange &&
+ (ZRange.normalize
+ (ZRange.constant
+ (let (x12, _) :=
+ xv0 in
+ x12)) &'
+ ZRange.normalize args <=?
+ ZRange.normalize
+ args3)%zrange &&
+ is_bounded_by_bool
+ (let (x12, _) :=
xv0 in
- x10)) &'
- ZRange.normalize args <=?
- ZRange.normalize args2)%zrange
- then
- Some
- (#(Z_cast range)%expr @
- (#(fancy_mulhl
- (2 *
- (let (x10, _) :=
- xv in
- x10)))%expr @
- (#(Z_cast args4)%expr @
- v
- (Compile.reflect x5),
- #(Z_cast args)%expr @
- v0
- (Compile.reflect x9))))%expr_pat
- else None);
- Some (Base x10));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
+ x12)
+ (ZRange.normalize
+ args1) &&
+ is_bounded_by_bool
+ (let (x12, _) :=
+ xv in
+ x12)
+ (ZRange.normalize
+ args5)
+ then
+ Some
+ (#(Z_cast range)%expr @
+ (#(fancy_mulhl
+ (2 *
+ (let
+ (x12,
+ _) :=
+ xv in
+ x12)))%expr @
+ (#(Z_cast args6)%expr @
+ v
+ (Compile.reflect
+ x5),
+ #(Z_cast args)%expr @
+ v0
+ (Compile.reflect
+ x11))))%expr_pat
+ else None);
+ Some (Base x12));
+ Some (fv0 <-- fv;
+ Base fv0)%under_lets
+ else None
+ | None => None
+ end
+ | @expr.App _ _ _ s10 _ ($_)%expr _ | @expr.App
+ _ _ _ s10 _ (@expr.Abs _ _ _ _ _ _) _ |
+ @expr.App _ _ _ s10 _ (_ @ _)%expr_pat _ |
+ @expr.App _ _ _ s10 _
+ (@expr.LetIn _ _ _ _ _ _ _) _ => None
+ | _ => None
end
- | @expr.App _ _ _ s8 _ ($_)%expr _ | @expr.App _ _
- _ s8 _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _
- _ s8 _ (_ @ _)%expr_pat _ | @expr.App _ _ _ s8 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
- end
- | @expr.App _ _ _ s8 _ (@expr.Ident _ _ _ t6 idc6)
- x9 =>
- match x7 with
- | @expr.Ident _ _ _ t7 idc7 =>
- args <- invert_bind_args idc7 Raw.ident.Literal;
- args0 <- invert_bind_args idc6 Raw.ident.Z_cast;
- _ <- invert_bind_args idc5 Raw.ident.Z_land;
- args2 <- invert_bind_args idc4 Raw.ident.Z_cast;
- args3 <- invert_bind_args idc3
+ end;;
+ match x8 with
+ | (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9)%expr_pat =>
+ args <- invert_bind_args idc9 Raw.ident.Literal;
+ args0 <- invert_bind_args idc8 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc7 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc6 Raw.ident.Z_land;
+ args3 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ args4 <- invert_bind_args idc4
Raw.ident.Literal;
- args4 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args5 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args6 <- invert_bind_args idc2 Raw.ident.Z_cast;
_ <- invert_bind_args idc1 Raw.ident.Z_shiftr;
- args6 <- invert_bind_args idc0 Raw.ident.Z_cast;
+ args8 <- invert_bind_args idc0 Raw.ident.Z_cast;
_ <- invert_bind_args idc Raw.ident.Z_mul;
match
pattern.type.unify_extracted
((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- ((s4 -> (projT1 args3)) ->
- s8 -> (projT1 args))%ptype
+ ((s4 -> (projT1 args4)) ->
+ s9 -> (projT1 args))%ptype
with
| Some (_, _, (_, _))%zrange =>
if
type.type_beq base.type base.type.type_beq
((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- ((s4 -> (projT1 args3)) ->
- s8 -> (projT1 args))%ptype
+ ((s4 -> (projT1 args4)) ->
+ s9 -> (projT1 args))%ptype
then
v <- type.try_make_transport_cps s4 ℤ;
xv <- ident.unify pattern.ident.Literal
- ##(projT2 args3);
- v0 <- type.try_make_transport_cps s8 ℤ;
+ ##(projT2 args4);
+ v0 <- type.try_make_transport_cps s9 ℤ;
xv0 <- ident.unify pattern.ident.Literal
##(projT2 args);
- fv <- (x10 <- (if
- ((let (x10, _) := xv0 in
- x10) =?
+ fv <- (x12 <- (if
+ ((let (x12, _) := xv0 in
+ x12) =?
2
^ (2 *
- (let (x10, _) := xv in
- x10) / 2) - 1) &&
- (ZRange.normalize args4 >>
+ (let (x12, _) := xv in
+ x12) / 2) - 1) &&
+ (ZRange.normalize args6 >>
ZRange.normalize
(ZRange.constant
- (let (x10, _) :=
+ (let (x12, _) :=
xv in
- x10)) <=?
- ZRange.normalize args6)%zrange &&
- (ZRange.normalize args0 &'
+ x12)) <=?
+ ZRange.normalize args8)%zrange &&
+ (ZRange.normalize args1 &'
ZRange.normalize
(ZRange.constant
- (let (x10, _) :=
+ (let (x12, _) :=
xv0 in
- x10)) <=?
- ZRange.normalize args2)%zrange
+ x12)) <=?
+ ZRange.normalize args3)%zrange &&
+ is_bounded_by_bool
+ (let (x12, _) := xv0 in
+ x12)
+ (ZRange.normalize args0) &&
+ is_bounded_by_bool
+ (let (x12, _) := xv in
+ x12)
+ (ZRange.normalize args5)
then
Some
(#(Z_cast range)%expr @
(#(fancy_mulhl
(2 *
- (let (x10, _) :=
+ (let (x12, _) :=
xv in
- x10)))%expr @
- (#(Z_cast args4)%expr @
+ x12)))%expr @
+ (#(Z_cast args6)%expr @
v
(Compile.reflect x5),
- #(Z_cast args0)%expr @
+ #(Z_cast args1)%expr @
v0
- (Compile.reflect x9))))%expr_pat
+ (Compile.reflect x10))))%expr_pat
else None);
- Some (Base x10));
+ Some (Base x12));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end
+ | (@expr.Ident _ _ _ t8 idc8 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Abs _ _ _ _ _
+ _)%expr_pat |
+ (@expr.Ident _ _ _ t8 idc8 @ (_ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.LetIn _ _ _ _
+ _ _ _)%expr_pat => None
| _ => None
end
- | @expr.App _ _ _ s8 _ ($_)%expr _ | @expr.App _ _ _ s8
- _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s8 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s8 _
+ | @expr.App _ _ _ s9 _ ($_)%expr _ | @expr.App _ _ _ s9
+ _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s9 _
+ (_ @ _)%expr_pat _ | @expr.App _ _ _ s9 _
(@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end;;
- match x8 with
- | @expr.App _ _ _ s8 _ (@expr.Ident _ _ _ t6 idc6)
- x9 =>
- match x7 with
- | @expr.Ident _ _ _ t7 idc7 =>
- args <- invert_bind_args idc7 Raw.ident.Literal;
- args0 <- invert_bind_args idc6 Raw.ident.Z_cast;
- _ <- invert_bind_args idc5 Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc4 Raw.ident.Z_cast;
- args3 <- invert_bind_args idc3
+ match x9 with
+ | @expr.App _ _ _ s9 _ (@expr.Ident _ _ _ t7 idc7)
+ x10 =>
+ match x8 with
+ | (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9)%expr_pat =>
+ args <- invert_bind_args idc9 Raw.ident.Literal;
+ args0 <- invert_bind_args idc8 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc7 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc6 Raw.ident.Z_shiftr;
+ args3 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ args4 <- invert_bind_args idc4
Raw.ident.Literal;
- args4 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args5 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args6 <- invert_bind_args idc2 Raw.ident.Z_cast;
_ <- invert_bind_args idc1 Raw.ident.Z_shiftr;
- args6 <- invert_bind_args idc0 Raw.ident.Z_cast;
+ args8 <- invert_bind_args idc0 Raw.ident.Z_cast;
_ <- invert_bind_args idc Raw.ident.Z_mul;
match
pattern.type.unify_extracted
((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- ((s4 -> (projT1 args3)) ->
- s8 -> (projT1 args))%ptype
+ ((s4 -> (projT1 args4)) ->
+ s9 -> (projT1 args))%ptype
with
| Some (_, _, (_, _))%zrange =>
if
type.type_beq base.type base.type.type_beq
((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- ((s4 -> (projT1 args3)) ->
- s8 -> (projT1 args))%ptype
+ ((s4 -> (projT1 args4)) ->
+ s9 -> (projT1 args))%ptype
then
v <- type.try_make_transport_cps s4 ℤ;
xv <- ident.unify pattern.ident.Literal
- ##(projT2 args3);
- v0 <- type.try_make_transport_cps s8 ℤ;
+ ##(projT2 args4);
+ v0 <- type.try_make_transport_cps s9 ℤ;
xv0 <- ident.unify pattern.ident.Literal
##(projT2 args);
- fv <- (x10 <- (if
- ((let (x10, _) := xv in
- x10) =?
- (let (x10, _) := xv0 in
- x10)) &&
- (ZRange.normalize args4 >>
+ fv <- (x12 <- (if
+ ((let (x12, _) := xv in
+ x12) =?
+ (let (x12, _) := xv0 in
+ x12)) &&
+ (ZRange.normalize args6 >>
ZRange.normalize
(ZRange.constant
- (let (x10, _) :=
+ (let (x12, _) :=
xv in
- x10)) <=?
- ZRange.normalize args6)%zrange &&
- (ZRange.normalize args0 >>
+ x12)) <=?
+ ZRange.normalize args8)%zrange &&
+ (ZRange.normalize args1 >>
ZRange.normalize
(ZRange.constant
- (let (x10, _) :=
+ (let (x12, _) :=
xv0 in
- x10)) <=?
- ZRange.normalize args2)%zrange
+ x12)) <=?
+ ZRange.normalize args3)%zrange &&
+ is_bounded_by_bool
+ (let (x12, _) := xv in
+ x12)
+ (ZRange.normalize args5) &&
+ is_bounded_by_bool
+ (let (x12, _) := xv0 in
+ x12)
+ (ZRange.normalize args0)
then
Some
(#(Z_cast range)%expr @
(#(fancy_mulhh
(2 *
- (let (x10, _) :=
+ (let (x12, _) :=
xv in
- x10)))%expr @
- (#(Z_cast args4)%expr @
+ x12)))%expr @
+ (#(Z_cast args6)%expr @
v
(Compile.reflect x5),
- #(Z_cast args0)%expr @
+ #(Z_cast args1)%expr @
v0
- (Compile.reflect x9))))%expr_pat
+ (Compile.reflect x10))))%expr_pat
else None);
- Some (Base x10));
+ Some (Base x12));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end
+ | (@expr.Ident _ _ _ t8 idc8 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Abs _ _ _ _ _
+ _)%expr_pat |
+ (@expr.Ident _ _ _ t8 idc8 @ (_ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.LetIn _ _ _ _
+ _ _ _)%expr_pat => None
| _ => None
end
- | @expr.App _ _ _ s8 _ ($_)%expr _ | @expr.App _ _ _ s8
- _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s8 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s8 _
+ | @expr.App _ _ _ s9 _ ($_)%expr _ | @expr.App _ _ _ s9
+ _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s9 _
+ (_ @ _)%expr_pat _ | @expr.App _ _ _ s9 _
(@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end
- | (@expr.Ident _ _ _ t4 idc4 @ #(_))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (#(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
+ | (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (#(_) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
(@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (_ @ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
(@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
(@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.LetIn _ _ _ _ _ _ _)%expr_pat =>
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _ _ _ _)%expr_pat =>
None
| _ => None
end
+ | (@expr.Ident _ _ _ t3 idc3 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t3 idc3 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t3 idc3 @ (_ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t3 idc3 @ @expr.LetIn _ _ _ _ _ _ _)%expr_pat =>
+ None
| _ => None
end
| @expr.App _ _ _ s4 _ ($_)%expr _ | @expr.App _ _ _ s4 _
@@ -1788,30 +2537,6 @@ match idc in (Compilers.ident t) return (Compile.value' true t) with
end
| @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
- (@expr.Ident _ _ _ t0 idc0)) #(_)%expr_pat | @expr.App _ _ _ s _
- (@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
- (@expr.Ident _ _ _ t0 idc0)) ($_)%expr | @expr.App _ _ _ s _
- (@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
- (@expr.Ident _ _ _ t0 idc0)) (@expr.Abs _ _ _ _ _ _) | @expr.App _ _
- _ s _
- (@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
- (@expr.Ident _ _ _ t0 idc0)) (($_)%expr @ _)%expr_pat | @expr.App _
- _ _ s _
- (@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
- (@expr.Ident _ _ _ t0 idc0)) (@expr.Abs _ _ _ _ _ _ @ _)%expr_pat |
- @expr.App _ _ _ s _
- (@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
- (@expr.Ident _ _ _ t0 idc0)) (_ @ _ @ _)%expr_pat | @expr.App _ _ _
- s _
- (@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
- (@expr.Ident _ _ _ t0 idc0))
- (@expr.LetIn _ _ _ _ _ _ _ @ _)%expr_pat | @expr.App _ _ _ s _
- (@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
- (@expr.Ident _ _ _ t0 idc0)) (@expr.LetIn _ _ _ _ _ _ _) | @expr.App
- _ _ _ s _
- (@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
- (@expr.Ident _ _ _ t0 idc0 @ #(_))%expr_pat) _ | @expr.App _ _ _ s _
- (@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
(@expr.Ident _ _ _ t0 idc0 @ ($_)%expr)%expr_pat) _ | @expr.App _ _
_ s _
(@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
@@ -1845,6 +2570,8 @@ match idc in (Compilers.ident t) return (Compile.value' true t) with
(@expr.Ident _ _ _ t0 idc0 @ @expr.LetIn _ _ _ _ _ _ _)%expr_pat)
_ => None
| @expr.App _ _ _ s _
+ (@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc) #(_)%expr_pat) _ |
+ @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc) ($_)%expr) _ |
@expr.App _ _ _ s _
(@expr.App _ _ _ s0 _ (@expr.Ident _ _ _ t idc)
@@ -1866,524 +2593,202 @@ match idc in (Compilers.ident t) return (Compile.value' true t) with
| (@expr.Ident _ _ _ t0 idc0 @
(@expr.Ident _ _ _ t1 idc1 @ x5 @ x4))%expr_pat =>
match x5 with
- | @expr.Ident _ _ _ t2 idc2 =>
+ | (@expr.Ident _ _ _ t2 idc2 @ @expr.Ident _ _ _ t3 idc3)%expr_pat =>
match x4 with
- | @expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t3 idc3) x6 =>
+ | @expr.App _ _ _ s6 _ (@expr.Ident _ _ _ t4 idc4) x7 =>
match x1 with
- | @expr.Ident _ _ _ t4 idc4 =>
+ | @expr.App _ _ _ s7 _ (@expr.Ident _ _ _ t5 idc5)
+ x8 =>
match x0 with
- | @expr.Ident _ _ _ t5 idc5 =>
- args <- invert_bind_args idc5 Raw.ident.Literal;
- args0 <- invert_bind_args idc4
- Raw.ident.Literal;
- args1 <- invert_bind_args idc3 Raw.ident.Z_cast;
- args2 <- invert_bind_args idc2
- Raw.ident.Literal;
- _ <- invert_bind_args idc1 Raw.ident.Z_cc_m;
- args4 <- invert_bind_args idc0 Raw.ident.Z_cast;
- _ <- invert_bind_args idc Raw.ident.Z_zselect;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s5) -> (projT1 args0)) ->
- (projT1 args))%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s5) ->
- (projT1 args0)) -> (projT1 args))%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args2);
- v <- type.try_make_transport_cps s5 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- xv1 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x7 <- (if
- ((let (x7, _) := xv in x7) =?
- 2
- ^ Z.log2
- (let (x7, _) := xv in
- x7)) &&
- ((ZRange.cc_m
- (let (x7, _) := xv in
- x7))
- (ZRange.normalize args1) <=?
- ZRange.normalize args4)%zrange
- then
- Some
- (#(Z_cast range)%expr @
- (#(fancy_selm
- (Z.log2
- (let (x7, _) :=
- xv in
- x7)))%expr @
- (#(Z_cast args1)%expr @
- v (Compile.reflect x6),
- (##(let (x7, _) :=
- xv0 in
- x7))%expr,
- (##(let (x7, _) :=
- xv1 in
- x7))%expr)))%expr_pat
- else None);
- Some (Base x7));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s6 _ (@expr.Ident _ _ _ t5 idc5)
- x7 =>
- args <- invert_bind_args idc5 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc4
- Raw.ident.Literal;
- args1 <- invert_bind_args idc3 Raw.ident.Z_cast;
- args2 <- invert_bind_args idc2
- Raw.ident.Literal;
- _ <- invert_bind_args idc1 Raw.ident.Z_cc_m;
- args4 <- invert_bind_args idc0 Raw.ident.Z_cast;
- _ <- invert_bind_args idc Raw.ident.Z_zselect;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s5) -> (projT1 args0)) ->
- s6)%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s5) ->
- (projT1 args0)) -> s6)%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args2);
- v <- type.try_make_transport_cps s5 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- v0 <- type.try_make_transport_cps s6 ℤ;
- fv <- (x8 <- (if
- ((let (x8, _) := xv in x8) =?
- 2
- ^ Z.log2
- (let (x8, _) := xv in
- x8)) &&
- ((ZRange.cc_m
- (let (x8, _) := xv in
- x8))
- (ZRange.normalize args1) <=?
- ZRange.normalize args4)%zrange
- then
- Some
- (#(Z_cast range)%expr @
- (#(fancy_selm
- (Z.log2
- (let (x8, _) :=
- xv in
- x8)))%expr @
- (#(Z_cast args1)%expr @
- v (Compile.reflect x6),
- (##(let (x8, _) :=
- xv0 in
- x8))%expr,
- #(Z_cast args)%expr @
- v0 (Compile.reflect x7))))%expr_pat
- else None);
- Some (Base x8));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s6 _ ($_)%expr _ | @expr.App _ _
- _ s6 _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _
- _ s6 _ (_ @ _)%expr_pat _ | @expr.App _ _ _ s6 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | @expr.App _ _ _ s6 _ (@expr.Ident _ _ _ t4 idc4)
- x7 =>
- match x0 with
- | @expr.Ident _ _ _ t5 idc5 =>
- args <- invert_bind_args idc5 Raw.ident.Literal;
- args0 <- invert_bind_args idc4 Raw.ident.Z_cast;
- args1 <- invert_bind_args idc3 Raw.ident.Z_cast;
- args2 <- invert_bind_args idc2
- Raw.ident.Literal;
- _ <- invert_bind_args idc1 Raw.ident.Z_cc_m;
- args4 <- invert_bind_args idc0 Raw.ident.Z_cast;
- _ <- invert_bind_args idc Raw.ident.Z_zselect;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s5) -> s6) ->
- (projT1 args))%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s5) -> s6) ->
- (projT1 args))%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args2);
- v <- type.try_make_transport_cps s5 ℤ;
- v0 <- type.try_make_transport_cps s6 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x8 <- (if
- ((let (x8, _) := xv in x8) =?
- 2
- ^ Z.log2
- (let (x8, _) := xv in
- x8)) &&
- ((ZRange.cc_m
- (let (x8, _) := xv in
- x8))
- (ZRange.normalize args1) <=?
- ZRange.normalize args4)%zrange
- then
- Some
- (#(Z_cast range)%expr @
- (#(fancy_selm
- (Z.log2
- (let (x8, _) :=
- xv in
- x8)))%expr @
- (#(Z_cast args1)%expr @
- v (Compile.reflect x6),
- #(Z_cast args0)%expr @
- v0 (Compile.reflect x7),
- (##(let (x8, _) :=
- xv0 in
- x8))%expr)))%expr_pat
- else None);
- Some (Base x8));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s7 _ (@expr.Ident _ _ _ t5 idc5)
- x8 =>
- args <- invert_bind_args idc5 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc4 Raw.ident.Z_cast;
- args1 <- invert_bind_args idc3 Raw.ident.Z_cast;
- args2 <- invert_bind_args idc2
+ | @expr.App _ _ _ s8 _ (@expr.Ident _ _ _ t6 idc6)
+ x9 =>
+ args <- invert_bind_args idc6 Raw.ident.Z_cast;
+ args0 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc4 Raw.ident.Z_cast;
+ args2 <- invert_bind_args idc3
Raw.ident.Literal;
+ args3 <- invert_bind_args idc2 Raw.ident.Z_cast;
_ <- invert_bind_args idc1 Raw.ident.Z_cc_m;
- args4 <- invert_bind_args idc0 Raw.ident.Z_cast;
+ args5 <- invert_bind_args idc0 Raw.ident.Z_cast;
_ <- invert_bind_args idc Raw.ident.Z_zselect;
match
pattern.type.unify_extracted
(((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s5) -> s6) -> s7)%ptype
+ ((((projT1 args2) -> s6) -> s7) -> s8)%ptype
with
| Some (_, _, _, _)%zrange =>
if
type.type_beq base.type base.type.type_beq
(((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s5) -> s6) -> s7)%ptype
+ ((((projT1 args2) -> s6) -> s7) -> s8)%ptype
then
xv <- ident.unify pattern.ident.Literal
##(projT2 args2);
- v <- type.try_make_transport_cps s5 ℤ;
- v0 <- type.try_make_transport_cps s6 ℤ;
- v1 <- type.try_make_transport_cps s7 ℤ;
- fv <- (x9 <- (if
- ((let (x9, _) := xv in x9) =?
- 2
- ^ Z.log2
- (let (x9, _) := xv in
- x9)) &&
- ((ZRange.cc_m
- (let (x9, _) := xv in
- x9))
- (ZRange.normalize args1) <=?
- ZRange.normalize args4)%zrange
- then
- Some
- (#(Z_cast range)%expr @
- (#(fancy_selm
- (Z.log2
- (let (x9, _) :=
- xv in
- x9)))%expr @
- (#(Z_cast args1)%expr @
- v (Compile.reflect x6),
- #(Z_cast args0)%expr @
- v0 (Compile.reflect x7),
- #(Z_cast args)%expr @
- v1 (Compile.reflect x8))))%expr_pat
- else None);
- Some (Base x9));
+ v <- type.try_make_transport_cps s6 ℤ;
+ v0 <- type.try_make_transport_cps s7 ℤ;
+ v1 <- type.try_make_transport_cps s8 ℤ;
+ fv <- (x10 <- (if
+ ((let (x10, _) := xv in
+ x10) =?
+ 2
+ ^ Z.log2
+ (let (x10, _) :=
+ xv in
+ x10)) &&
+ ((ZRange.cc_m
+ (let (x10, _) := xv in
+ x10))
+ (ZRange.normalize args1) <=?
+ ZRange.normalize args5)%zrange &&
+ is_bounded_by_bool
+ (let (x10, _) := xv in
+ x10)
+ (ZRange.normalize args3)
+ then
+ Some
+ (#(Z_cast range)%expr @
+ (#(fancy_selm
+ (Z.log2
+ (let
+ (x10, _) :=
+ xv in
+ x10)))%expr @
+ (#(Z_cast args1)%expr @
+ v
+ (Compile.reflect x7),
+ #(Z_cast args0)%expr @
+ v0
+ (Compile.reflect x8),
+ #(Z_cast args)%expr @
+ v1
+ (Compile.reflect x9))))%expr_pat
+ else None);
+ Some (Base x10));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end
- | @expr.App _ _ _ s7 _ ($_)%expr _ | @expr.App _ _
- _ s7 _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _
- _ s7 _ (_ @ _)%expr_pat _ | @expr.App _ _ _ s7 _
+ | @expr.App _ _ _ s8 _ ($_)%expr _ | @expr.App _ _
+ _ s8 _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _
+ _ s8 _ (_ @ _)%expr_pat _ | @expr.App _ _ _ s8 _
(@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end
- | @expr.App _ _ _ s6 _ ($_)%expr _ | @expr.App _ _ _ s6
- _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s6 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s6 _
+ | @expr.App _ _ _ s7 _ ($_)%expr _ | @expr.App _ _ _ s7
+ _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s7 _
+ (_ @ _)%expr_pat _ | @expr.App _ _ _ s7 _
(@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end
- | @expr.App _ _ _ s5 _ ($_)%expr _ | @expr.App _ _ _ s5 _
- (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s5 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s5 _
+ | @expr.App _ _ _ s6 _ ($_)%expr _ | @expr.App _ _ _ s6 _
+ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s6 _
+ (_ @ _)%expr_pat _ | @expr.App _ _ _ s6 _
(@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end
+ | (@expr.Ident _ _ _ t2 idc2 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t2 idc2 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t2 idc2 @ (_ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t2 idc2 @ @expr.LetIn _ _ _ _ _ _ _)%expr_pat =>
+ None
| _ => None
end;;
match x5 with
- | @expr.Ident _ _ _ t2 idc2 =>
- match x4 with
- | @expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t3 idc3) x6 =>
- match x1 with
- | @expr.Ident _ _ _ t4 idc4 =>
- match x0 with
- | @expr.Ident _ _ _ t5 idc5 =>
- args <- invert_bind_args idc5 Raw.ident.Literal;
- args0 <- invert_bind_args idc4
- Raw.ident.Literal;
- args1 <- invert_bind_args idc3 Raw.ident.Z_cast;
- args2 <- invert_bind_args idc2
- Raw.ident.Literal;
- _ <- invert_bind_args idc1 Raw.ident.Z_land;
- args4 <- invert_bind_args idc0 Raw.ident.Z_cast;
- _ <- invert_bind_args idc Raw.ident.Z_zselect;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s5) -> (projT1 args0)) ->
- (projT1 args))%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s5) ->
- (projT1 args0)) -> (projT1 args))%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args2);
- v <- type.try_make_transport_cps s5 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- xv1 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x7 <- (if
- ((let (x7, _) := xv in x7) =?
- 1) &&
- (ZRange.normalize
- (ZRange.constant
- (let (x7, _) := xv in
- x7)) &'
- ZRange.normalize args1 <=?
- ZRange.normalize args4)%zrange
- then
- Some
- (#(Z_cast range)%expr @
- (#(fancy_sell)%expr @
- (#(Z_cast args1)%expr @
- v (Compile.reflect x6),
- (##(let (x7, _) :=
- xv0 in
- x7))%expr,
- (##(let (x7, _) :=
- xv1 in
- x7))%expr)))%expr_pat
- else None);
- Some (Base x7));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s6 _ (@expr.Ident _ _ _ t5 idc5)
- x7 =>
- args <- invert_bind_args idc5 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc4
- Raw.ident.Literal;
- args1 <- invert_bind_args idc3 Raw.ident.Z_cast;
- args2 <- invert_bind_args idc2
- Raw.ident.Literal;
- _ <- invert_bind_args idc1 Raw.ident.Z_land;
- args4 <- invert_bind_args idc0 Raw.ident.Z_cast;
- _ <- invert_bind_args idc Raw.ident.Z_zselect;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s5) -> (projT1 args0)) ->
- s6)%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s5) ->
- (projT1 args0)) -> s6)%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args2);
- v <- type.try_make_transport_cps s5 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- v0 <- type.try_make_transport_cps s6 ℤ;
- fv <- (x8 <- (if
- ((let (x8, _) := xv in x8) =?
- 1) &&
- (ZRange.normalize
- (ZRange.constant
- (let (x8, _) := xv in
- x8)) &'
- ZRange.normalize args1 <=?
- ZRange.normalize args4)%zrange
- then
- Some
- (#(Z_cast range)%expr @
- (#(fancy_sell)%expr @
- (#(Z_cast args1)%expr @
- v (Compile.reflect x6),
- (##(let (x8, _) :=
- xv0 in
- x8))%expr,
- #(Z_cast args)%expr @
- v0 (Compile.reflect x7))))%expr_pat
- else None);
- Some (Base x8));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s6 _ ($_)%expr _ | @expr.App _ _
- _ s6 _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _
- _ s6 _ (_ @ _)%expr_pat _ | @expr.App _ _ _ s6 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
+ | @expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t2 idc2) x6 =>
+ match x6 with
+ | @expr.Ident _ _ _ t3 idc3 =>
+ match x4 with
| @expr.App _ _ _ s6 _ (@expr.Ident _ _ _ t4 idc4)
x7 =>
- match x0 with
- | @expr.Ident _ _ _ t5 idc5 =>
- args <- invert_bind_args idc5 Raw.ident.Literal;
- args0 <- invert_bind_args idc4 Raw.ident.Z_cast;
- args1 <- invert_bind_args idc3 Raw.ident.Z_cast;
- args2 <- invert_bind_args idc2
- Raw.ident.Literal;
- _ <- invert_bind_args idc1 Raw.ident.Z_land;
- args4 <- invert_bind_args idc0 Raw.ident.Z_cast;
- _ <- invert_bind_args idc Raw.ident.Z_zselect;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s5) -> s6) ->
- (projT1 args))%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s5) -> s6) ->
- (projT1 args))%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args2);
- v <- type.try_make_transport_cps s5 ℤ;
- v0 <- type.try_make_transport_cps s6 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x8 <- (if
- ((let (x8, _) := xv in x8) =?
- 1) &&
- (ZRange.normalize
- (ZRange.constant
- (let (x8, _) := xv in
- x8)) &'
- ZRange.normalize args1 <=?
- ZRange.normalize args4)%zrange
- then
- Some
- (#(Z_cast range)%expr @
- (#(fancy_sell)%expr @
- (#(Z_cast args1)%expr @
- v (Compile.reflect x6),
- #(Z_cast args0)%expr @
- v0 (Compile.reflect x7),
- (##(let (x8, _) :=
- xv0 in
- x8))%expr)))%expr_pat
- else None);
- Some (Base x8));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
+ match x1 with
| @expr.App _ _ _ s7 _ (@expr.Ident _ _ _ t5 idc5)
x8 =>
- args <- invert_bind_args idc5 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc4 Raw.ident.Z_cast;
- args1 <- invert_bind_args idc3 Raw.ident.Z_cast;
- args2 <- invert_bind_args idc2
- Raw.ident.Literal;
- _ <- invert_bind_args idc1 Raw.ident.Z_land;
- args4 <- invert_bind_args idc0 Raw.ident.Z_cast;
- _ <- invert_bind_args idc Raw.ident.Z_zselect;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s5) -> s6) -> s7)%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s5) -> s6) -> s7)%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args2);
- v <- type.try_make_transport_cps s5 ℤ;
- v0 <- type.try_make_transport_cps s6 ℤ;
- v1 <- type.try_make_transport_cps s7 ℤ;
- fv <- (x9 <- (if
- ((let (x9, _) := xv in x9) =?
- 1) &&
- (ZRange.normalize
- (ZRange.constant
- (let (x9, _) := xv in
- x9)) &'
- ZRange.normalize args1 <=?
- ZRange.normalize args4)%zrange
- then
- Some
- (#(Z_cast range)%expr @
- (#(fancy_sell)%expr @
- (#(Z_cast args1)%expr @
- v (Compile.reflect x6),
- #(Z_cast args0)%expr @
- v0 (Compile.reflect x7),
- #(Z_cast args)%expr @
- v1 (Compile.reflect x8))))%expr_pat
- else None);
- Some (Base x9));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
+ match x0 with
+ | @expr.App _ _ _ s8 _
+ (@expr.Ident _ _ _ t6 idc6) x9 =>
+ args <- invert_bind_args idc6
+ Raw.ident.Z_cast;
+ args0 <- invert_bind_args idc5
+ Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc4
+ Raw.ident.Z_cast;
+ args2 <- invert_bind_args idc3
+ Raw.ident.Literal;
+ args3 <- invert_bind_args idc2
+ Raw.ident.Z_cast;
+ _ <- invert_bind_args idc1 Raw.ident.Z_land;
+ args5 <- invert_bind_args idc0
+ Raw.ident.Z_cast;
+ _ <- invert_bind_args idc
+ Raw.ident.Z_zselect;
+ match
+ pattern.type.unify_extracted
+ (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
+ ((((projT1 args2) -> s6) -> s7) -> s8)%ptype
+ with
+ | Some (_, _, _, _)%zrange =>
+ if
+ type.type_beq base.type
+ base.type.type_beq
+ (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
+ ((((projT1 args2) -> s6) -> s7) ->
+ s8)%ptype
+ then
+ xv <- ident.unify
+ pattern.ident.Literal
+ ##(projT2 args2);
+ v <- type.try_make_transport_cps s6 ℤ;
+ v0 <- type.try_make_transport_cps s7 ℤ;
+ v1 <- type.try_make_transport_cps s8 ℤ;
+ fv <- (x10 <- (if
+ ((let (x10, _) :=
+ xv in
+ x10) =? 1) &&
+ (ZRange.normalize
+ (ZRange.constant
+ (let (x10, _) :=
+ xv in
+ x10)) &'
+ ZRange.normalize
+ args1 <=?
+ ZRange.normalize
+ args5)%zrange &&
+ is_bounded_by_bool
+ (let (x10, _) :=
+ xv in
+ x10)
+ (ZRange.normalize
+ args3)
+ then
+ Some
+ (#(Z_cast range)%expr @
+ (#(fancy_sell)%expr @
+ (#(Z_cast args1)%expr @
+ v
+ (Compile.reflect
+ x7),
+ #(Z_cast args0)%expr @
+ v0
+ (Compile.reflect
+ x8),
+ #(Z_cast args)%expr @
+ v1
+ (Compile.reflect
+ x9))))%expr_pat
+ else None);
+ Some (Base x10));
+ Some (fv0 <-- fv;
+ Base fv0)%under_lets
+ else None
+ | None => None
+ end
+ | @expr.App _ _ _ s8 _ ($_)%expr _ | @expr.App
+ _ _ _ s8 _ (@expr.Abs _ _ _ _ _ _) _ |
+ @expr.App _ _ _ s8 _ (_ @ _)%expr_pat _ |
+ @expr.App _ _ _ s8 _
+ (@expr.LetIn _ _ _ _ _ _ _) _ => None
+ | _ => None
end
| @expr.App _ _ _ s7 _ ($_)%expr _ | @expr.App _ _
_ s7 _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _
@@ -2397,261 +2802,92 @@ match idc in (Compilers.ident t) return (Compile.value' true t) with
(@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end
- | @expr.App _ _ _ s5 _ ($_)%expr _ | @expr.App _ _ _ s5 _
- (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s5 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s5 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
- end
- | @expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t2 idc2) x6 =>
+ end;;
match x4 with
- | @expr.Ident _ _ _ t3 idc3 =>
+ | (@expr.Ident _ _ _ t3 idc3 @ @expr.Ident _ _ _ t4 idc4)%expr_pat =>
match x1 with
- | @expr.Ident _ _ _ t4 idc4 =>
+ | @expr.App _ _ _ s7 _ (@expr.Ident _ _ _ t5 idc5)
+ x8 =>
match x0 with
- | @expr.Ident _ _ _ t5 idc5 =>
- args <- invert_bind_args idc5 Raw.ident.Literal;
- args0 <- invert_bind_args idc4
- Raw.ident.Literal;
- args1 <- invert_bind_args idc3
- Raw.ident.Literal;
- args2 <- invert_bind_args idc2 Raw.ident.Z_cast;
- _ <- invert_bind_args idc1 Raw.ident.Z_land;
- args4 <- invert_bind_args idc0 Raw.ident.Z_cast;
- _ <- invert_bind_args idc Raw.ident.Z_zselect;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- (((s5 -> (projT1 args1)) -> (projT1 args0)) ->
- (projT1 args))%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- (((s5 -> (projT1 args1)) ->
- (projT1 args0)) -> (projT1 args))%ptype
- then
- v <- type.try_make_transport_cps s5 ℤ;
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args1);
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- xv1 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x7 <- (if
- ((let (x7, _) := xv in x7) =?
- 1) &&
- (ZRange.normalize args2 &'
- ZRange.normalize
- (ZRange.constant
- (let (x7, _) := xv in
- x7)) <=?
- ZRange.normalize args4)%zrange
- then
- Some
- (#(Z_cast range)%expr @
- (#(fancy_sell)%expr @
- (#(Z_cast args2)%expr @
- v (Compile.reflect x6),
- (##(let (x7, _) :=
- xv0 in
- x7))%expr,
- (##(let (x7, _) :=
- xv1 in
- x7))%expr)))%expr_pat
- else None);
- Some (Base x7));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s6 _ (@expr.Ident _ _ _ t5 idc5)
- x7 =>
- args <- invert_bind_args idc5 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc4
- Raw.ident.Literal;
- args1 <- invert_bind_args idc3
- Raw.ident.Literal;
- args2 <- invert_bind_args idc2 Raw.ident.Z_cast;
- _ <- invert_bind_args idc1 Raw.ident.Z_land;
- args4 <- invert_bind_args idc0 Raw.ident.Z_cast;
- _ <- invert_bind_args idc Raw.ident.Z_zselect;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- (((s5 -> (projT1 args1)) -> (projT1 args0)) ->
- s6)%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- (((s5 -> (projT1 args1)) ->
- (projT1 args0)) -> s6)%ptype
- then
- v <- type.try_make_transport_cps s5 ℤ;
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args1);
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- v0 <- type.try_make_transport_cps s6 ℤ;
- fv <- (x8 <- (if
- ((let (x8, _) := xv in x8) =?
- 1) &&
- (ZRange.normalize args2 &'
- ZRange.normalize
- (ZRange.constant
- (let (x8, _) := xv in
- x8)) <=?
- ZRange.normalize args4)%zrange
- then
- Some
- (#(Z_cast range)%expr @
- (#(fancy_sell)%expr @
- (#(Z_cast args2)%expr @
- v (Compile.reflect x6),
- (##(let (x8, _) :=
- xv0 in
- x8))%expr,
- #(Z_cast args)%expr @
- v0 (Compile.reflect x7))))%expr_pat
- else None);
- Some (Base x8));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s6 _ ($_)%expr _ | @expr.App _ _
- _ s6 _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _
- _ s6 _ (_ @ _)%expr_pat _ | @expr.App _ _ _ s6 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | @expr.App _ _ _ s6 _ (@expr.Ident _ _ _ t4 idc4)
- x7 =>
- match x0 with
- | @expr.Ident _ _ _ t5 idc5 =>
- args <- invert_bind_args idc5 Raw.ident.Literal;
- args0 <- invert_bind_args idc4 Raw.ident.Z_cast;
- args1 <- invert_bind_args idc3
- Raw.ident.Literal;
- args2 <- invert_bind_args idc2 Raw.ident.Z_cast;
- _ <- invert_bind_args idc1 Raw.ident.Z_land;
- args4 <- invert_bind_args idc0 Raw.ident.Z_cast;
- _ <- invert_bind_args idc Raw.ident.Z_zselect;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- (((s5 -> (projT1 args1)) -> s6) ->
- (projT1 args))%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- (((s5 -> (projT1 args1)) -> s6) ->
- (projT1 args))%ptype
- then
- v <- type.try_make_transport_cps s5 ℤ;
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args1);
- v0 <- type.try_make_transport_cps s6 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x8 <- (if
- ((let (x8, _) := xv in x8) =?
- 1) &&
- (ZRange.normalize args2 &'
- ZRange.normalize
- (ZRange.constant
- (let (x8, _) := xv in
- x8)) <=?
- ZRange.normalize args4)%zrange
- then
- Some
- (#(Z_cast range)%expr @
- (#(fancy_sell)%expr @
- (#(Z_cast args2)%expr @
- v (Compile.reflect x6),
- #(Z_cast args0)%expr @
- v0 (Compile.reflect x7),
- (##(let (x8, _) :=
- xv0 in
- x8))%expr)))%expr_pat
- else None);
- Some (Base x8));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s7 _ (@expr.Ident _ _ _ t5 idc5)
- x8 =>
- args <- invert_bind_args idc5 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc4 Raw.ident.Z_cast;
- args1 <- invert_bind_args idc3
+ | @expr.App _ _ _ s8 _ (@expr.Ident _ _ _ t6 idc6)
+ x9 =>
+ args <- invert_bind_args idc6 Raw.ident.Z_cast;
+ args0 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc4
Raw.ident.Literal;
- args2 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args2 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args3 <- invert_bind_args idc2 Raw.ident.Z_cast;
_ <- invert_bind_args idc1 Raw.ident.Z_land;
- args4 <- invert_bind_args idc0 Raw.ident.Z_cast;
+ args5 <- invert_bind_args idc0 Raw.ident.Z_cast;
_ <- invert_bind_args idc Raw.ident.Z_zselect;
match
pattern.type.unify_extracted
(((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- (((s5 -> (projT1 args1)) -> s6) -> s7)%ptype
+ (((s5 -> (projT1 args1)) -> s7) -> s8)%ptype
with
| Some (_, _, _, _)%zrange =>
if
type.type_beq base.type base.type.type_beq
(((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- (((s5 -> (projT1 args1)) -> s6) -> s7)%ptype
+ (((s5 -> (projT1 args1)) -> s7) -> s8)%ptype
then
v <- type.try_make_transport_cps s5 ℤ;
xv <- ident.unify pattern.ident.Literal
##(projT2 args1);
- v0 <- type.try_make_transport_cps s6 ℤ;
- v1 <- type.try_make_transport_cps s7 ℤ;
- fv <- (x9 <- (if
- ((let (x9, _) := xv in x9) =?
- 1) &&
- (ZRange.normalize args2 &'
- ZRange.normalize
- (ZRange.constant
- (let (x9, _) := xv in
- x9)) <=?
- ZRange.normalize args4)%zrange
- then
- Some
- (#(Z_cast range)%expr @
- (#(fancy_sell)%expr @
- (#(Z_cast args2)%expr @
- v (Compile.reflect x6),
- #(Z_cast args0)%expr @
- v0 (Compile.reflect x7),
- #(Z_cast args)%expr @
- v1 (Compile.reflect x8))))%expr_pat
- else None);
- Some (Base x9));
+ v0 <- type.try_make_transport_cps s7 ℤ;
+ v1 <- type.try_make_transport_cps s8 ℤ;
+ fv <- (x10 <- (if
+ ((let (x10, _) := xv in
+ x10) =? 1) &&
+ (ZRange.normalize args3 &'
+ ZRange.normalize
+ (ZRange.constant
+ (let (x10, _) :=
+ xv in
+ x10)) <=?
+ ZRange.normalize args5)%zrange &&
+ is_bounded_by_bool
+ (let (x10, _) := xv in
+ x10)
+ (ZRange.normalize args2)
+ then
+ Some
+ (#(Z_cast range)%expr @
+ (#(fancy_sell)%expr @
+ (#(Z_cast args3)%expr @
+ v
+ (Compile.reflect x6),
+ #(Z_cast args0)%expr @
+ v0
+ (Compile.reflect x8),
+ #(Z_cast args)%expr @
+ v1
+ (Compile.reflect x9))))%expr_pat
+ else None);
+ Some (Base x10));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end
- | @expr.App _ _ _ s7 _ ($_)%expr _ | @expr.App _ _
- _ s7 _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _
- _ s7 _ (_ @ _)%expr_pat _ | @expr.App _ _ _ s7 _
+ | @expr.App _ _ _ s8 _ ($_)%expr _ | @expr.App _ _
+ _ s8 _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _
+ _ s8 _ (_ @ _)%expr_pat _ | @expr.App _ _ _ s8 _
(@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end
- | @expr.App _ _ _ s6 _ ($_)%expr _ | @expr.App _ _ _ s6
- _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s6 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s6 _
+ | @expr.App _ _ _ s7 _ ($_)%expr _ | @expr.App _ _ _ s7
+ _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s7 _
+ (_ @ _)%expr_pat _ | @expr.App _ _ _ s7 _
(@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end
+ | (@expr.Ident _ _ _ t3 idc3 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t3 idc3 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t3 idc3 @ (_ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t3 idc3 @ @expr.LetIn _ _ _ _ _ _ _)%expr_pat =>
+ None
| _ => None
end
| @expr.App _ _ _ s5 _ ($_)%expr _ | @expr.App _ _ _ s5 _
@@ -2700,43 +2936,51 @@ match idc in (Compilers.ident t) return (Compile.value' true t) with
| @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.Ident _ _ _ t1 idc1))
- (@expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t2 idc2) x4))
- (@expr.Ident _ _ _ t3 idc3) =>
- args <- invert_bind_args idc3 Raw.ident.Literal;
- args0 <- invert_bind_args idc2 Raw.ident.Z_cast;
- args1 <- invert_bind_args idc1 Raw.ident.Literal;
- args2 <- invert_bind_args idc0 Raw.ident.Literal;
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
+ (@expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t3 idc3) x6))
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.Ident _ _ _ t5 idc5)%expr_pat =>
+ args <- invert_bind_args idc5 Raw.ident.Literal;
+ args0 <- invert_bind_args idc4 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args2 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args3 <- invert_bind_args idc1 Raw.ident.Literal;
+ args4 <- invert_bind_args idc0 Raw.ident.Z_cast;
_ <- invert_bind_args idc Raw.ident.Z_rshi;
match
pattern.type.unify_extracted (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> (projT1 args1)) -> s3) -> (projT1 args))%ptype
+ ((((projT1 args3) -> s4) -> s5) -> (projT1 args))%ptype
with
| Some (_, _, _, _)%zrange =>
if
type.type_beq base.type base.type.type_beq
(((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> (projT1 args1)) -> s3) -> (projT1 args))%ptype
+ ((((projT1 args3) -> s4) -> s5) -> (projT1 args))%ptype
then
- xv <- ident.unify pattern.ident.Literal ##(projT2 args2);
- xv0 <- ident.unify pattern.ident.Literal ##(projT2 args1);
- v <- type.try_make_transport_cps s3 ℤ;
- xv1 <- ident.unify pattern.ident.Literal ##(projT2 args);
- fv <- (x5 <- (if
- (let (x5, _) := xv in x5) =?
- 2 ^ Z.log2 (let (x5, _) := xv in x5)
+ xv <- ident.unify pattern.ident.Literal ##(projT2 args3);
+ v <- type.try_make_transport_cps s4 ℤ;
+ v0 <- type.try_make_transport_cps s5 ℤ;
+ xv0 <- ident.unify pattern.ident.Literal ##(projT2 args);
+ fv <- (x8 <- (if
+ ((let (x8, _) := xv in x8) =?
+ 2 ^ Z.log2 (let (x8, _) := xv in x8)) &&
+ is_bounded_by_bool (let (x8, _) := xv in x8)
+ (ZRange.normalize args4) &&
+ is_bounded_by_bool (let (x8, _) := xv0 in x8)
+ (ZRange.normalize args0)
then
Some
(#(Z_cast range)%expr @
(#(fancy_rshi
- (Z.log2 (let (x5, _) := xv in x5))
- (let (x5, _) := xv1 in x5))%expr @
- ((##(let (x5, _) := xv0 in x5))%expr,
- #(Z_cast args0)%expr @
- v (Compile.reflect x4))))%expr_pat
+ (Z.log2 (let (x8, _) := xv in x8))
+ (let (x8, _) := xv0 in x8))%expr @
+ (#(Z_cast args2)%expr @
+ v (Compile.reflect x5),
+ #(Z_cast args1)%expr @
+ v0 (Compile.reflect x6))))%expr_pat
else None);
- Some (Base x5));
+ Some (Base x8));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
@@ -2745,276 +2989,211 @@ match idc in (Compilers.ident t) return (Compile.value' true t) with
| @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.Ident _ _ _ t1 idc1)) (@expr.App _ _ _ s3 _ ($_)%expr _))
- _ | @expr.App _ _ _ s _
- (@expr.App _ _ _ s0 _
- (@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.Ident _ _ _ t1 idc1))
- (@expr.App _ _ _ s3 _ (@expr.Abs _ _ _ _ _ _) _)) _ | @expr.App _ _
- _ s _
- (@expr.App _ _ _ s0 _
- (@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.Ident _ _ _ t1 idc1))
- (@expr.App _ _ _ s3 _ (_ @ _)%expr_pat _)) _ | @expr.App _ _ _ s _
- (@expr.App _ _ _ s0 _
- (@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.Ident _ _ _ t1 idc1))
- (@expr.App _ _ _ s3 _ (@expr.LetIn _ _ _ _ _ _ _) _)) _ => None
- | @expr.App _ _ _ s _
- (@expr.App _ _ _ s0 _
- (@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.Ident _ _ _ t1 idc1)) #(_)%expr_pat) _ | @expr.App _ _ _ s _
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
+ (@expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t3 idc3) x6))
+ (@expr.Ident _ _ _ t4 idc4 @ ($_)%expr)%expr_pat | @expr.App _ _ _ s
+ _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.Ident _ _ _ t1 idc1)) ($_)%expr) _ | @expr.App _ _ _ s _
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
+ (@expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t3 idc3) x6))
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.Ident _ _ _ t1 idc1)) (@expr.Abs _ _ _ _ _ _)) _ | @expr.App
- _ _ _ s _
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
+ (@expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t3 idc3) x6))
+ (@expr.Ident _ _ _ t4 idc4 @ (_ @ _))%expr_pat | @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.Ident _ _ _ t1 idc1)) (@expr.LetIn _ _ _ _ _ _ _)) _ => None
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
+ (@expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t3 idc3) x6))
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.LetIn _ _ _ _ _ _ _)%expr_pat =>
+ None
| @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t1 idc1) x4))
- (@expr.Ident _ _ _ t2 idc2)) (@expr.Ident _ _ _ t3 idc3) =>
- args <- invert_bind_args idc3 Raw.ident.Literal;
- args0 <- invert_bind_args idc2 Raw.ident.Literal;
- args1 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args2 <- invert_bind_args idc0 Raw.ident.Literal;
- _ <- invert_bind_args idc Raw.ident.Z_rshi;
- match
- pattern.type.unify_extracted (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s3) -> (projT1 args0)) -> (projT1 args))%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s3) -> (projT1 args0)) -> (projT1 args))%ptype
- then
- xv <- ident.unify pattern.ident.Literal ##(projT2 args2);
- v <- type.try_make_transport_cps s3 ℤ;
- xv0 <- ident.unify pattern.ident.Literal ##(projT2 args0);
- xv1 <- ident.unify pattern.ident.Literal ##(projT2 args);
- fv <- (x5 <- (if
- (let (x5, _) := xv in x5) =?
- 2 ^ Z.log2 (let (x5, _) := xv in x5)
- then
- Some
- (#(Z_cast range)%expr @
- (#(fancy_rshi
- (Z.log2 (let (x5, _) := xv in x5))
- (let (x5, _) := xv1 in x5))%expr @
- (#(Z_cast args1)%expr @
- v (Compile.reflect x4),
- (##(let (x5, _) := xv0 in x5))%expr)))%expr_pat
- else None);
- Some (Base x5));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s _
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
+ (@expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t3 idc3) x6))
+ #(_)%expr_pat | @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.Ident _ _ _ t1 idc1))
- (@expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t2 idc2) x4)) ($_)%expr |
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
+ (@expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t3 idc3) x6)) ($_)%expr |
@expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.Ident _ _ _ t1 idc1))
- (@expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t2 idc2) x4))
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
+ (@expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t3 idc3) x6))
(@expr.Abs _ _ _ _ _ _) | @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.Ident _ _ _ t1 idc1))
- (@expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t2 idc2) x4))
- (_ @ _)%expr_pat | @expr.App _ _ _ s _
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
+ (@expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t3 idc3) x6))
+ (($_)%expr @ _)%expr_pat | @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.Ident _ _ _ t1 idc1))
- (@expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t2 idc2) x4))
- (@expr.LetIn _ _ _ _ _ _ _) | @expr.App _ _ _ s _
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
+ (@expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t3 idc3) x6))
+ (@expr.Abs _ _ _ _ _ _ @ _)%expr_pat | @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t1 idc1) x4))
- (@expr.Ident _ _ _ t2 idc2)) ($_)%expr | @expr.App _ _ _ s _
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
+ (@expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t3 idc3) x6))
+ (_ @ _ @ _)%expr_pat | @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t1 idc1) x4))
- (@expr.Ident _ _ _ t2 idc2)) (@expr.Abs _ _ _ _ _ _) | @expr.App _ _
- _ s _
- (@expr.App _ _ _ s0 _
- (@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t1 idc1) x4))
- (@expr.Ident _ _ _ t2 idc2)) (_ @ _)%expr_pat | @expr.App _ _ _ s _
- (@expr.App _ _ _ s0 _
- (@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t1 idc1) x4))
- (@expr.Ident _ _ _ t2 idc2)) (@expr.LetIn _ _ _ _ _ _ _) => None
- | @expr.App _ _ _ s _
- (@expr.App _ _ _ s0 _
- (@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t1 idc1) x4))
- (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
- (@expr.Ident _ _ _ t3 idc3) =>
- args <- invert_bind_args idc3 Raw.ident.Literal;
- args0 <- invert_bind_args idc2 Raw.ident.Z_cast;
- args1 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args2 <- invert_bind_args idc0 Raw.ident.Literal;
- _ <- invert_bind_args idc Raw.ident.Z_rshi;
- match
- pattern.type.unify_extracted (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s3) -> s4) -> (projT1 args))%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s3) -> s4) -> (projT1 args))%ptype
- then
- xv <- ident.unify pattern.ident.Literal ##(projT2 args2);
- v <- type.try_make_transport_cps s3 ℤ;
- v0 <- type.try_make_transport_cps s4 ℤ;
- xv0 <- ident.unify pattern.ident.Literal ##(projT2 args);
- fv <- (x6 <- (if
- (let (x6, _) := xv in x6) =?
- 2 ^ Z.log2 (let (x6, _) := xv in x6)
- then
- Some
- (#(Z_cast range)%expr @
- (#(fancy_rshi
- (Z.log2 (let (x6, _) := xv in x6))
- (let (x6, _) := xv0 in x6))%expr @
- (#(Z_cast args1)%expr @
- v (Compile.reflect x4),
- #(Z_cast args0)%expr @
- v0 (Compile.reflect x5))))%expr_pat
- else None);
- Some (Base x6));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s _
- (@expr.App _ _ _ s0 _
- (@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t1 idc1) x4))
- (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5)) ($_)%expr |
- @expr.App _ _ _ s _
- (@expr.App _ _ _ s0 _
- (@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t1 idc1) x4))
- (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
- (@expr.Abs _ _ _ _ _ _) | @expr.App _ _ _ s _
- (@expr.App _ _ _ s0 _
- (@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t1 idc1) x4))
- (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
- (_ @ _)%expr_pat | @expr.App _ _ _ s _
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
+ (@expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t3 idc3) x6))
+ (@expr.LetIn _ _ _ _ _ _ _ @ _)%expr_pat | @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t1 idc1) x4))
- (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
+ (@expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t3 idc3) x6))
(@expr.LetIn _ _ _ _ _ _ _) => None
| @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t1 idc1) x4))
- (@expr.App _ _ _ s4 _ ($_)%expr _)) _ | @expr.App _ _ _ s _
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
+ (@expr.App _ _ _ s5 _ ($_)%expr _)) _ | @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t1 idc1) x4))
- (@expr.App _ _ _ s4 _ (@expr.Abs _ _ _ _ _ _) _)) _ | @expr.App _ _
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
+ (@expr.App _ _ _ s5 _ (@expr.Abs _ _ _ _ _ _) _)) _ | @expr.App _ _
_ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t1 idc1) x4))
- (@expr.App _ _ _ s4 _ (_ @ _)%expr_pat _)) _ | @expr.App _ _ _ s _
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
+ (@expr.App _ _ _ s5 _ (_ @ _)%expr_pat _)) _ | @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t1 idc1) x4))
- (@expr.App _ _ _ s4 _ (@expr.LetIn _ _ _ _ _ _ _) _)) _ => None
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
+ (@expr.App _ _ _ s5 _ (@expr.LetIn _ _ _ _ _ _ _) _)) _ => None
| @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t1 idc1) x4)) ($_)%expr)
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
+ #(_)%expr_pat) _ | @expr.App _ _ _ s _
+ (@expr.App _ _ _ s0 _
+ (@expr.App _ _ _ s1 _
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5)) ($_)%expr)
_ | @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t1 idc1) x4))
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
(@expr.Abs _ _ _ _ _ _)) _ | @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t1 idc1) x4))
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5))
(@expr.LetIn _ _ _ _ _ _ _)) _ => None
| @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.App _ _ _ s3 _ ($_)%expr _)) _) _ | @expr.App _ _ _ s _
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ ($_)%expr _)) _) _ | @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.App _ _ _ s3 _ (@expr.Abs _ _ _ _ _ _) _)) _) _ | @expr.App
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.Abs _ _ _ _ _ _) _)) _) _ | @expr.App
_ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.App _ _ _ s3 _ (_ @ _)%expr_pat _)) _) _ | @expr.App _ _ _ s
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (_ @ _)%expr_pat _)) _) _ | @expr.App _ _ _ s
_
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
- (@expr.App _ _ _ s3 _ (@expr.LetIn _ _ _ _ _ _ _) _)) _) _ => None
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ (@expr.App _ _ _ s4 _ (@expr.LetIn _ _ _ _ _ _ _) _)) _) _ => None
| @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
+ #(_)%expr_pat) _) _ | @expr.App _ _ _ s _
+ (@expr.App _ _ _ s0 _
+ (@expr.App _ _ _ s1 _
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
($_)%expr) _) _ | @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
(@expr.Abs _ _ _ _ _ _)) _) _ | @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
- (@expr.Ident _ _ _ t idc @ @expr.Ident _ _ _ t0 idc0)%expr_pat
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1))%expr_pat
(@expr.LetIn _ _ _ _ _ _ _)) _) _ => None
| @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
+ (@expr.App _ _ _ s1 _
+ (@expr.Ident _ _ _ t idc @ (@expr.Ident _ _ _ t0 idc0 @ ($_)%expr))%expr_pat
+ _) _) _ | @expr.App _ _ _ s _
+ (@expr.App _ _ _ s0 _
+ (@expr.App _ _ _ s1 _
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Abs _ _ _ _ _ _))%expr_pat _)
+ _) _ | @expr.App _ _ _ s _
+ (@expr.App _ _ _ s0 _
+ (@expr.App _ _ _ s1 _
+ (@expr.Ident _ _ _ t idc @ (@expr.Ident _ _ _ t0 idc0 @ (_ @ _)))%expr_pat
+ _) _) _ | @expr.App _ _ _ s _
+ (@expr.App _ _ _ s0 _
+ (@expr.App _ _ _ s1 _
+ (@expr.Ident _ _ _ t idc @
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.LetIn _ _ _ _ _ _ _))%expr_pat
+ _) _) _ => None
+ | @expr.App _ _ _ s _
+ (@expr.App _ _ _ s0 _
+ (@expr.App _ _ _ s1 _ (@expr.Ident _ _ _ t idc @ #(_))%expr_pat _)
+ _) _ | @expr.App _ _ _ s _
+ (@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _ (@expr.Ident _ _ _ t idc @ ($_)%expr)%expr_pat
_) _) _ | @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
@@ -3022,7 +3201,20 @@ match idc in (Compilers.ident t) return (Compile.value' true t) with
(@expr.Ident _ _ _ t idc @ @expr.Abs _ _ _ _ _ _)%expr_pat _) _)
_ | @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
- (@expr.App _ _ _ s1 _ (@expr.Ident _ _ _ t idc @ (_ @ _))%expr_pat
+ (@expr.App _ _ _ s1 _
+ (@expr.Ident _ _ _ t idc @ (($_)%expr @ _))%expr_pat _) _) _ |
+ @expr.App _ _ _ s _
+ (@expr.App _ _ _ s0 _
+ (@expr.App _ _ _ s1 _
+ (@expr.Ident _ _ _ t idc @ (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat _)
+ _) _ | @expr.App _ _ _ s _
+ (@expr.App _ _ _ s0 _
+ (@expr.App _ _ _ s1 _
+ (@expr.Ident _ _ _ t idc @ (_ @ _ @ _))%expr_pat _) _) _ |
+ @expr.App _ _ _ s _
+ (@expr.App _ _ _ s0 _
+ (@expr.App _ _ _ s1 _
+ (@expr.Ident _ _ _ t idc @ (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat
_) _) _ | @expr.App _ _ _ s _
(@expr.App _ _ _ s0 _
(@expr.App _ _ _ s1 _
@@ -3077,700 +3269,65 @@ match idc in (Compilers.ident t) return (Compile.value' true t) with
((match x with
| (@expr.Ident _ _ _ t idc @ x2 @ x1 @ x0)%expr_pat =>
match x2 with
- | @expr.Ident _ _ _ t0 idc0 =>
+ | (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat =>
match x1 with
- | @expr.Ident _ _ _ t1 idc1 =>
- match x0 with
- | @expr.App _ _ _ s2 _ (@expr.Ident _ _ _ t2 idc2) x3 =>
- match x3 with
- | (@expr.Ident _ _ _ t3 idc3 @ x5 @ x4)%expr_pat =>
- match x5 with
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ (@expr.Ident _ _ _ t6 idc6) x9 @ @expr.Ident
- _ _ _ t7 idc7))%expr_pat =>
- match x4 with
- | @expr.Ident _ _ _ t8 idc8 =>
- args <- invert_bind_args idc8
- Raw.ident.Literal;
- args0 <- invert_bind_args idc7
- Raw.ident.Literal;
- args1 <- invert_bind_args idc6
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc5 Raw.ident.Z_land;
- args3 <- invert_bind_args idc4
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc3
- Raw.ident.Z_shiftl;
- args5 <- invert_bind_args idc2
- Raw.ident.Z_cast;
- args6 <- invert_bind_args idc1
- Raw.ident.Literal;
- args7 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_add_get_carry;
- match
- pattern.type.unify_extracted
- ((ℤ -> ℤ) -> (ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args7) -> (projT1 args6)) ->
- (s8 -> (projT1 args0)) ->
- (projT1 args))%ptype
- with
- | Some (_, _, (_, _, _))%zrange =>
- if
- type.type_beq base.type
- base.type.type_beq
- ((ℤ -> ℤ) -> (ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args7) -> (projT1 args6)) ->
- (s8 -> (projT1 args0)) ->
- (projT1 args))%ptype
- then
- xv <- ident.unify
- pattern.ident.Literal
- ##(projT2 args7);
- xv0 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args6);
- v <- type.try_make_transport_cps s8 ℤ;
- xv1 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args0);
- xv2 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args);
- fv <- (x10 <- (let
- '(r1, r2)%zrange :=
- range in
- fun (s9 xx : Z)
- (rshiftl rland
- ry : zrange)
- (y : expr ℤ)
- (mask offset : Z) =>
- if
- (s9 =? 2 ^ Z.log2 s9) &&
- (ZRange.normalize
- rland <<
- ZRange.normalize
- (ZRange.constant
- offset) <=?
- ZRange.normalize
- rshiftl)%zrange &&
- (ZRange.normalize ry &'
- ZRange.normalize
- (ZRange.constant
- mask) <=?
- ZRange.normalize
- rland)%zrange &&
- (ZRange.normalize
- rshiftl <=?
- r[0 ~> s9 - 1])%zrange &&
- (mask =?
- Z.ones
- (Z.log2 s9 -
- offset)) &&
- (0 <=? offset) &&
- (offset <=? Z.log2 s9)
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_add
- (Z.log2 s9)
- offset)%expr @
- ((##xx)%expr,
- #(Z_cast ry)%expr @
- y)))%expr_pat
- else None)
- (let (x10, _) := xv in
- x10)
- (let (x10, _) :=
- xv0 in
- x10) args5 args3
- args1
- (v
- (Compile.reflect x9))
- (let (x10, _) :=
- xv1 in
- x10)
- (let (x10, _) :=
- xv2 in
- x10);
- Some (Base x10));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
- end
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ (@expr.Ident _ _ _ t6 idc6) x9 @ ($_)%expr))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ (@expr.Ident _ _ _ t6 idc6) x9 @ @expr.Abs _
- _ _ _ _ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ (@expr.Ident _ _ _ t6 idc6) x9 @ (_ @ _)))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ (@expr.Ident _ _ _ t6 idc6) x9 @ @expr.LetIn
- _ _ _ _ _ _ _))%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ ($_)%expr _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ (@expr.Abs _ _ _ _ _ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ (_ @ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ (@expr.LetIn _ _ _ _ _ _ _) _ @ _))%expr_pat =>
- None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ #(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _
- _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _
- _ _ _ @ _))%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @ #(_))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.Abs _ _ _ _ _
- _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (#(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (_ @ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.LetIn _ _ _ _
- _ _ _)%expr_pat => None
- | _ => None
- end;;
- match x5 with
- | @expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t4 idc4)
- x6 =>
- match x4 with
- | @expr.Ident _ _ _ t5 idc5 =>
- args <- invert_bind_args idc5
- Raw.ident.Literal;
- args0 <- invert_bind_args idc4
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc3
- Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc2
- Raw.ident.Z_cast;
- args3 <- invert_bind_args idc1
- Raw.ident.Literal;
- args4 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_add_get_carry;
- match
- pattern.type.unify_extracted
- ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- (((projT1 args4) -> (projT1 args3)) ->
- s5 -> (projT1 args))%ptype
- with
- | Some (_, _, (_, _))%zrange =>
- if
- type.type_beq base.type
- base.type.type_beq
- ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- (((projT1 args4) -> (projT1 args3)) ->
- s5 -> (projT1 args))%ptype
- then
- xv <- ident.unify
- pattern.ident.Literal
- ##(projT2 args4);
- xv0 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args3);
- v <- type.try_make_transport_cps s5 ℤ;
- xv1 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args);
- fv <- (x7 <- (let
- '(r1, r2)%zrange :=
- range in
- fun (s6 xx : Z)
- (rshiftr ry : zrange)
- (y : expr ℤ)
- (offset : Z) =>
- if
- (s6 =? 2 ^ Z.log2 s6) &&
- (ZRange.normalize ry >>
- ZRange.normalize
- (ZRange.constant
- offset) <=?
- ZRange.normalize
- rshiftr)%zrange &&
- (ZRange.normalize
- rshiftr <=?
- r[0 ~> s6 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_add
- (Z.log2 s6)
- (- offset))%expr @
- ((##xx)%expr,
- #(Z_cast ry)%expr @
- y)))%expr_pat
- else None)
- (let (x7, _) := xv in
- x7)
- (let (x7, _) := xv0 in
- x7) args2 args0
- (v (Compile.reflect x6))
- (let (x7, _) := xv1 in
- x7);
- Some (Base x7));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
- end
- | @expr.App _ _ _ s5 _ ($_)%expr _ | @expr.App _ _
- _ s5 _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _
- _ s5 _ (_ @ _)%expr_pat _ | @expr.App _ _ _ s5 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | _ => None
- end;;
- args <- invert_bind_args idc2 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc1 Raw.ident.Literal;
- args1 <- invert_bind_args idc0 Raw.ident.Literal;
- _ <- invert_bind_args idc Raw.ident.Z_add_get_carry;
- match
- pattern.type.unify_extracted ((ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args1) -> (projT1 args0)) -> s2)%ptype
- with
- | Some (_, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- ((ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args1) -> (projT1 args0)) -> s2)%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args1);
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- v <- type.try_make_transport_cps s2 ℤ;
- fv <- (x4 <- (let
- '(r1, r2)%zrange := range in
- fun (s3 xx : Z) (ry : zrange)
- (y : expr ℤ) =>
- if
- (s3 =? 2 ^ Z.log2 s3) &&
- (ZRange.normalize ry <=?
- r[0 ~> s3 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_add (Z.log2 s3) 0)%expr @
- ((##xx)%expr,
- #(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x4, _) := xv in x4)
- (let (x4, _) := xv0 in x4) args
- (v (Compile.reflect x3));
- Some (Base x4));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s2 _ ($_)%expr _ | @expr.App _ _ _ s2 _
- (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s2 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s2 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | @expr.App _ _ _ s2 _ (@expr.Ident _ _ _ t1 idc1) x3 =>
+ | @expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t2 idc2) x4 =>
match x0 with
- | @expr.Ident _ _ _ t2 idc2 =>
- match x3 with
- | (@expr.Ident _ _ _ t3 idc3 @ x5 @ x4)%expr_pat =>
- match x5 with
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ (@expr.Ident _ _ _ t6 idc6) x9 @ @expr.Ident
- _ _ _ t7 idc7))%expr_pat =>
- match x4 with
- | @expr.Ident _ _ _ t8 idc8 =>
- args <- invert_bind_args idc8
- Raw.ident.Literal;
- args0 <- invert_bind_args idc7
- Raw.ident.Literal;
- args1 <- invert_bind_args idc6
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc5 Raw.ident.Z_land;
- args3 <- invert_bind_args idc4
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc3
- Raw.ident.Z_shiftl;
- args5 <- invert_bind_args idc2
- Raw.ident.Literal;
- args6 <- invert_bind_args idc1
- Raw.ident.Z_cast;
- args7 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_add_get_carry;
- match
- pattern.type.unify_extracted
- ((ℤ -> (ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- (((projT1 args7) ->
- (s8 -> (projT1 args0)) ->
- (projT1 args)) -> (projT1 args5))%ptype
- with
- | Some (_, (_, _, _), _)%zrange =>
- if
- type.type_beq base.type
- base.type.type_beq
- ((ℤ -> (ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- (((projT1 args7) ->
- (s8 -> (projT1 args0)) ->
- (projT1 args)) -> (projT1 args5))%ptype
- then
- xv <- ident.unify
- pattern.ident.Literal
- ##(projT2 args7);
- v <- type.try_make_transport_cps s8 ℤ;
- xv0 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args0);
- xv1 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args);
- xv2 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args5);
- fv <- (x10 <- (let
- '(r1, r2)%zrange :=
- range in
- fun (s9 : Z)
- (rshiftl rland
- ry : zrange)
- (y : expr ℤ)
- (mask offset xx : Z)
- =>
- if
- (s9 =? 2 ^ Z.log2 s9) &&
- (ZRange.normalize
- rland <<
- ZRange.normalize
- (ZRange.constant
- offset) <=?
- ZRange.normalize
- rshiftl)%zrange &&
- (ZRange.normalize ry &'
- ZRange.normalize
- (ZRange.constant
- mask) <=?
- ZRange.normalize
- rland)%zrange &&
- (ZRange.normalize
- rshiftl <=?
- r[0 ~> s9 - 1])%zrange &&
- (mask =?
- Z.ones
- (Z.log2 s9 -
- offset)) &&
- (0 <=? offset) &&
- (offset <=? Z.log2 s9)
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_add
- (Z.log2 s9)
- offset)%expr @
- ((##xx)%expr,
- #(Z_cast ry)%expr @
- y)))%expr_pat
- else None)
- (let (x10, _) := xv in
- x10) args6 args3
- args1
- (v
- (Compile.reflect x9))
- (let (x10, _) :=
- xv0 in
- x10)
- (let (x10, _) :=
- xv1 in
- x10)
- (let (x10, _) :=
- xv2 in
- x10);
- Some (Base x10));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
- end
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ (@expr.Ident _ _ _ t6 idc6) x9 @ ($_)%expr))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ (@expr.Ident _ _ _ t6 idc6) x9 @ @expr.Abs _
- _ _ _ _ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ (@expr.Ident _ _ _ t6 idc6) x9 @ (_ @ _)))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ (@expr.Ident _ _ _ t6 idc6) x9 @ @expr.LetIn
- _ _ _ _ _ _ _))%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ ($_)%expr _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ (@expr.Abs _ _ _ _ _ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ (_ @ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ (@expr.LetIn _ _ _ _ _ _ _) _ @ _))%expr_pat =>
- None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ #(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _
- _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _
- _ _ _ @ _))%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @ #(_))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.Abs _ _ _ _ _
- _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (#(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (_ @ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.LetIn _ _ _ _
- _ _ _)%expr_pat => None
- | _ => None
- end;;
- match x5 with
- | @expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t4 idc4)
- x6 =>
- match x4 with
- | @expr.Ident _ _ _ t5 idc5 =>
- args <- invert_bind_args idc5
- Raw.ident.Literal;
- args0 <- invert_bind_args idc4
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc3
- Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc2
- Raw.ident.Literal;
- args3 <- invert_bind_args idc1
- Raw.ident.Z_cast;
- args4 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_add_get_carry;
- match
- pattern.type.unify_extracted
- ((ℤ -> ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args4) -> s5 -> (projT1 args)) ->
- (projT1 args2))%ptype
- with
- | Some (_, (_, _), _)%zrange =>
- if
- type.type_beq base.type
- base.type.type_beq
- ((ℤ -> ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args4) ->
- s5 -> (projT1 args)) ->
- (projT1 args2))%ptype
- then
- xv <- ident.unify
- pattern.ident.Literal
- ##(projT2 args4);
- v <- type.try_make_transport_cps s5 ℤ;
- xv0 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args);
- xv1 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args2);
- fv <- (x7 <- (let
- '(r1, r2)%zrange :=
- range in
- fun (s6 : Z)
- (rshiftr ry : zrange)
- (y : expr ℤ)
- (offset xx : Z) =>
- if
- (s6 =? 2 ^ Z.log2 s6) &&
- (ZRange.normalize ry >>
- ZRange.normalize
- (ZRange.constant
- offset) <=?
- ZRange.normalize
- rshiftr)%zrange &&
- (ZRange.normalize
- rshiftr <=?
- r[0 ~> s6 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_add
- (Z.log2 s6)
- (- offset))%expr @
- ((##xx)%expr,
- #(Z_cast ry)%expr @
- y)))%expr_pat
- else None)
- (let (x7, _) := xv in
- x7) args3 args0
- (v (Compile.reflect x6))
- (let (x7, _) := xv0 in
- x7)
- (let (x7, _) := xv1 in
- x7);
- Some (Base x7));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
- end
- | @expr.App _ _ _ s5 _ ($_)%expr _ | @expr.App _ _
- _ s5 _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _
- _ s5 _ (_ @ _)%expr_pat _ | @expr.App _ _ _ s5 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | _ => None
- end;;
- args <- invert_bind_args idc2 Raw.ident.Literal;
- args0 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args1 <- invert_bind_args idc0 Raw.ident.Literal;
- _ <- invert_bind_args idc Raw.ident.Z_add_get_carry;
- match
- pattern.type.unify_extracted ((ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args1) -> s2) -> (projT1 args))%ptype
- with
- | Some (_, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- ((ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args1) -> s2) -> (projT1 args))%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args1);
- v <- type.try_make_transport_cps s2 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x4 <- (let
- '(r1, r2)%zrange := range in
- fun (s3 : Z) (rx : zrange)
- (x4 : expr ℤ) (yy : Z) =>
- if
- (s3 =? 2 ^ Z.log2 s3) &&
- (ZRange.normalize
- (ZRange.constant yy) <=?
- r[0 ~> s3 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_add (Z.log2 s3) 0)%expr @
- (#(Z_cast rx)%expr @ x4,
- (##yy)%expr)))%expr_pat
- else None)
- (let (x4, _) := xv in x4) args0
- (v (Compile.reflect x3))
- (let (x4, _) := xv0 in x4);
- Some (Base x4));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t2 idc2) x4 =>
- match x4 with
- | (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
- (@expr.Ident _ _ _ t6 idc6) x10 @ @expr.Ident _ _
- _ t7 idc7)) @ @expr.Ident _ _ _ t8 idc8)%expr_pat =>
- args <- invert_bind_args idc8 Raw.ident.Literal;
- args0 <- invert_bind_args idc7 Raw.ident.Literal;
- args1 <- invert_bind_args idc6 Raw.ident.Z_cast;
- _ <- invert_bind_args idc5 Raw.ident.Z_land;
- args3 <- invert_bind_args idc4 Raw.ident.Z_cast;
- _ <- invert_bind_args idc3 Raw.ident.Z_shiftl;
- args5 <- invert_bind_args idc2 Raw.ident.Z_cast;
- args6 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args7 <- invert_bind_args idc0 Raw.ident.Literal;
+ | @expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t3 idc3) x5 =>
+ match x5 with
+ | (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @
+ (@expr.Ident _ _ _ t10 idc10 @ @expr.Ident _ _ _ t11
+ idc11))%expr_pat =>
+ args <- invert_bind_args idc11 Raw.ident.Literal;
+ args0 <- invert_bind_args idc10 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc9 Raw.ident.Literal;
+ args2 <- invert_bind_args idc8 Raw.ident.Z_cast;
+ args3 <- invert_bind_args idc7 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc6 Raw.ident.Z_land;
+ args5 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc4 Raw.ident.Z_shiftl;
+ args7 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args8 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args9 <- invert_bind_args idc1 Raw.ident.Literal;
+ args10 <- invert_bind_args idc0 Raw.ident.Z_cast;
_ <- invert_bind_args idc Raw.ident.Z_add_get_carry;
match
pattern.type.unify_extracted
((ℤ -> ℤ) -> (ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args7) -> s2) ->
- (s9 -> (projT1 args0)) -> (projT1 args))%ptype
+ (((projT1 args9) -> s3) ->
+ (s10 -> (projT1 args1)) -> (projT1 args))%ptype
with
| Some (_, _, (_, _, _))%zrange =>
if
type.type_beq base.type base.type.type_beq
((ℤ -> ℤ) -> (ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args7) -> s2) ->
- (s9 -> (projT1 args0)) -> (projT1 args))%ptype
+ (((projT1 args9) -> s3) ->
+ (s10 -> (projT1 args1)) -> (projT1 args))%ptype
then
xv <- ident.unify pattern.ident.Literal
- ##(projT2 args7);
- v <- type.try_make_transport_cps s2 ℤ;
- v0 <- type.try_make_transport_cps s9 ℤ;
+ ##(projT2 args9);
+ v <- type.try_make_transport_cps s3 ℤ;
+ v0 <- type.try_make_transport_cps s10 ℤ;
xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
+ ##(projT2 args1);
xv1 <- ident.unify pattern.ident.Literal
##(projT2 args);
- fv <- (x11 <- (let
+ fv <- (x14 <- (let
'(r1, r2)%zrange := range in
- fun (s10 : Z) (rx : zrange)
- (x11 : expr ℤ)
+ fun (rs : zrange) (s13 : Z)
+ (rx : zrange) (x14 : expr ℤ)
(rshiftl rland ry : zrange)
(y : expr ℤ)
- (mask offset : Z) =>
+ (rmask : zrange) (mask : Z)
+ (roffset : zrange)
+ (offset : Z) =>
if
- (s10 =? 2 ^ Z.log2 s10) &&
+ (s13 =? 2 ^ Z.log2 s13) &&
(ZRange.normalize rland <<
ZRange.normalize
(ZRange.constant offset) <=?
@@ -3780,195 +3337,308 @@ match idc in (Compilers.ident t) return (Compile.value' true t) with
(ZRange.constant mask) <=?
ZRange.normalize rland)%zrange &&
(ZRange.normalize rshiftl <=?
- r[0 ~> s10 - 1])%zrange &&
+ r[0 ~> s13 - 1])%zrange &&
(mask =?
- Z.ones (Z.log2 s10 - offset)) &&
+ Z.ones (Z.log2 s13 - offset)) &&
(0 <=? offset) &&
- (offset <=? Z.log2 s10)
+ (offset <=? Z.log2 s13) &&
+ is_bounded_by_bool s13
+ (ZRange.normalize rs) &&
+ is_bounded_by_bool mask
+ (ZRange.normalize rmask) &&
+ is_bounded_by_bool offset
+ (ZRange.normalize roffset)
then
Some
(#(Z_cast2 (r1, r2))%expr @
- (#(fancy_add (Z.log2 s10)
+ (#(fancy_add (Z.log2 s13)
offset)%expr @
- (#(Z_cast rx)%expr @ x11,
+ (#(Z_cast rx)%expr @ x14,
#(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x11, _) := xv in x11)
- args6 (v (Compile.reflect x3))
- args5 args3 args1
- (v0 (Compile.reflect x10))
- (let (x11, _) := xv0 in x11)
- (let (x11, _) := xv1 in x11);
- Some (Base x11));
+ else None) args10
+ (let (x14, _) := xv in x14)
+ args8 (v (Compile.reflect x4))
+ args7 args5 args3
+ (v0 (Compile.reflect x11))
+ args2
+ (let (x14, _) := xv0 in x14)
+ args0
+ (let (x14, _) := xv1 in x14);
+ Some (Base x14));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end
- | (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
- (@expr.Ident _ _ _ t6 idc6) x10 @ @expr.Ident _ _
- _ t7 idc7)) @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
- (@expr.Ident _ _ _ t6 idc6) x10 @ @expr.Ident _ _
- _ t7 idc7)) @ @expr.Abs _ _ _ _ _ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
- (@expr.Ident _ _ _ t6 idc6) x10 @ @expr.Ident _ _
- _ t7 idc7)) @ (_ @ _))%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
- (@expr.Ident _ _ _ t6 idc6) x10 @ @expr.Ident _ _
- _ t7 idc7)) @ @expr.LetIn _ _ _ _ _ _ _)%expr_pat =>
+ | (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @
+ (@expr.Ident _ _ _ t10 idc10 @ ($_)%expr))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @
+ (@expr.Ident _ _ _ t10 idc10 @ @expr.Abs _ _ _ _ _ _))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @ (@expr.Ident _ _ _ t10 idc10 @ (_ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @
+ (@expr.Ident _ _ _ t10 idc10 @ @expr.LetIn _ _ _ _ _
+ _ _))%expr_pat => None
+ | (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @ #(_))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @ (($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @ (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @ (_ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @ (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @ @expr.LetIn _ _ _ _ _ _ _)%expr_pat =>
None
- | (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
- (@expr.Ident _ _ _ t6 idc6) x10 @ ($_)%expr)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
- (@expr.Ident _ _ _ t6 idc6) x10 @ @expr.Abs _ _ _
+ | (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ ($_)%expr))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Abs _ _ _ _ _ _))) @
+ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ (_ @ _)))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.LetIn _ _ _ _ _
+ _ _))) @ _)%expr_pat => None
+ | (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @ #(_))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @ ($_)%expr)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @ @expr.Abs _ _ _
_ _ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
- (@expr.Ident _ _ _ t6 idc6) x10 @ (_ @ _))) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
- (@expr.Ident _ _ _ t6 idc6) x10 @ @expr.LetIn _ _
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @ (($_)%expr @ _))) @
+ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Abs _ _ _ _ _ _ @ _))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @ (_ @ _ @ _))) @
+ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @ @expr.LetIn _ _
_ _ _ _ _)) @ _)%expr_pat => None
- | (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ | (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
($_)%expr _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
(@expr.Abs _ _ _ _ _ _) _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
(_ @ _) _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
(@expr.LetIn _ _ _ _ _ _ _) _ @ _)) @ _)%expr_pat =>
None
- | (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ #(_) @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _ _ @
+ | (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ #(_) @ _)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr @ _)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _ _ _ _ @
_)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _ _
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _ _ _ _
_ _ @ _)) @ _)%expr_pat => None
- | (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @ #(_)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @ ($_)%expr) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @ @expr.Abs _ _ _ _ _ _) @
+ | (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ #(_)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _ _) @
_)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @ (#(_) @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ (#(_) @ _)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
(@expr.Abs _ _ _ _ _ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _ @ _)) @
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _ @ _)) @
_)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
(@expr.Abs _ _ _ _ _ _ @ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @ (_ @ _ @ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _ @ _)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
(@expr.LetIn _ _ _ _ _ _ _ @ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
(@expr.LetIn _ _ _ _ _ _ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @ @expr.LetIn _ _ _ _ _ _
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _ _ _
_) @ _)%expr_pat => None
- | (@expr.Ident _ _ _ t3 idc3 @ #(_) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ ($_)%expr @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ @expr.Abs _ _ _ _ _ _ @
+ | (@expr.Ident _ _ _ t4 idc4 @ #(_) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ ($_)%expr @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.Abs _ _ _ _ _ _ @
_)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ (($_)%expr @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
+ (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
(@expr.Abs _ _ _ _ _ _ @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ (_ @ _ @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
+ (@expr.Ident _ _ _ t4 idc4 @ (_ @ _ @ _) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
(@expr.LetIn _ _ _ _ _ _ _ @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ @expr.LetIn _ _ _ _ _ _
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.LetIn _ _ _ _ _ _
_ @ _)%expr_pat => None
| _ => None
end;;
- match x3 with
- | (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
- (@expr.Ident _ _ _ t6 idc6) x10 @ @expr.Ident _ _
- _ t7 idc7)) @ @expr.Ident _ _ _ t8 idc8)%expr_pat =>
- args <- invert_bind_args idc8 Raw.ident.Literal;
- args0 <- invert_bind_args idc7 Raw.ident.Literal;
- args1 <- invert_bind_args idc6 Raw.ident.Z_cast;
- _ <- invert_bind_args idc5 Raw.ident.Z_land;
- args3 <- invert_bind_args idc4 Raw.ident.Z_cast;
- _ <- invert_bind_args idc3 Raw.ident.Z_shiftl;
- args5 <- invert_bind_args idc2 Raw.ident.Z_cast;
- args6 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args7 <- invert_bind_args idc0 Raw.ident.Literal;
+ match x4 with
+ | (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @
+ (@expr.Ident _ _ _ t10 idc10 @ @expr.Ident _ _ _ t11
+ idc11))%expr_pat =>
+ args <- invert_bind_args idc11 Raw.ident.Literal;
+ args0 <- invert_bind_args idc10 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc9 Raw.ident.Literal;
+ args2 <- invert_bind_args idc8 Raw.ident.Z_cast;
+ args3 <- invert_bind_args idc7 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc6 Raw.ident.Z_land;
+ args5 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc4 Raw.ident.Z_shiftl;
+ args7 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args8 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args9 <- invert_bind_args idc1 Raw.ident.Literal;
+ args10 <- invert_bind_args idc0 Raw.ident.Z_cast;
_ <- invert_bind_args idc Raw.ident.Z_add_get_carry;
match
pattern.type.unify_extracted
((ℤ -> (ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- (((projT1 args7) ->
- (s9 -> (projT1 args0)) -> (projT1 args)) ->
- s3)%ptype
+ (((projT1 args9) ->
+ (s10 -> (projT1 args1)) -> (projT1 args)) ->
+ s4)%ptype
with
| Some (_, (_, _, _), _)%zrange =>
if
type.type_beq base.type base.type.type_beq
((ℤ -> (ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- (((projT1 args7) ->
- (s9 -> (projT1 args0)) -> (projT1 args)) ->
- s3)%ptype
+ (((projT1 args9) ->
+ (s10 -> (projT1 args1)) -> (projT1 args)) ->
+ s4)%ptype
then
xv <- ident.unify pattern.ident.Literal
- ##(projT2 args7);
- v <- type.try_make_transport_cps s9 ℤ;
+ ##(projT2 args9);
+ v <- type.try_make_transport_cps s10 ℤ;
xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
+ ##(projT2 args1);
xv1 <- ident.unify pattern.ident.Literal
##(projT2 args);
- v0 <- type.try_make_transport_cps s3 ℤ;
- fv <- (x11 <- (let
+ v0 <- type.try_make_transport_cps s4 ℤ;
+ fv <- (x14 <- (let
'(r1, r2)%zrange := range in
- fun (s10 : Z)
+ fun (rs : zrange) (s13 : Z)
(rshiftl rland ry : zrange)
(y : expr ℤ)
- (mask offset : Z)
- (rx : zrange) (x11 : expr ℤ)
- =>
+ (rmask : zrange) (mask : Z)
+ (roffset : zrange)
+ (offset : Z) (rx : zrange)
+ (x14 : expr ℤ) =>
if
- (s10 =? 2 ^ Z.log2 s10) &&
+ (s13 =? 2 ^ Z.log2 s13) &&
(ZRange.normalize rland <<
ZRange.normalize
(ZRange.constant offset) <=?
@@ -3978,418 +3648,607 @@ match idc in (Compilers.ident t) return (Compile.value' true t) with
(ZRange.constant mask) <=?
ZRange.normalize rland)%zrange &&
(ZRange.normalize rshiftl <=?
- r[0 ~> s10 - 1])%zrange &&
+ r[0 ~> s13 - 1])%zrange &&
(mask =?
- Z.ones (Z.log2 s10 - offset)) &&
+ Z.ones (Z.log2 s13 - offset)) &&
(0 <=? offset) &&
- (offset <=? Z.log2 s10)
+ (offset <=? Z.log2 s13) &&
+ is_bounded_by_bool s13
+ (ZRange.normalize rs) &&
+ is_bounded_by_bool mask
+ (ZRange.normalize rmask) &&
+ is_bounded_by_bool offset
+ (ZRange.normalize roffset)
then
Some
(#(Z_cast2 (r1, r2))%expr @
- (#(fancy_add (Z.log2 s10)
+ (#(fancy_add (Z.log2 s13)
offset)%expr @
- (#(Z_cast rx)%expr @ x11,
+ (#(Z_cast rx)%expr @ x14,
#(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x11, _) := xv in x11)
- args6 args3 args1
- (v (Compile.reflect x10))
- (let (x11, _) := xv0 in x11)
- (let (x11, _) := xv1 in x11)
- args5
- (v0 (Compile.reflect x4));
- Some (Base x11));
+ else None) args10
+ (let (x14, _) := xv in x14)
+ args8 args5 args3
+ (v (Compile.reflect x11))
+ args2
+ (let (x14, _) := xv0 in x14)
+ args0
+ (let (x14, _) := xv1 in x14)
+ args7
+ (v0 (Compile.reflect x5));
+ Some (Base x14));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end
- | (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
- (@expr.Ident _ _ _ t6 idc6) x10 @ @expr.Ident _ _
- _ t7 idc7)) @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
- (@expr.Ident _ _ _ t6 idc6) x10 @ @expr.Ident _ _
- _ t7 idc7)) @ @expr.Abs _ _ _ _ _ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
- (@expr.Ident _ _ _ t6 idc6) x10 @ @expr.Ident _ _
- _ t7 idc7)) @ (_ @ _))%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
- (@expr.Ident _ _ _ t6 idc6) x10 @ @expr.Ident _ _
- _ t7 idc7)) @ @expr.LetIn _ _ _ _ _ _ _)%expr_pat =>
+ | (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @
+ (@expr.Ident _ _ _ t10 idc10 @ ($_)%expr))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @
+ (@expr.Ident _ _ _ t10 idc10 @ @expr.Abs _ _ _ _ _ _))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @ (@expr.Ident _ _ _ t10 idc10 @ (_ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @
+ (@expr.Ident _ _ _ t10 idc10 @ @expr.LetIn _ _ _ _ _
+ _ _))%expr_pat => None
+ | (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @ #(_))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @ (($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @ (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @ (_ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @ (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _ t9
+ idc9))) @ @expr.LetIn _ _ _ _ _ _ _)%expr_pat =>
None
- | (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
- (@expr.Ident _ _ _ t6 idc6) x10 @ ($_)%expr)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
- (@expr.Ident _ _ _ t6 idc6) x10 @ @expr.Abs _ _ _
+ | (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ ($_)%expr))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Abs _ _ _ _ _ _))) @
+ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ (_ @ _)))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.LetIn _ _ _ _ _
+ _ _))) @ _)%expr_pat => None
+ | (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @ #(_))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @ ($_)%expr)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @ @expr.Abs _ _ _
_ _ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
- (@expr.Ident _ _ _ t6 idc6) x10 @ (_ @ _))) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
- (@expr.Ident _ _ _ t6 idc6) x10 @ @expr.LetIn _ _
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @ (($_)%expr @ _))) @
+ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Abs _ _ _ _ _ _ @ _))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @ (_ @ _ @ _))) @
+ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
+ (@expr.Ident _ _ _ t7 idc7) x11 @ @expr.LetIn _ _
_ _ _ _ _)) @ _)%expr_pat => None
- | (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ | (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
($_)%expr _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
(@expr.Abs _ _ _ _ _ _) _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
(_ @ _) _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10 _
(@expr.LetIn _ _ _ _ _ _ _) _ @ _)) @ _)%expr_pat =>
None
- | (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ #(_) @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _ _ @
+ | (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ #(_) @ _)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr @ _)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _ _ _ _ @
_)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _ _
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _ _ _ _
_ _ @ _)) @ _)%expr_pat => None
- | (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @ #(_)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @ ($_)%expr) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @ @expr.Abs _ _ _ _ _ _) @
+ | (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ #(_)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _ _) @
_)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @ (#(_) @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ (#(_) @ _)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
(@expr.Abs _ _ _ _ _ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _ @ _)) @
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _ @ _)) @
_)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
(@expr.Abs _ _ _ _ _ _ @ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @ (_ @ _ @ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _ @ _)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
(@expr.LetIn _ _ _ _ _ _ _ @ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
(@expr.LetIn _ _ _ _ _ _ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
- (@expr.Ident _ _ _ t4 idc4 @ @expr.LetIn _ _ _ _ _ _
+ (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _ _ _
_) @ _)%expr_pat => None
- | (@expr.Ident _ _ _ t3 idc3 @ #(_) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ ($_)%expr @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ @expr.Abs _ _ _ _ _ _ @
+ | (@expr.Ident _ _ _ t4 idc4 @ #(_) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ ($_)%expr @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.Abs _ _ _ _ _ _ @
_)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ (($_)%expr @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
+ (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
(@expr.Abs _ _ _ _ _ _ @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ (_ @ _ @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @
+ (@expr.Ident _ _ _ t4 idc4 @ (_ @ _ @ _) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @
(@expr.LetIn _ _ _ _ _ _ _ @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ @expr.LetIn _ _ _ _ _ _
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.LetIn _ _ _ _ _ _
_ @ _)%expr_pat => None
| _ => None
end;;
- match x4 with
- | (@expr.Ident _ _ _ t3 idc3 @ @expr.App _ _ _ s6 _
- (@expr.Ident _ _ _ t4 idc4) x7 @ @expr.Ident _ _ _
- t5 idc5)%expr_pat =>
- args <- invert_bind_args idc5 Raw.ident.Literal;
- args0 <- invert_bind_args idc4 Raw.ident.Z_cast;
- _ <- invert_bind_args idc3 Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc2 Raw.ident.Z_cast;
- args3 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args4 <- invert_bind_args idc0 Raw.ident.Literal;
+ match x5 with
+ | (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.Ident _ _ _ t7
+ idc7))%expr_pat =>
+ args <- invert_bind_args idc7 Raw.ident.Literal;
+ args0 <- invert_bind_args idc6 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc4 Raw.ident.Z_shiftr;
+ args3 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args4 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args5 <- invert_bind_args idc1 Raw.ident.Literal;
+ args6 <- invert_bind_args idc0 Raw.ident.Z_cast;
_ <- invert_bind_args idc Raw.ident.Z_add_get_carry;
match
pattern.type.unify_extracted
((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- (((projT1 args4) -> s2) -> s6 -> (projT1 args))%ptype
+ (((projT1 args5) -> s3) -> s7 -> (projT1 args))%ptype
with
| Some (_, _, (_, _))%zrange =>
if
type.type_beq base.type base.type.type_beq
((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- (((projT1 args4) -> s2) ->
- s6 -> (projT1 args))%ptype
+ (((projT1 args5) -> s3) ->
+ s7 -> (projT1 args))%ptype
then
xv <- ident.unify pattern.ident.Literal
- ##(projT2 args4);
- v <- type.try_make_transport_cps s2 ℤ;
- v0 <- type.try_make_transport_cps s6 ℤ;
+ ##(projT2 args5);
+ v <- type.try_make_transport_cps s3 ℤ;
+ v0 <- type.try_make_transport_cps s7 ℤ;
xv0 <- ident.unify pattern.ident.Literal
##(projT2 args);
- fv <- (x8 <- (let
- '(r1, r2)%zrange := range in
- fun (s7 : Z) (rx : zrange)
- (x8 : expr ℤ)
- (rshiftr ry : zrange)
- (y : expr ℤ) (offset : Z) =>
- if
- (s7 =? 2 ^ Z.log2 s7) &&
- (ZRange.normalize ry >>
- ZRange.normalize
- (ZRange.constant offset) <=?
- ZRange.normalize rshiftr)%zrange &&
- (ZRange.normalize rshiftr <=?
- r[0 ~> s7 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_add (Z.log2 s7)
- (- offset))%expr @
- (#(Z_cast rx)%expr @ x8,
- #(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x8, _) := xv in x8) args3
- (v (Compile.reflect x3)) args2
- args0 (v0 (Compile.reflect x7))
- (let (x8, _) := xv0 in x8);
- Some (Base x8));
+ fv <- (x10 <- (let
+ '(r1, r2)%zrange := range in
+ fun (rs : zrange) (s9 : Z)
+ (rx : zrange) (x10 : expr ℤ)
+ (rshiftr ry : zrange)
+ (y : expr ℤ)
+ (roffset : zrange)
+ (offset : Z) =>
+ if
+ (s9 =? 2 ^ Z.log2 s9) &&
+ (ZRange.normalize ry >>
+ ZRange.normalize
+ (ZRange.constant offset) <=?
+ ZRange.normalize rshiftr)%zrange &&
+ (ZRange.normalize rshiftr <=?
+ r[0 ~> s9 - 1])%zrange &&
+ is_bounded_by_bool s9
+ (ZRange.normalize rs) &&
+ is_bounded_by_bool offset
+ (ZRange.normalize roffset)
+ then
+ Some
+ (#(Z_cast2 (r1, r2))%expr @
+ (#(fancy_add (Z.log2 s9)
+ (- offset))%expr @
+ (#(Z_cast rx)%expr @ x10,
+ #(Z_cast ry)%expr @ y)))%expr_pat
+ else None) args6
+ (let (x10, _) := xv in x10)
+ args4 (v (Compile.reflect x4))
+ args3 args1
+ (v0 (Compile.reflect x8))
+ args0
+ (let (x10, _) := xv0 in x10);
+ Some (Base x10));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end
- | (@expr.Ident _ _ _ t3 idc3 @ @expr.App _ _ _ s6 _
- (@expr.Ident _ _ _ t4 idc4) x7 @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ @expr.App _ _ _ s6 _
- (@expr.Ident _ _ _ t4 idc4) x7 @ @expr.Abs _ _ _ _ _
+ | (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @
+ (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _ _ _ _))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @
+ (@expr.Ident _ _ _ t6 idc6 @ (_ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _ _ _ _ _
+ _))%expr_pat => None
+ | (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @ #(_))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @ @expr.Abs _ _ _ _ _
_)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ @expr.App _ _ _ s6 _
- (@expr.Ident _ _ _ t4 idc4) x7 @ (_ @ _))%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ @expr.App _ _ _ s6 _
- (@expr.Ident _ _ _ t4 idc4) x7 @ @expr.LetIn _ _ _ _
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @ (($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @
+ (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @ (_ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @ @expr.LetIn _ _ _ _
_ _ _)%expr_pat => None
- | (@expr.Ident _ _ _ t3 idc3 @ @expr.App _ _ _ s6 _
+ | (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
($_)%expr _ @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ @expr.App _ _ _ s6 _
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
(@expr.Abs _ _ _ _ _ _) _ @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ @expr.App _ _ _ s6 _
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
(_ @ _) _ @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ @expr.App _ _ _ s6 _
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
(@expr.LetIn _ _ _ _ _ _ _) _ @ _)%expr_pat => None
- | (@expr.Ident _ _ _ t3 idc3 @ #(_) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ ($_)%expr @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ @expr.Abs _ _ _ _ _ _ @
+ | (@expr.Ident _ _ _ t4 idc4 @ #(_) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ ($_)%expr @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.Abs _ _ _ _ _ _ @
_)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ @expr.LetIn _ _ _ _ _ _
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.LetIn _ _ _ _ _ _
_ @ _)%expr_pat => None
| _ => None
end;;
- match x3 with
- | (@expr.Ident _ _ _ t3 idc3 @ @expr.App _ _ _ s6 _
- (@expr.Ident _ _ _ t4 idc4) x7 @ @expr.Ident _ _ _
- t5 idc5)%expr_pat =>
- args <- invert_bind_args idc5 Raw.ident.Literal;
- args0 <- invert_bind_args idc4 Raw.ident.Z_cast;
- _ <- invert_bind_args idc3 Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc2 Raw.ident.Z_cast;
- args3 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args4 <- invert_bind_args idc0 Raw.ident.Literal;
+ match x4 with
+ | (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.Ident _ _ _ t7
+ idc7))%expr_pat =>
+ args <- invert_bind_args idc7 Raw.ident.Literal;
+ args0 <- invert_bind_args idc6 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc5 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc4 Raw.ident.Z_shiftr;
+ args3 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args4 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args5 <- invert_bind_args idc1 Raw.ident.Literal;
+ args6 <- invert_bind_args idc0 Raw.ident.Z_cast;
_ <- invert_bind_args idc Raw.ident.Z_add_get_carry;
match
pattern.type.unify_extracted
((ℤ -> ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args4) -> s6 -> (projT1 args)) -> s3)%ptype
+ (((projT1 args5) -> s7 -> (projT1 args)) -> s4)%ptype
with
| Some (_, (_, _), _)%zrange =>
if
type.type_beq base.type base.type.type_beq
((ℤ -> ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args4) -> s6 -> (projT1 args)) ->
- s3)%ptype
+ (((projT1 args5) -> s7 -> (projT1 args)) ->
+ s4)%ptype
then
xv <- ident.unify pattern.ident.Literal
- ##(projT2 args4);
- v <- type.try_make_transport_cps s6 ℤ;
+ ##(projT2 args5);
+ v <- type.try_make_transport_cps s7 ℤ;
xv0 <- ident.unify pattern.ident.Literal
##(projT2 args);
- v0 <- type.try_make_transport_cps s3 ℤ;
- fv <- (x8 <- (let
- '(r1, r2)%zrange := range in
- fun (s7 : Z)
- (rshiftr ry : zrange)
- (y : expr ℤ) (offset : Z)
- (rx : zrange) (x8 : expr ℤ)
- =>
- if
- (s7 =? 2 ^ Z.log2 s7) &&
- (ZRange.normalize ry >>
- ZRange.normalize
- (ZRange.constant offset) <=?
- ZRange.normalize rshiftr)%zrange &&
- (ZRange.normalize rshiftr <=?
- r[0 ~> s7 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_add (Z.log2 s7)
- (- offset))%expr @
- (#(Z_cast rx)%expr @ x8,
- #(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x8, _) := xv in x8) args3
- args0 (v (Compile.reflect x7))
- (let (x8, _) := xv0 in x8)
- args2 (v0 (Compile.reflect x4));
- Some (Base x8));
+ v0 <- type.try_make_transport_cps s4 ℤ;
+ fv <- (x10 <- (let
+ '(r1, r2)%zrange := range in
+ fun (rs : zrange) (s9 : Z)
+ (rshiftr ry : zrange)
+ (y : expr ℤ)
+ (roffset : zrange)
+ (offset : Z) (rx : zrange)
+ (x10 : expr ℤ) =>
+ if
+ (s9 =? 2 ^ Z.log2 s9) &&
+ (ZRange.normalize ry >>
+ ZRange.normalize
+ (ZRange.constant offset) <=?
+ ZRange.normalize rshiftr)%zrange &&
+ (ZRange.normalize rshiftr <=?
+ r[0 ~> s9 - 1])%zrange &&
+ is_bounded_by_bool s9
+ (ZRange.normalize rs) &&
+ is_bounded_by_bool offset
+ (ZRange.normalize roffset)
+ then
+ Some
+ (#(Z_cast2 (r1, r2))%expr @
+ (#(fancy_add (Z.log2 s9)
+ (- offset))%expr @
+ (#(Z_cast rx)%expr @ x10,
+ #(Z_cast ry)%expr @ y)))%expr_pat
+ else None) args6
+ (let (x10, _) := xv in x10)
+ args4 args1
+ (v (Compile.reflect x8)) args0
+ (let (x10, _) := xv0 in x10)
+ args3
+ (v0 (Compile.reflect x5));
+ Some (Base x10));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end
- | (@expr.Ident _ _ _ t3 idc3 @ @expr.App _ _ _ s6 _
- (@expr.Ident _ _ _ t4 idc4) x7 @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ @expr.App _ _ _ s6 _
- (@expr.Ident _ _ _ t4 idc4) x7 @ @expr.Abs _ _ _ _ _
+ | (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @
+ (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _ _ _ _))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @
+ (@expr.Ident _ _ _ t6 idc6 @ (_ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _ _ _ _ _
+ _))%expr_pat => None
+ | (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @ #(_))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @ @expr.Abs _ _ _ _ _
_)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ @expr.App _ _ _ s6 _
- (@expr.Ident _ _ _ t4 idc4) x7 @ (_ @ _))%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ @expr.App _ _ _ s6 _
- (@expr.Ident _ _ _ t4 idc4) x7 @ @expr.LetIn _ _ _ _
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @ (($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @
+ (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @ (_ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
+ (@expr.Ident _ _ _ t5 idc5) x8 @ @expr.LetIn _ _ _ _
_ _ _)%expr_pat => None
- | (@expr.Ident _ _ _ t3 idc3 @ @expr.App _ _ _ s6 _
+ | (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
($_)%expr _ @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ @expr.App _ _ _ s6 _
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
(@expr.Abs _ _ _ _ _ _) _ @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ @expr.App _ _ _ s6 _
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
(_ @ _) _ @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ @expr.App _ _ _ s6 _
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
(@expr.LetIn _ _ _ _ _ _ _) _ @ _)%expr_pat => None
- | (@expr.Ident _ _ _ t3 idc3 @ #(_) @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ ($_)%expr @ _)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ @expr.Abs _ _ _ _ _ _ @
+ | (@expr.Ident _ _ _ t4 idc4 @ #(_) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ ($_)%expr @ _)%expr_pat |
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.Abs _ _ _ _ _ _ @
_)%expr_pat |
- (@expr.Ident _ _ _ t3 idc3 @ @expr.LetIn _ _ _ _ _ _
+ (@expr.Ident _ _ _ t4 idc4 @ @expr.LetIn _ _ _ _ _ _
_ @ _)%expr_pat => None
| _ => None
end;;
- args <- invert_bind_args idc2 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args1 <- invert_bind_args idc0 Raw.ident.Literal;
+ args <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args0 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc1 Raw.ident.Literal;
+ args2 <- invert_bind_args idc0 Raw.ident.Z_cast;
_ <- invert_bind_args idc Raw.ident.Z_add_get_carry;
match
pattern.type.unify_extracted ((ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args1) -> s2) -> s3)%ptype
+ (((projT1 args1) -> s3) -> s4)%ptype
with
| Some (_, _, _)%zrange =>
if
type.type_beq base.type base.type.type_beq
((ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args1) -> s2) -> s3)%ptype
+ (((projT1 args1) -> s3) -> s4)%ptype
then
xv <- ident.unify pattern.ident.Literal
##(projT2 args1);
- v <- type.try_make_transport_cps s2 ℤ;
- v0 <- type.try_make_transport_cps s3 ℤ;
- fv <- (x5 <- (let
+ v <- type.try_make_transport_cps s3 ℤ;
+ v0 <- type.try_make_transport_cps s4 ℤ;
+ fv <- (x6 <- (let
'(r1, r2)%zrange := range in
- fun (s4 : Z) (rx : zrange)
- (x5 : expr ℤ) (ry : zrange)
- (y : expr ℤ) =>
+ fun (rs : zrange) (s5 : Z)
+ (rx : zrange) (x6 : expr ℤ)
+ (ry : zrange) (y : expr ℤ) =>
if
- (s4 =? 2 ^ Z.log2 s4) &&
+ (s5 =? 2 ^ Z.log2 s5) &&
(ZRange.normalize ry <=?
- r[0 ~> s4 - 1])%zrange
+ r[0 ~> s5 - 1])%zrange &&
+ is_bounded_by_bool s5
+ (ZRange.normalize rs)
then
Some
(#(Z_cast2 (r1, r2))%expr @
- (#(fancy_add (Z.log2 s4) 0)%expr @
- (#(Z_cast rx)%expr @ x5,
+ (#(fancy_add (Z.log2 s5) 0)%expr @
+ (#(Z_cast rx)%expr @ x6,
#(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x5, _) := xv in x5) args0
- (v (Compile.reflect x3)) args
- (v0 (Compile.reflect x4));
- Some (Base x5));
+ else None) args2
+ (let (x6, _) := xv in x6) args0
+ (v (Compile.reflect x4)) args
+ (v0 (Compile.reflect x5));
+ Some (Base x6));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end
- | @expr.App _ _ _ s3 _ ($_)%expr _ | @expr.App _ _ _ s3 _
- (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s3 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s3 _
+ | @expr.App _ _ _ s4 _ ($_)%expr _ | @expr.App _ _ _ s4 _
+ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s4 _
+ (_ @ _)%expr_pat _ | @expr.App _ _ _ s4 _
(@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end
- | @expr.App _ _ _ s2 _ ($_)%expr _ | @expr.App _ _ _ s2 _
- (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s2 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s2 _
+ | @expr.App _ _ _ s3 _ ($_)%expr _ | @expr.App _ _ _ s3 _
+ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s3 _
+ (_ @ _)%expr_pat _ | @expr.App _ _ _ s3 _
(@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end
+ | (@expr.Ident _ _ _ t0 idc0 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t0 idc0 @ (_ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.LetIn _ _ _ _ _ _ _)%expr_pat =>
+ None
| _ => None
end;;
match x2 with
- | @expr.Ident _ _ _ t0 idc0 =>
+ | (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat =>
match x1 with
- | @expr.Ident _ _ _ t1 idc1 =>
+ | @expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t2 idc2) x4 =>
match x0 with
- | @expr.App _ _ _ s2 _ (@expr.Ident _ _ _ t2 idc2) x3 =>
- match x3 with
- | (@expr.Ident _ _ _ t3 idc3 @ x5 @ x4)%expr_pat =>
- match x5 with
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ (@expr.Ident _ _ _ t6 idc6) x9 @ @expr.Ident
- _ _ _ t7 idc7))%expr_pat =>
- match x4 with
- | @expr.Ident _ _ _ t8 idc8 =>
- args <- invert_bind_args idc8
+ | @expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t3 idc3) x5 =>
+ match x5 with
+ | (@expr.Ident _ _ _ t4 idc4 @ x7 @ x6)%expr_pat =>
+ match x7 with
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10
+ _ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Ident _ _ _
+ t9 idc9)))%expr_pat =>
+ match x6 with
+ | (@expr.Ident _ _ _ t10 idc10 @ @expr.Ident _
+ _ _ t11 idc11)%expr_pat =>
+ args <- invert_bind_args idc11
Raw.ident.Literal;
- args0 <- invert_bind_args idc7
+ args0 <- invert_bind_args idc10
+ Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc9
Raw.ident.Literal;
- args1 <- invert_bind_args idc6
+ args2 <- invert_bind_args idc8
+ Raw.ident.Z_cast;
+ args3 <- invert_bind_args idc7
Raw.ident.Z_cast;
- _ <- invert_bind_args idc5 Raw.ident.Z_land;
- args3 <- invert_bind_args idc4
+ _ <- invert_bind_args idc6 Raw.ident.Z_land;
+ args5 <- invert_bind_args idc5
Raw.ident.Z_cast;
- _ <- invert_bind_args idc3
+ _ <- invert_bind_args idc4
Raw.ident.Z_shiftl;
- args5 <- invert_bind_args idc2
+ args7 <- invert_bind_args idc3
Raw.ident.Z_cast;
- args6 <- invert_bind_args idc1
- Raw.ident.Literal;
- args7 <- invert_bind_args idc0
+ args8 <- invert_bind_args idc2
+ Raw.ident.Z_cast;
+ args9 <- invert_bind_args idc1
Raw.ident.Literal;
+ args10 <- invert_bind_args idc0
+ Raw.ident.Z_cast;
_ <- invert_bind_args idc
Raw.ident.Z_sub_get_borrow;
match
pattern.type.unify_extracted
((ℤ -> ℤ) -> (ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args7) -> (projT1 args6)) ->
- (s8 -> (projT1 args0)) ->
+ (((projT1 args9) -> s3) ->
+ (s10 -> (projT1 args1)) ->
(projT1 args))%ptype
with
| Some (_, _, (_, _, _))%zrange =>
@@ -4397,33 +4256,38 @@ match idc in (Compilers.ident t) return (Compile.value' true t) with
type.type_beq base.type
base.type.type_beq
((ℤ -> ℤ) -> (ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args7) -> (projT1 args6)) ->
- (s8 -> (projT1 args0)) ->
+ (((projT1 args9) -> s3) ->
+ (s10 -> (projT1 args1)) ->
(projT1 args))%ptype
then
xv <- ident.unify
pattern.ident.Literal
- ##(projT2 args7);
+ ##(projT2 args9);
+ v <- type.try_make_transport_cps s3 ℤ;
+ v0 <- type.try_make_transport_cps s10 ℤ;
xv0 <- ident.unify
pattern.ident.Literal
- ##(projT2 args6);
- v <- type.try_make_transport_cps s8 ℤ;
+ ##(projT2 args1);
xv1 <- ident.unify
pattern.ident.Literal
- ##(projT2 args0);
- xv2 <- ident.unify
- pattern.ident.Literal
##(projT2 args);
- fv <- (x10 <- (let
+ fv <- (x14 <- (let
'(r1, r2)%zrange :=
range in
- fun (s9 xx : Z)
+ fun (rs : zrange)
+ (s13 : Z)
+ (rx : zrange)
+ (x14 : expr ℤ)
(rshiftl rland
ry : zrange)
(y : expr ℤ)
- (mask offset : Z) =>
+ (rmask : zrange)
+ (mask : Z)
+ (roffset : zrange)
+ (offset : Z) =>
if
- (s9 =? 2 ^ Z.log2 s9) &&
+ (s13 =?
+ 2 ^ Z.log2 s13) &&
(ZRange.normalize
rland <<
ZRange.normalize
@@ -4433,7 +4297,7 @@ match idc in (Compilers.ident t) return (Compile.value' true t) with
rshiftl)%zrange &&
(ZRange.normalize
rshiftl <=?
- r[0 ~> s9 - 1])%zrange &&
+ r[0 ~> s13 - 1])%zrange &&
(ZRange.normalize ry &'
ZRange.normalize
(ZRange.constant
@@ -4442,2988 +4306,416 @@ match idc in (Compilers.ident t) return (Compile.value' true t) with
rland)%zrange &&
(mask =?
Z.ones
- (Z.log2 s9 -
+ (Z.log2 s13 -
offset)) &&
(0 <=? offset) &&
- (offset <=? Z.log2 s9)
+ (offset <=?
+ Z.log2 s13) &&
+ is_bounded_by_bool
+ s13
+ (ZRange.normalize
+ rs) &&
+ is_bounded_by_bool
+ mask
+ (ZRange.normalize
+ rmask) &&
+ is_bounded_by_bool
+ offset
+ (ZRange.normalize
+ roffset)
then
Some
(#(Z_cast2 (r1, r2))%expr @
(#(fancy_sub
- (Z.log2 s9)
+ (Z.log2 s13)
offset)%expr @
- ((##xx)%expr,
+ (#(Z_cast rx)%expr @
+ x14,
#(Z_cast ry)%expr @
y)))%expr_pat
- else None)
- (let (x10, _) := xv in
- x10)
- (let (x10, _) :=
- xv0 in
- x10) args5 args3
- args1
+ else None) args10
+ (let (x14, _) := xv in
+ x14) args8
(v
- (Compile.reflect x9))
- (let (x10, _) :=
+ (Compile.reflect x4))
+ args7 args5 args3
+ (v0
+ (Compile.reflect
+ x11)) args2
+ (let (x14, _) :=
+ xv0 in
+ x14) args0
+ (let (x14, _) :=
xv1 in
- x10)
- (let (x10, _) :=
- xv2 in
- x10);
- Some (Base x10));
+ x14);
+ Some (Base x14));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end
+ | (@expr.Ident _ _ _ t10 idc10 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t10 idc10 @ @expr.Abs _ _
+ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t10 idc10 @ (_ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t10 idc10 @ @expr.LetIn _
+ _ _ _ _ _ _)%expr_pat => None
| _ => None
end
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ (@expr.Ident _ _ _ t6 idc6) x9 @ ($_)%expr))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ (@expr.Ident _ _ _ t6 idc6) x9 @ @expr.Abs _
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10
+ _ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ ($_)%expr)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10
+ _ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.Abs _ _ _ _
+ _ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10
+ _ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ (_ @ _))))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10
+ _ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Ident _ _ _ t8 idc8 @ @expr.LetIn _ _ _
+ _ _ _ _)))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10
+ _ (@expr.Ident _ _ _ t7 idc7) x11 @ #(_)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10
+ _ (@expr.Ident _ _ _ t7 idc7) x11 @ ($_)%expr))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10
+ _ (@expr.Ident _ _ _ t7 idc7) x11 @ @expr.Abs _
_ _ _ _ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ (@expr.Ident _ _ _ t6 idc6) x9 @ (_ @ _)))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
- _ (@expr.Ident _ _ _ t6 idc6) x9 @ @expr.LetIn
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10
+ _ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (($_)%expr @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10
+ _ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.Abs _ _ _ _ _ _ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10
+ _ (@expr.Ident _ _ _ t7 idc7) x11 @ (_ @ _ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10
+ _ (@expr.Ident _ _ _ t7 idc7) x11 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10
+ _ (@expr.Ident _ _ _ t7 idc7) x11 @ @expr.LetIn
_ _ _ _ _ _ _))%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10
_ ($_)%expr _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10
_ (@expr.Abs _ _ _ _ _ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10
_ (_ @ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s8
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _ s10
_ (@expr.LetIn _ _ _ _ _ _ _) _ @ _))%expr_pat =>
None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ #(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ #(_) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _ _ _
_ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _ _ _
_ _ _ @ _))%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @ #(_))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.Abs _ _ _ _ _
+ | (@expr.Ident _ _ _ t5 idc5 @ #(_))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _
_)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (#(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ (#(_) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
(@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
(@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (_ @ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
(@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @
(@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.LetIn _ _ _ _
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _
_ _ _)%expr_pat => None
| _ => None
end;;
- match x5 with
- | @expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t4 idc4)
- x6 =>
- match x4 with
- | @expr.Ident _ _ _ t5 idc5 =>
- args <- invert_bind_args idc5
+ match x7 with
+ | @expr.App _ _ _ s7 _ (@expr.Ident _ _ _ t5 idc5)
+ x8 =>
+ match x6 with
+ | (@expr.Ident _ _ _ t6 idc6 @ @expr.Ident _ _
+ _ t7 idc7)%expr_pat =>
+ args <- invert_bind_args idc7
Raw.ident.Literal;
- args0 <- invert_bind_args idc4
+ args0 <- invert_bind_args idc6
+ Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc5
Raw.ident.Z_cast;
- _ <- invert_bind_args idc3
+ _ <- invert_bind_args idc4
Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc2
+ args3 <- invert_bind_args idc3
Raw.ident.Z_cast;
- args3 <- invert_bind_args idc1
- Raw.ident.Literal;
- args4 <- invert_bind_args idc0
+ args4 <- invert_bind_args idc2
+ Raw.ident.Z_cast;
+ args5 <- invert_bind_args idc1
Raw.ident.Literal;
+ args6 <- invert_bind_args idc0
+ Raw.ident.Z_cast;
_ <- invert_bind_args idc
Raw.ident.Z_sub_get_borrow;
match
pattern.type.unify_extracted
((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- (((projT1 args4) -> (projT1 args3)) ->
- s5 -> (projT1 args))%ptype
+ (((projT1 args5) -> s3) ->
+ s7 -> (projT1 args))%ptype
with
| Some (_, _, (_, _))%zrange =>
if
type.type_beq base.type
base.type.type_beq
((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- (((projT1 args4) -> (projT1 args3)) ->
- s5 -> (projT1 args))%ptype
- then
- xv <- ident.unify
- pattern.ident.Literal
- ##(projT2 args4);
- xv0 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args3);
- v <- type.try_make_transport_cps s5 ℤ;
- xv1 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args);
- fv <- (x7 <- (let
- '(r1, r2)%zrange :=
- range in
- fun (s6 xx : Z)
- (rshiftr ry : zrange)
- (y : expr ℤ)
- (offset : Z) =>
- if
- (s6 =? 2 ^ Z.log2 s6) &&
- (ZRange.normalize ry >>
- ZRange.normalize
- (ZRange.constant
- offset) <=?
- ZRange.normalize
- rshiftr)%zrange &&
- (ZRange.normalize
- rshiftr <=?
- r[0 ~> s6 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_sub
- (Z.log2 s6)
- (- offset))%expr @
- ((##xx)%expr,
- #(Z_cast ry)%expr @
- y)))%expr_pat
- else None)
- (let (x7, _) := xv in
- x7)
- (let (x7, _) := xv0 in
- x7) args2 args0
- (v (Compile.reflect x6))
- (let (x7, _) := xv1 in
- x7);
- Some (Base x7));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
- end
- | @expr.App _ _ _ s5 _ ($_)%expr _ | @expr.App _ _
- _ s5 _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _
- _ s5 _ (_ @ _)%expr_pat _ | @expr.App _ _ _ s5 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | _ => None
- end;;
- args <- invert_bind_args idc2 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc1 Raw.ident.Literal;
- args1 <- invert_bind_args idc0 Raw.ident.Literal;
- _ <- invert_bind_args idc Raw.ident.Z_sub_get_borrow;
- match
- pattern.type.unify_extracted ((ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args1) -> (projT1 args0)) -> s2)%ptype
- with
- | Some (_, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- ((ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args1) -> (projT1 args0)) -> s2)%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args1);
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- v <- type.try_make_transport_cps s2 ℤ;
- fv <- (x4 <- (let
- '(r1, r2)%zrange := range in
- fun (s3 xx : Z) (ry : zrange)
- (y : expr ℤ) =>
- if
- (s3 =? 2 ^ Z.log2 s3) &&
- (ZRange.normalize ry <=?
- r[0 ~> s3 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_sub (Z.log2 s3) 0)%expr @
- ((##xx)%expr,
- #(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x4, _) := xv in x4)
- (let (x4, _) := xv0 in x4) args
- (v (Compile.reflect x3));
- Some (Base x4));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s2 _ ($_)%expr _ | @expr.App _ _ _ s2 _
- (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s2 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s2 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | @expr.App _ _ _ s2 _ (@expr.Ident _ _ _ t1 idc1) x3 =>
- match x0 with
- | @expr.Ident _ _ _ t2 idc2 =>
- args <- invert_bind_args idc2 Raw.ident.Literal;
- args0 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args1 <- invert_bind_args idc0 Raw.ident.Literal;
- _ <- invert_bind_args idc Raw.ident.Z_sub_get_borrow;
- match
- pattern.type.unify_extracted ((ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args1) -> s2) -> (projT1 args))%ptype
- with
- | Some (_, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- ((ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args1) -> s2) -> (projT1 args))%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args1);
- v <- type.try_make_transport_cps s2 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x4 <- (let
- '(r1, r2)%zrange := range in
- fun (s3 : Z) (rx : zrange)
- (x4 : expr ℤ) (yy : Z) =>
- if
- (s3 =? 2 ^ Z.log2 s3) &&
- (ZRange.normalize
- (ZRange.constant yy) <=?
- r[0 ~> s3 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_sub (Z.log2 s3) 0)%expr @
- (#(Z_cast rx)%expr @ x4,
- (##yy)%expr)))%expr_pat
- else None)
- (let (x4, _) := xv in x4) args0
- (v (Compile.reflect x3))
- (let (x4, _) := xv0 in x4);
- Some (Base x4));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t2 idc2) x4 =>
- match x4 with
- | (@expr.Ident _ _ _ t3 idc3 @ x6 @ x5)%expr_pat =>
- match x6 with
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9
- _ (@expr.Ident _ _ _ t6 idc6) x10 @ @expr.Ident
- _ _ _ t7 idc7))%expr_pat =>
- match x5 with
- | @expr.Ident _ _ _ t8 idc8 =>
- args <- invert_bind_args idc8
- Raw.ident.Literal;
- args0 <- invert_bind_args idc7
- Raw.ident.Literal;
- args1 <- invert_bind_args idc6
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc5 Raw.ident.Z_land;
- args3 <- invert_bind_args idc4
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc3
- Raw.ident.Z_shiftl;
- args5 <- invert_bind_args idc2
- Raw.ident.Z_cast;
- args6 <- invert_bind_args idc1
- Raw.ident.Z_cast;
- args7 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_sub_get_borrow;
- match
- pattern.type.unify_extracted
- ((ℤ -> ℤ) -> (ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args7) -> s2) ->
- (s9 -> (projT1 args0)) ->
- (projT1 args))%ptype
- with
- | Some (_, _, (_, _, _))%zrange =>
- if
- type.type_beq base.type
- base.type.type_beq
- ((ℤ -> ℤ) -> (ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args7) -> s2) ->
- (s9 -> (projT1 args0)) ->
- (projT1 args))%ptype
+ (((projT1 args5) -> s3) ->
+ s7 -> (projT1 args))%ptype
then
xv <- ident.unify
pattern.ident.Literal
- ##(projT2 args7);
- v <- type.try_make_transport_cps s2 ℤ;
- v0 <- type.try_make_transport_cps s9 ℤ;
+ ##(projT2 args5);
+ v <- type.try_make_transport_cps s3 ℤ;
+ v0 <- type.try_make_transport_cps s7 ℤ;
xv0 <- ident.unify
pattern.ident.Literal
- ##(projT2 args0);
- xv1 <- ident.unify
- pattern.ident.Literal
##(projT2 args);
- fv <- (x11 <- (let
+ fv <- (x10 <- (let
'(r1, r2)%zrange :=
range in
- fun (s10 : Z)
+ fun (rs : zrange)
+ (s9 : Z)
(rx : zrange)
- (x11 : expr ℤ)
- (rshiftl rland
+ (x10 : expr ℤ)
+ (rshiftr
ry : zrange)
(y : expr ℤ)
- (mask offset : Z) =>
+ (roffset : zrange)
+ (offset : Z) =>
if
- (s10 =?
- 2 ^ Z.log2 s10) &&
- (ZRange.normalize
- rland <<
+ (s9 =? 2 ^ Z.log2 s9) &&
+ (ZRange.normalize ry >>
ZRange.normalize
(ZRange.constant
offset) <=?
ZRange.normalize
- rshiftl)%zrange &&
+ rshiftr)%zrange &&
(ZRange.normalize
- rshiftl <=?
- r[0 ~> s10 - 1])%zrange &&
- (ZRange.normalize ry &'
- ZRange.normalize
- (ZRange.constant
- mask) <=?
- ZRange.normalize
- rland)%zrange &&
- (mask =?
- Z.ones
- (Z.log2 s10 -
- offset)) &&
- (0 <=? offset) &&
- (offset <=?
- Z.log2 s10)
+ rshiftr <=?
+ r[0 ~> s9 - 1])%zrange &&
+ is_bounded_by_bool s9
+ (ZRange.normalize
+ rs) &&
+ is_bounded_by_bool
+ offset
+ (ZRange.normalize
+ roffset)
then
Some
(#(Z_cast2 (r1, r2))%expr @
(#(fancy_sub
- (Z.log2 s10)
- offset)%expr @
+ (Z.log2 s9)
+ (- offset))%expr @
(#(Z_cast rx)%expr @
- x11,
+ x10,
#(Z_cast ry)%expr @
y)))%expr_pat
- else None)
- (let (x11, _) := xv in
- x11) args6
+ else None) args6
+ (let (x10, _) := xv in
+ x10) args4
(v
- (Compile.reflect x3))
- args5 args3 args1
+ (Compile.reflect x4))
+ args3 args1
(v0
- (Compile.reflect
- x10))
- (let (x11, _) :=
+ (Compile.reflect x8))
+ args0
+ (let (x10, _) :=
xv0 in
- x11)
- (let (x11, _) :=
- xv1 in
- x11);
- Some (Base x11));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
- end
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9
- _ (@expr.Ident _ _ _ t6 idc6) x10 @ ($_)%expr))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9
- _ (@expr.Ident _ _ _ t6 idc6) x10 @ @expr.Abs _
- _ _ _ _ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9
- _ (@expr.Ident _ _ _ t6 idc6) x10 @ (_ @ _)))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9
- _ (@expr.Ident _ _ _ t6 idc6) x10 @ @expr.LetIn
- _ _ _ _ _ _ _))%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9
- _ ($_)%expr _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9
- _ (@expr.Abs _ _ _ _ _ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9
- _ (_ @ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9
- _ (@expr.LetIn _ _ _ _ _ _ _) _ @ _))%expr_pat =>
- None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ #(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _
- _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _
- _ _ _ @ _))%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @ #(_))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.Abs _ _ _ _ _
- _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (#(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (_ @ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.LetIn _ _ _ _
- _ _ _)%expr_pat => None
- | _ => None
- end;;
- match x6 with
- | @expr.App _ _ _ s6 _ (@expr.Ident _ _ _ t4 idc4)
- x7 =>
- match x5 with
- | @expr.Ident _ _ _ t5 idc5 =>
- args <- invert_bind_args idc5
- Raw.ident.Literal;
- args0 <- invert_bind_args idc4
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc3
- Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc2
- Raw.ident.Z_cast;
- args3 <- invert_bind_args idc1
- Raw.ident.Z_cast;
- args4 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_sub_get_borrow;
- match
- pattern.type.unify_extracted
- ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- (((projT1 args4) -> s2) ->
- s6 -> (projT1 args))%ptype
- with
- | Some (_, _, (_, _))%zrange =>
- if
- type.type_beq base.type
- base.type.type_beq
- ((ℤ -> ℤ) -> ℤ -> ℤ)%ptype
- (((projT1 args4) -> s2) ->
- s6 -> (projT1 args))%ptype
- then
- xv <- ident.unify
- pattern.ident.Literal
- ##(projT2 args4);
- v <- type.try_make_transport_cps s2 ℤ;
- v0 <- type.try_make_transport_cps s6 ℤ;
- xv0 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args);
- fv <- (x8 <- (let
- '(r1, r2)%zrange :=
- range in
- fun (s7 : Z)
- (rx : zrange)
- (x8 : expr ℤ)
- (rshiftr ry : zrange)
- (y : expr ℤ)
- (offset : Z) =>
- if
- (s7 =? 2 ^ Z.log2 s7) &&
- (ZRange.normalize ry >>
- ZRange.normalize
- (ZRange.constant
- offset) <=?
- ZRange.normalize
- rshiftr)%zrange &&
- (ZRange.normalize
- rshiftr <=?
- r[0 ~> s7 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_sub
- (Z.log2 s7)
- (- offset))%expr @
- (#(Z_cast rx)%expr @
- x8,
- #(Z_cast ry)%expr @
- y)))%expr_pat
- else None)
- (let (x8, _) := xv in
- x8) args3
- (v (Compile.reflect x3))
- args2 args0
- (v0
- (Compile.reflect x7))
- (let (x8, _) := xv0 in
- x8);
- Some (Base x8));
+ x10);
+ Some (Base x10));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end
+ | (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _
+ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t6 idc6 @ (_ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _
+ _ _ _ _ _)%expr_pat => None
| _ => None
end
- | @expr.App _ _ _ s6 _ ($_)%expr _ | @expr.App _ _
- _ s6 _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _
- _ s6 _ (_ @ _)%expr_pat _ | @expr.App _ _ _ s6 _
+ | @expr.App _ _ _ s7 _ ($_)%expr _ | @expr.App _ _
+ _ s7 _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _
+ _ s7 _ (_ @ _)%expr_pat _ | @expr.App _ _ _ s7 _
(@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end
| _ => None
end;;
- args <- invert_bind_args idc2 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args1 <- invert_bind_args idc0 Raw.ident.Literal;
+ args <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args0 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc1 Raw.ident.Literal;
+ args2 <- invert_bind_args idc0 Raw.ident.Z_cast;
_ <- invert_bind_args idc Raw.ident.Z_sub_get_borrow;
match
pattern.type.unify_extracted ((ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args1) -> s2) -> s3)%ptype
+ (((projT1 args1) -> s3) -> s4)%ptype
with
| Some (_, _, _)%zrange =>
if
type.type_beq base.type base.type.type_beq
((ℤ -> ℤ) -> ℤ)%ptype
- (((projT1 args1) -> s2) -> s3)%ptype
+ (((projT1 args1) -> s3) -> s4)%ptype
then
xv <- ident.unify pattern.ident.Literal
##(projT2 args1);
- v <- type.try_make_transport_cps s2 ℤ;
- v0 <- type.try_make_transport_cps s3 ℤ;
- fv <- (x5 <- (let
+ v <- type.try_make_transport_cps s3 ℤ;
+ v0 <- type.try_make_transport_cps s4 ℤ;
+ fv <- (x6 <- (let
'(r1, r2)%zrange := range in
- fun (s4 : Z) (rx : zrange)
- (x5 : expr ℤ) (ry : zrange)
- (y : expr ℤ) =>
+ fun (rs : zrange) (s5 : Z)
+ (rx : zrange) (x6 : expr ℤ)
+ (ry : zrange) (y : expr ℤ) =>
if
- (s4 =? 2 ^ Z.log2 s4) &&
+ (s5 =? 2 ^ Z.log2 s5) &&
(ZRange.normalize ry <=?
- r[0 ~> s4 - 1])%zrange
+ r[0 ~> s5 - 1])%zrange &&
+ is_bounded_by_bool s5
+ (ZRange.normalize rs)
then
Some
(#(Z_cast2 (r1, r2))%expr @
- (#(fancy_sub (Z.log2 s4) 0)%expr @
- (#(Z_cast rx)%expr @ x5,
+ (#(fancy_sub (Z.log2 s5) 0)%expr @
+ (#(Z_cast rx)%expr @ x6,
#(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x5, _) := xv in x5) args0
- (v (Compile.reflect x3)) args
- (v0 (Compile.reflect x4));
- Some (Base x5));
+ else None) args2
+ (let (x6, _) := xv in x6) args0
+ (v (Compile.reflect x4)) args
+ (v0 (Compile.reflect x5));
+ Some (Base x6));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end
- | @expr.App _ _ _ s3 _ ($_)%expr _ | @expr.App _ _ _ s3 _
- (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s3 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s3 _
+ | @expr.App _ _ _ s4 _ ($_)%expr _ | @expr.App _ _ _ s4 _
+ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s4 _
+ (_ @ _)%expr_pat _ | @expr.App _ _ _ s4 _
(@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end
- | @expr.App _ _ _ s2 _ ($_)%expr _ | @expr.App _ _ _ s2 _
- (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s2 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s2 _
+ | @expr.App _ _ _ s3 _ ($_)%expr _ | @expr.App _ _ _ s3 _
+ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s3 _
+ (_ @ _)%expr_pat _ | @expr.App _ _ _ s3 _
(@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end
+ | (@expr.Ident _ _ _ t0 idc0 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t0 idc0 @ (_ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.LetIn _ _ _ _ _ _ _)%expr_pat =>
+ None
| _ => None
end
| (@expr.Ident _ _ _ t idc @ x3 @ x2 @ x1 @ x0)%expr_pat =>
match x3 with
- | @expr.Ident _ _ _ t0 idc0 =>
+ | (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat =>
match x2 with
- | @expr.Ident _ _ _ t1 idc1 =>
+ | @expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5 =>
match x1 with
- | @expr.Ident _ _ _ t2 idc2 =>
- match x0 with
- | @expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t3 idc3)
- x4 =>
- match x4 with
- | (@expr.Ident _ _ _ t4 idc4 @ x6 @ x5)%expr_pat =>
- match x6 with
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (@expr.Ident _ _ _ t7 idc7) x10 @
- @expr.Ident _ _ _ t8 idc8))%expr_pat =>
- match x5 with
- | @expr.Ident _ _ _ t9 idc9 =>
- args <- invert_bind_args idc9
- Raw.ident.Literal;
- args0 <- invert_bind_args idc8
- Raw.ident.Literal;
- args1 <- invert_bind_args idc7
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc6
- Raw.ident.Z_land;
- args3 <- invert_bind_args idc5
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc4
- Raw.ident.Z_shiftl;
- args5 <- invert_bind_args idc3
- Raw.ident.Z_cast;
- args6 <- invert_bind_args idc2
- Raw.ident.Literal;
- args7 <- invert_bind_args idc1
- Raw.ident.Literal;
- args8 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_add_with_get_carry;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> (ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args8) -> (projT1 args7)) ->
- (projT1 args6)) ->
- (s9 -> (projT1 args0)) ->
- (projT1 args))%ptype
- with
- | Some (_, _, _, (_, _, _))%zrange =>
- if
- type.type_beq base.type
- base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) ->
- (ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args8) ->
- (projT1 args7)) ->
- (projT1 args6)) ->
- (s9 -> (projT1 args0)) ->
- (projT1 args))%ptype
- then
- xv <- ident.unify
- pattern.ident.Literal
- ##(projT2 args8);
- xv0 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args7);
- xv1 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args6);
- v <- type.try_make_transport_cps s9 ℤ;
- xv2 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args0);
- xv3 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args);
- fv <- (x11 <- (let
- '(r1, r2)%zrange :=
- range in
- fun
- (s10 cc xx : Z)
- (rshiftl rland
- ry : zrange)
- (y : expr ℤ)
- (mask
- offset : Z) =>
- if
- (s10 =?
- 2 ^ Z.log2 s10) &&
- (ZRange.normalize
- rland <<
- ZRange.normalize
- (ZRange.constant
- offset) <=?
- ZRange.normalize
- rshiftl)%zrange &&
- (ZRange.normalize
- rshiftl <=?
- r[0 ~> s10 - 1])%zrange &&
- (ZRange.normalize
- ry &'
- ZRange.normalize
- (ZRange.constant
- mask) <=?
- ZRange.normalize
- rland)%zrange &&
- (mask =?
- Z.ones
- (Z.log2 s10 -
- offset)) &&
- (0 <=? offset) &&
- (offset <=?
- Z.log2 s10)
- then
- Some
- (#(Z_cast2
- (r1, r2))%expr @
- (#(fancy_addc
- (Z.log2
- s10)
- offset)%expr @
- ((##cc)%expr,
- (##xx)%expr,
- #(Z_cast ry)%expr @
- y)))%expr_pat
- else None)
- (let (x11, _) :=
- xv in
- x11)
- (let (x11, _) :=
- xv0 in
- x11)
- (let (x11, _) :=
- xv1 in
- x11) args5 args3
- args1
- (v
- (Compile.reflect
- x10))
- (let (x11, _) :=
- xv2 in
- x11)
- (let (x11, _) :=
- xv3 in
- x11);
- Some (Base x11));
- Some
- (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
- end
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (@expr.Ident _ _ _ t7 idc7) x10 @
- ($_)%expr))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (@expr.Ident _ _ _ t7 idc7) x10 @
- @expr.Abs _ _ _ _ _ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (@expr.Ident _ _ _ t7 idc7) x10 @
- (_ @ _)))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (@expr.Ident _ _ _ t7 idc7) x10 @
- @expr.LetIn _ _ _ _ _ _ _))%expr_pat =>
- None
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ ($_)%expr _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (@expr.Abs _ _ _ _ _ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (_ @ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (@expr.LetIn _ _ _ _ _ _ _) _ @ _))%expr_pat =>
- None
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ #(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _
- _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _
- _ _ _ _ _ @ _))%expr_pat => None
- | (@expr.Ident _ _ _ t5 idc5 @ #(_))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _
- _ _ _)%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (#(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (($_)%expr @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _
- _ _ _ _ _)%expr_pat => None
- | _ => None
- end;;
- match x6 with
- | @expr.App _ _ _ s6 _
- (@expr.Ident _ _ _ t5 idc5) x7 =>
- match x5 with
- | @expr.Ident _ _ _ t6 idc6 =>
- args <- invert_bind_args idc6
- Raw.ident.Literal;
- args0 <- invert_bind_args idc5
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc4
- Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc3
- Raw.ident.Z_cast;
- args3 <- invert_bind_args idc2
- Raw.ident.Literal;
- args4 <- invert_bind_args idc1
- Raw.ident.Literal;
- args5 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_add_with_get_carry;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ -> ℤ)%ptype
- ((((projT1 args5) -> (projT1 args4)) ->
- (projT1 args3)) ->
- s6 -> (projT1 args))%ptype
- with
- | Some (_, _, _, (_, _))%zrange =>
- if
- type.type_beq base.type
- base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ -> ℤ)%ptype
- ((((projT1 args5) ->
- (projT1 args4)) ->
- (projT1 args3)) ->
- s6 -> (projT1 args))%ptype
- then
- xv <- ident.unify
- pattern.ident.Literal
- ##(projT2 args5);
- xv0 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args4);
- xv1 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args3);
- v <- type.try_make_transport_cps s6 ℤ;
- xv2 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args);
- fv <- (x8 <- (let
- '(r1, r2)%zrange :=
- range in
- fun (s7 cc xx : Z)
- (rshiftr
- ry : zrange)
- (y : expr ℤ)
- (offset : Z) =>
- if
- (s7 =?
- 2 ^ Z.log2 s7) &&
- (ZRange.normalize
- ry >>
- ZRange.normalize
- (ZRange.constant
- offset) <=?
- ZRange.normalize
- rshiftr)%zrange &&
- (ZRange.normalize
- rshiftr <=?
- r[0 ~> s7 - 1])%zrange
- then
- Some
- (#(Z_cast2
- (r1, r2))%expr @
- (#(fancy_addc
- (Z.log2 s7)
- (- offset))%expr @
- ((##cc)%expr,
- (##xx)%expr,
- #(Z_cast ry)%expr @
- y)))%expr_pat
- else None)
- (let (x8, _) :=
- xv in
- x8)
- (let (x8, _) :=
- xv0 in
- x8)
- (let (x8, _) :=
- xv1 in
- x8) args2 args0
- (v
- (Compile.reflect
- x7))
- (let (x8, _) :=
- xv2 in
- x8);
- Some (Base x8));
- Some
- (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
- end
- | @expr.App _ _ _ s6 _ ($_)%expr _ | @expr.App
- _ _ _ s6 _ (@expr.Abs _ _ _ _ _ _) _ |
- @expr.App _ _ _ s6 _ (_ @ _)%expr_pat _ |
- @expr.App _ _ _ s6 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | _ => None
- end;;
- args <- invert_bind_args idc3 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc2 Raw.ident.Literal;
- args1 <- invert_bind_args idc1 Raw.ident.Literal;
- args2 <- invert_bind_args idc0 Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_add_with_get_carry;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> (projT1 args1)) ->
- (projT1 args0)) -> s3)%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> (projT1 args1)) ->
- (projT1 args0)) -> s3)%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args2);
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args1);
- xv1 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- v <- type.try_make_transport_cps s3 ℤ;
- fv <- (x5 <- (let
- '(r1, r2)%zrange := range in
- fun (s4 cc xx : Z)
- (ry : zrange) (y : expr ℤ) =>
- if
- (s4 =? 2 ^ Z.log2 s4) &&
- (ZRange.normalize ry <=?
- r[0 ~> s4 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_addc (Z.log2 s4) 0)%expr @
- ((##cc)%expr, (##xx)%expr,
- #(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x5, _) := xv in x5)
- (let (x5, _) := xv0 in x5)
- (let (x5, _) := xv1 in x5) args
- (v (Compile.reflect x4));
- Some (Base x5));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s3 _ ($_)%expr _ | @expr.App _ _ _ s3
- _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s3 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s3 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | @expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t2 idc2) x4 =>
- match x0 with
- | @expr.Ident _ _ _ t3 idc3 =>
- match x4 with
- | (@expr.Ident _ _ _ t4 idc4 @ x6 @ x5)%expr_pat =>
- match x6 with
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (@expr.Ident _ _ _ t7 idc7) x10 @
- @expr.Ident _ _ _ t8 idc8))%expr_pat =>
- match x5 with
- | @expr.Ident _ _ _ t9 idc9 =>
- args <- invert_bind_args idc9
- Raw.ident.Literal;
- args0 <- invert_bind_args idc8
- Raw.ident.Literal;
- args1 <- invert_bind_args idc7
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc6
- Raw.ident.Z_land;
- args3 <- invert_bind_args idc5
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc4
- Raw.ident.Z_shiftl;
- args5 <- invert_bind_args idc3
- Raw.ident.Literal;
- args6 <- invert_bind_args idc2
- Raw.ident.Z_cast;
- args7 <- invert_bind_args idc1
- Raw.ident.Literal;
- args8 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_add_with_get_carry;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> (ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args8) -> (projT1 args7)) ->
- (s9 -> (projT1 args0)) ->
- (projT1 args)) -> (projT1 args5))%ptype
- with
- | Some (_, _, (_, _, _), _)%zrange =>
- if
- type.type_beq base.type
- base.type.type_beq
- (((ℤ -> ℤ) -> (ℤ -> ℤ) -> ℤ) ->
- ℤ)%ptype
- ((((projT1 args8) ->
- (projT1 args7)) ->
- (s9 -> (projT1 args0)) ->
- (projT1 args)) ->
- (projT1 args5))%ptype
- then
- xv <- ident.unify
- pattern.ident.Literal
- ##(projT2 args8);
- xv0 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args7);
- v <- type.try_make_transport_cps s9 ℤ;
- xv1 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args0);
- xv2 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args);
- xv3 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args5);
- fv <- (x11 <- (let
- '(r1, r2)%zrange :=
- range in
- fun (s10 cc : Z)
- (rshiftl rland
- ry : zrange)
- (y : expr ℤ)
- (mask offset
- xx : Z) =>
- if
- (s10 =?
- 2 ^ Z.log2 s10) &&
- (ZRange.normalize
- rland <<
- ZRange.normalize
- (ZRange.constant
- offset) <=?
- ZRange.normalize
- rshiftl)%zrange &&
- (ZRange.normalize
- rshiftl <=?
- r[0 ~> s10 - 1])%zrange &&
- (ZRange.normalize
- ry &'
- ZRange.normalize
- (ZRange.constant
- mask) <=?
- ZRange.normalize
- rland)%zrange &&
- (mask =?
- Z.ones
- (Z.log2 s10 -
- offset)) &&
- (0 <=? offset) &&
- (offset <=?
- Z.log2 s10)
- then
- Some
- (#(Z_cast2
- (r1, r2))%expr @
- (#(fancy_addc
- (Z.log2
- s10)
- offset)%expr @
- ((##cc)%expr,
- (##xx)%expr,
- #(Z_cast ry)%expr @
- y)))%expr_pat
- else None)
- (let (x11, _) :=
- xv in
- x11)
- (let (x11, _) :=
- xv0 in
- x11) args6 args3
- args1
- (v
- (Compile.reflect
- x10))
- (let (x11, _) :=
- xv1 in
- x11)
- (let (x11, _) :=
- xv2 in
- x11)
- (let (x11, _) :=
- xv3 in
- x11);
- Some (Base x11));
- Some
- (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
- end
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (@expr.Ident _ _ _ t7 idc7) x10 @
- ($_)%expr))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (@expr.Ident _ _ _ t7 idc7) x10 @
- @expr.Abs _ _ _ _ _ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (@expr.Ident _ _ _ t7 idc7) x10 @
- (_ @ _)))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (@expr.Ident _ _ _ t7 idc7) x10 @
- @expr.LetIn _ _ _ _ _ _ _))%expr_pat =>
- None
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ ($_)%expr _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (@expr.Abs _ _ _ _ _ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (_ @ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (@expr.LetIn _ _ _ _ _ _ _) _ @ _))%expr_pat =>
- None
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ #(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _
- _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _
- _ _ _ _ _ @ _))%expr_pat => None
- | (@expr.Ident _ _ _ t5 idc5 @ #(_))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _
- _ _ _)%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (#(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (($_)%expr @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _
- _ _ _ _ _)%expr_pat => None
- | _ => None
- end;;
- match x6 with
- | @expr.App _ _ _ s6 _
- (@expr.Ident _ _ _ t5 idc5) x7 =>
- match x5 with
- | @expr.Ident _ _ _ t6 idc6 =>
- args <- invert_bind_args idc6
- Raw.ident.Literal;
- args0 <- invert_bind_args idc5
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc4
- Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc3
- Raw.ident.Literal;
- args3 <- invert_bind_args idc2
- Raw.ident.Z_cast;
- args4 <- invert_bind_args idc1
- Raw.ident.Literal;
- args5 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_add_with_get_carry;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args5) -> (projT1 args4)) ->
- s6 -> (projT1 args)) ->
- (projT1 args2))%ptype
- with
- | Some (_, _, (_, _), _)%zrange =>
- if
- type.type_beq base.type
- base.type.type_beq
- (((ℤ -> ℤ) -> ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args5) ->
- (projT1 args4)) ->
- s6 -> (projT1 args)) ->
- (projT1 args2))%ptype
- then
- xv <- ident.unify
- pattern.ident.Literal
- ##(projT2 args5);
- xv0 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args4);
- v <- type.try_make_transport_cps s6 ℤ;
- xv1 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args);
- xv2 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args2);
- fv <- (x8 <- (let
- '(r1, r2)%zrange :=
- range in
- fun (s7 cc : Z)
- (rshiftr
- ry : zrange)
- (y : expr ℤ)
- (offset xx : Z)
- =>
- if
- (s7 =?
- 2 ^ Z.log2 s7) &&
- (ZRange.normalize
- ry >>
- ZRange.normalize
- (ZRange.constant
- offset) <=?
- ZRange.normalize
- rshiftr)%zrange &&
- (ZRange.normalize
- rshiftr <=?
- r[0 ~> s7 - 1])%zrange
- then
- Some
- (#(Z_cast2
- (r1, r2))%expr @
- (#(fancy_addc
- (Z.log2 s7)
- (- offset))%expr @
- ((##cc)%expr,
- (##xx)%expr,
- #(Z_cast ry)%expr @
- y)))%expr_pat
- else None)
- (let (x8, _) :=
- xv in
- x8)
- (let (x8, _) :=
- xv0 in
- x8) args3 args0
- (v
- (Compile.reflect
- x7))
- (let (x8, _) :=
- xv1 in
- x8)
- (let (x8, _) :=
- xv2 in
- x8);
- Some (Base x8));
- Some
- (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
- end
- | @expr.App _ _ _ s6 _ ($_)%expr _ | @expr.App
- _ _ _ s6 _ (@expr.Abs _ _ _ _ _ _) _ |
- @expr.App _ _ _ s6 _ (_ @ _)%expr_pat _ |
- @expr.App _ _ _ s6 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | _ => None
- end;;
- args <- invert_bind_args idc3 Raw.ident.Literal;
- args0 <- invert_bind_args idc2 Raw.ident.Z_cast;
- args1 <- invert_bind_args idc1 Raw.ident.Literal;
- args2 <- invert_bind_args idc0 Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_add_with_get_carry;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> (projT1 args1)) -> s3) ->
- (projT1 args))%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> (projT1 args1)) -> s3) ->
- (projT1 args))%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args2);
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args1);
- v <- type.try_make_transport_cps s3 ℤ;
- xv1 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x5 <- (let
- '(r1, r2)%zrange := range in
- fun (s4 cc : Z) (rx : zrange)
- (x5 : expr ℤ) (yy : Z) =>
- if
- (s4 =? 2 ^ Z.log2 s4) &&
- (ZRange.normalize
- (ZRange.constant yy) <=?
- r[0 ~> s4 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_addc (Z.log2 s4) 0)%expr @
- ((##cc)%expr,
- #(Z_cast rx)%expr @ x5,
- (##yy)%expr)))%expr_pat
- else None)
- (let (x5, _) := xv in x5)
- (let (x5, _) := xv0 in x5)
- args0 (v (Compile.reflect x4))
- (let (x5, _) := xv1 in x5);
- Some (Base x5));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t3 idc3)
- x5 =>
- match x5 with
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.Ident _ _ _ t8 idc8)) @ @expr.Ident _ _
- _ t9 idc9)%expr_pat =>
- args <- invert_bind_args idc9 Raw.ident.Literal;
- args0 <- invert_bind_args idc8
- Raw.ident.Literal;
- args1 <- invert_bind_args idc7 Raw.ident.Z_cast;
- _ <- invert_bind_args idc6 Raw.ident.Z_land;
- args3 <- invert_bind_args idc5 Raw.ident.Z_cast;
- _ <- invert_bind_args idc4 Raw.ident.Z_shiftl;
- args5 <- invert_bind_args idc3 Raw.ident.Z_cast;
- args6 <- invert_bind_args idc2 Raw.ident.Z_cast;
- args7 <- invert_bind_args idc1
- Raw.ident.Literal;
- args8 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_add_with_get_carry;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> (ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args8) -> (projT1 args7)) -> s3) ->
- (s10 -> (projT1 args0)) -> (projT1 args))%ptype
- with
- | Some (_, _, _, (_, _, _))%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> (ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args8) -> (projT1 args7)) ->
- s3) ->
- (s10 -> (projT1 args0)) ->
- (projT1 args))%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args8);
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args7);
- v <- type.try_make_transport_cps s3 ℤ;
- v0 <- type.try_make_transport_cps s10 ℤ;
- xv1 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- xv2 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x12 <- (let
- '(r1, r2)%zrange := range
- in
- fun (s11 cc : Z)
- (rx : zrange)
- (x12 : expr ℤ)
- (rshiftl rland
- ry : zrange)
- (y : expr ℤ)
- (mask offset : Z) =>
- if
- (s11 =? 2 ^ Z.log2 s11) &&
- (ZRange.normalize rland <<
- ZRange.normalize
- (ZRange.constant
- offset) <=?
- ZRange.normalize rshiftl)%zrange &&
- (ZRange.normalize rshiftl <=?
- r[0 ~> s11 - 1])%zrange &&
- (ZRange.normalize ry &'
- ZRange.normalize
- (ZRange.constant mask) <=?
- ZRange.normalize rland)%zrange &&
- (mask =?
- Z.ones
- (Z.log2 s11 - offset)) &&
- (0 <=? offset) &&
- (offset <=? Z.log2 s11)
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_addc
- (Z.log2 s11)
- offset)%expr @
- ((##cc)%expr,
- #(Z_cast rx)%expr @
- x12,
- #(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x12, _) := xv in x12)
- (let (x12, _) := xv0 in
- x12) args6
- (v (Compile.reflect x4))
- args5 args3 args1
- (v0 (Compile.reflect x11))
- (let (x12, _) := xv1 in
- x12)
- (let (x12, _) := xv2 in
- x12);
- Some (Base x12));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.Ident _ _ _ t8 idc8)) @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.Ident _ _ _ t8 idc8)) @ @expr.Abs _ _ _
- _ _ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.Ident _ _ _ t8 idc8)) @ (_ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.Ident _ _ _ t8 idc8)) @ @expr.LetIn _ _
- _ _ _ _ _)%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- ($_)%expr)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.Abs _ _ _ _ _ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- (_ @ _))) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.LetIn _ _ _ _ _ _ _)) @ _)%expr_pat =>
- None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ ($_)%expr _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Abs _ _ _ _ _ _) _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (_ @ _) _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.LetIn _ _ _ _ _ _ _) _ @ _)) @ _)%expr_pat =>
- None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ #(_) @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr @ _)) @
- _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _ _
- _ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _ _
- _ _ _ _ @ _)) @ _)%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ #(_)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _
- _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ (#(_) @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _)) @
- _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Abs _ _ _ _ _ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _ @ _)) @
- _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Abs _ _ _ _ _ _ @ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _ @ _)) @
- _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _
- _ _ _) @ _)%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @ #(_) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ ($_)%expr @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.Abs _ _ _ _ _
- _ @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Abs _ _ _ _ _ _ @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (_ @ _ @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.LetIn _ _ _ _
- _ _ _ @ _)%expr_pat => None
- | _ => None
- end;;
- match x4 with
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.Ident _ _ _ t8 idc8)) @ @expr.Ident _ _
- _ t9 idc9)%expr_pat =>
- args <- invert_bind_args idc9 Raw.ident.Literal;
- args0 <- invert_bind_args idc8
- Raw.ident.Literal;
- args1 <- invert_bind_args idc7 Raw.ident.Z_cast;
- _ <- invert_bind_args idc6 Raw.ident.Z_land;
- args3 <- invert_bind_args idc5 Raw.ident.Z_cast;
- _ <- invert_bind_args idc4 Raw.ident.Z_shiftl;
- args5 <- invert_bind_args idc3 Raw.ident.Z_cast;
- args6 <- invert_bind_args idc2 Raw.ident.Z_cast;
- args7 <- invert_bind_args idc1
- Raw.ident.Literal;
- args8 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_add_with_get_carry;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> (ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args8) -> (projT1 args7)) ->
- (s10 -> (projT1 args0)) -> (projT1 args)) ->
- s4)%ptype
- with
- | Some (_, _, (_, _, _), _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> (ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args8) -> (projT1 args7)) ->
- (s10 -> (projT1 args0)) ->
- (projT1 args)) -> s4)%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args8);
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args7);
- v <- type.try_make_transport_cps s10 ℤ;
- xv1 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- xv2 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- v0 <- type.try_make_transport_cps s4 ℤ;
- fv <- (x12 <- (let
- '(r1, r2)%zrange := range
- in
- fun (s11 cc : Z)
- (rshiftl rland
- ry : zrange)
- (y : expr ℤ)
- (mask offset : Z)
- (rx : zrange)
- (x12 : expr ℤ) =>
- if
- (s11 =? 2 ^ Z.log2 s11) &&
- (ZRange.normalize rland <<
- ZRange.normalize
- (ZRange.constant
- offset) <=?
- ZRange.normalize rshiftl)%zrange &&
- (ZRange.normalize rshiftl <=?
- r[0 ~> s11 - 1])%zrange &&
- (ZRange.normalize ry &'
- ZRange.normalize
- (ZRange.constant mask) <=?
- ZRange.normalize rland)%zrange &&
- (mask =?
- Z.ones
- (Z.log2 s11 - offset)) &&
- (0 <=? offset) &&
- (offset <=? Z.log2 s11)
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_addc
- (Z.log2 s11)
- offset)%expr @
- ((##cc)%expr,
- #(Z_cast rx)%expr @
- x12,
- #(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x12, _) := xv in x12)
- (let (x12, _) := xv0 in
- x12) args6 args3 args1
- (v (Compile.reflect x11))
- (let (x12, _) := xv1 in
- x12)
- (let (x12, _) := xv2 in
- x12) args5
- (v0 (Compile.reflect x5));
- Some (Base x12));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.Ident _ _ _ t8 idc8)) @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.Ident _ _ _ t8 idc8)) @ @expr.Abs _ _ _
- _ _ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.Ident _ _ _ t8 idc8)) @ (_ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.Ident _ _ _ t8 idc8)) @ @expr.LetIn _ _
- _ _ _ _ _)%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- ($_)%expr)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.Abs _ _ _ _ _ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- (_ @ _))) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.LetIn _ _ _ _ _ _ _)) @ _)%expr_pat =>
- None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ ($_)%expr _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Abs _ _ _ _ _ _) _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (_ @ _) _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.LetIn _ _ _ _ _ _ _) _ @ _)) @ _)%expr_pat =>
- None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ #(_) @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr @ _)) @
- _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _ _
- _ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _ _
- _ _ _ _ @ _)) @ _)%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ #(_)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _
- _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ (#(_) @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _)) @
- _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Abs _ _ _ _ _ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _ @ _)) @
- _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Abs _ _ _ _ _ _ @ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _ @ _)) @
- _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _
- _ _ _) @ _)%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @ #(_) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ ($_)%expr @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.Abs _ _ _ _ _
- _ @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Abs _ _ _ _ _ _ @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (_ @ _ @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.LetIn _ _ _ _
- _ _ _ @ _)%expr_pat => None
- | _ => None
- end;;
- match x5 with
- | (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
- (@expr.Ident _ _ _ t5 idc5) x8 @ @expr.Ident _ _
- _ t6 idc6)%expr_pat =>
- args <- invert_bind_args idc6 Raw.ident.Literal;
- args0 <- invert_bind_args idc5 Raw.ident.Z_cast;
- _ <- invert_bind_args idc4 Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc3 Raw.ident.Z_cast;
- args3 <- invert_bind_args idc2 Raw.ident.Z_cast;
- args4 <- invert_bind_args idc1
- Raw.ident.Literal;
- args5 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_add_with_get_carry;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ -> ℤ)%ptype
- ((((projT1 args5) -> (projT1 args4)) -> s3) ->
- s7 -> (projT1 args))%ptype
- with
- | Some (_, _, _, (_, _))%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ -> ℤ)%ptype
- ((((projT1 args5) -> (projT1 args4)) ->
- s3) -> s7 -> (projT1 args))%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args5);
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args4);
- v <- type.try_make_transport_cps s3 ℤ;
- v0 <- type.try_make_transport_cps s7 ℤ;
- xv1 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x9 <- (let
- '(r1, r2)%zrange := range in
- fun (s8 cc : Z)
- (rx : zrange)
- (x9 : expr ℤ)
- (rshiftr ry : zrange)
- (y : expr ℤ) (offset : Z)
- =>
- if
- (s8 =? 2 ^ Z.log2 s8) &&
- (ZRange.normalize ry >>
- ZRange.normalize
- (ZRange.constant offset) <=?
- ZRange.normalize rshiftr)%zrange &&
- (ZRange.normalize rshiftr <=?
- r[0 ~> s8 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_addc
- (Z.log2 s8)
- (- offset))%expr @
- ((##cc)%expr,
- #(Z_cast rx)%expr @ x9,
- #(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x9, _) := xv in x9)
- (let (x9, _) := xv0 in x9)
- args3
- (v (Compile.reflect x4))
- args2 args0
- (v0 (Compile.reflect x8))
- (let (x9, _) := xv1 in x9);
- Some (Base x9));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
- (@expr.Ident _ _ _ t5 idc5) x8 @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
- (@expr.Ident _ _ _ t5 idc5) x8 @ @expr.Abs _ _ _
- _ _ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
- (@expr.Ident _ _ _ t5 idc5) x8 @ (_ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
- (@expr.Ident _ _ _ t5 idc5) x8 @ @expr.LetIn _ _
- _ _ _ _ _)%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
- ($_)%expr _ @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
- (@expr.Abs _ _ _ _ _ _) _ @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
- (_ @ _) _ @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
- (@expr.LetIn _ _ _ _ _ _ _) _ @ _)%expr_pat =>
- None
- | (@expr.Ident _ _ _ t4 idc4 @ #(_) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ ($_)%expr @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.Abs _ _ _ _ _
- _ @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.LetIn _ _ _ _
- _ _ _ @ _)%expr_pat => None
- | _ => None
- end;;
- match x4 with
- | (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
- (@expr.Ident _ _ _ t5 idc5) x8 @ @expr.Ident _ _
- _ t6 idc6)%expr_pat =>
- args <- invert_bind_args idc6 Raw.ident.Literal;
- args0 <- invert_bind_args idc5 Raw.ident.Z_cast;
- _ <- invert_bind_args idc4 Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc3 Raw.ident.Z_cast;
- args3 <- invert_bind_args idc2 Raw.ident.Z_cast;
- args4 <- invert_bind_args idc1
- Raw.ident.Literal;
- args5 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_add_with_get_carry;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args5) -> (projT1 args4)) ->
- s7 -> (projT1 args)) -> s4)%ptype
- with
- | Some (_, _, (_, _), _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args5) -> (projT1 args4)) ->
- s7 -> (projT1 args)) -> s4)%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args5);
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args4);
- v <- type.try_make_transport_cps s7 ℤ;
- xv1 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- v0 <- type.try_make_transport_cps s4 ℤ;
- fv <- (x9 <- (let
- '(r1, r2)%zrange := range in
- fun (s8 cc : Z)
- (rshiftr ry : zrange)
- (y : expr ℤ) (offset : Z)
- (rx : zrange)
- (x9 : expr ℤ) =>
- if
- (s8 =? 2 ^ Z.log2 s8) &&
- (ZRange.normalize ry >>
- ZRange.normalize
- (ZRange.constant offset) <=?
- ZRange.normalize rshiftr)%zrange &&
- (ZRange.normalize rshiftr <=?
- r[0 ~> s8 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_addc
- (Z.log2 s8)
- (- offset))%expr @
- ((##cc)%expr,
- #(Z_cast rx)%expr @ x9,
- #(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x9, _) := xv in x9)
- (let (x9, _) := xv0 in x9)
- args3 args0
- (v (Compile.reflect x8))
- (let (x9, _) := xv1 in x9)
- args2
- (v0 (Compile.reflect x5));
- Some (Base x9));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
- (@expr.Ident _ _ _ t5 idc5) x8 @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
- (@expr.Ident _ _ _ t5 idc5) x8 @ @expr.Abs _ _ _
- _ _ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
- (@expr.Ident _ _ _ t5 idc5) x8 @ (_ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
- (@expr.Ident _ _ _ t5 idc5) x8 @ @expr.LetIn _ _
- _ _ _ _ _)%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
- ($_)%expr _ @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
- (@expr.Abs _ _ _ _ _ _) _ @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
- (_ @ _) _ @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s7 _
- (@expr.LetIn _ _ _ _ _ _ _) _ @ _)%expr_pat =>
- None
- | (@expr.Ident _ _ _ t4 idc4 @ #(_) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ ($_)%expr @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.Abs _ _ _ _ _
- _ @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.LetIn _ _ _ _
- _ _ _ @ _)%expr_pat => None
- | _ => None
- end;;
- args <- invert_bind_args idc3 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc2 Raw.ident.Z_cast;
- args1 <- invert_bind_args idc1 Raw.ident.Literal;
- args2 <- invert_bind_args idc0 Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_add_with_get_carry;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> (projT1 args1)) -> s3) ->
- s4)%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> (projT1 args1)) -> s3) ->
- s4)%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args2);
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args1);
- v <- type.try_make_transport_cps s3 ℤ;
- v0 <- type.try_make_transport_cps s4 ℤ;
- fv <- (x6 <- (let
- '(r1, r2)%zrange := range in
- fun (s5 cc : Z) (rx : zrange)
- (x6 : expr ℤ) (ry : zrange)
- (y : expr ℤ) =>
- if
- (s5 =? 2 ^ Z.log2 s5) &&
- (ZRange.normalize ry <=?
- r[0 ~> s5 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_addc (Z.log2 s5) 0)%expr @
- ((##cc)%expr,
- #(Z_cast rx)%expr @ x6,
- #(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x6, _) := xv in x6)
- (let (x6, _) := xv0 in x6)
- args0 (v (Compile.reflect x4))
- args (v0 (Compile.reflect x5));
- Some (Base x6));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s4 _ ($_)%expr _ | @expr.App _ _ _ s4
- _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s4 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s4 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | @expr.App _ _ _ s3 _ ($_)%expr _ | @expr.App _ _ _ s3 _
- (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s3 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s3 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | @expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t1 idc1) x4 =>
- match x1 with
- | @expr.Ident _ _ _ t2 idc2 =>
- match x0 with
- | @expr.Ident _ _ _ t3 idc3 =>
- args <- invert_bind_args idc3 Raw.ident.Literal;
- args0 <- invert_bind_args idc2 Raw.ident.Literal;
- args1 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args2 <- invert_bind_args idc0 Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_add_with_get_carry;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s3) -> (projT1 args0)) ->
- (projT1 args))%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s3) -> (projT1 args0)) ->
- (projT1 args))%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args2);
- v <- type.try_make_transport_cps s3 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- xv1 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x5 <- (let
- '(r1, r2)%zrange := range in
- fun (s4 : Z) (rc : zrange)
- (c : expr ℤ) (xx yy : Z) =>
- if
- (s4 =? 2 ^ Z.log2 s4) &&
- (ZRange.normalize
- (ZRange.constant yy) <=?
- r[0 ~> s4 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_addc (Z.log2 s4) 0)%expr @
- (#(Z_cast rc)%expr @ c,
- (##xx)%expr, (##yy)%expr)))%expr_pat
- else None)
- (let (x5, _) := xv in x5) args1
- (v (Compile.reflect x4))
- (let (x5, _) := xv0 in x5)
- (let (x5, _) := xv1 in x5);
- Some (Base x5));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t3 idc3)
- x5 =>
- match x5 with
- | (@expr.Ident _ _ _ t4 idc4 @ x7 @ x6)%expr_pat =>
- match x7 with
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.Ident _ _ _ t8 idc8))%expr_pat =>
- match x6 with
- | @expr.Ident _ _ _ t9 idc9 =>
- args <- invert_bind_args idc9
- Raw.ident.Literal;
- args0 <- invert_bind_args idc8
- Raw.ident.Literal;
- args1 <- invert_bind_args idc7
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc6
- Raw.ident.Z_land;
- args3 <- invert_bind_args idc5
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc4
- Raw.ident.Z_shiftl;
- args5 <- invert_bind_args idc3
- Raw.ident.Z_cast;
- args6 <- invert_bind_args idc2
- Raw.ident.Literal;
- args7 <- invert_bind_args idc1
- Raw.ident.Z_cast;
- args8 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_add_with_get_carry;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> (ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args8) -> s3) ->
- (projT1 args6)) ->
- (s10 -> (projT1 args0)) ->
- (projT1 args))%ptype
- with
- | Some (_, _, _, (_, _, _))%zrange =>
- if
- type.type_beq base.type
- base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) ->
- (ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args8) -> s3) ->
- (projT1 args6)) ->
- (s10 -> (projT1 args0)) ->
- (projT1 args))%ptype
- then
- xv <- ident.unify
- pattern.ident.Literal
- ##(projT2 args8);
- v <- type.try_make_transport_cps s3 ℤ;
- xv0 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args6);
- v0 <- type.try_make_transport_cps s10 ℤ;
- xv1 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args0);
- xv2 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args);
- fv <- (x12 <- (let
- '(r1, r2)%zrange :=
- range in
- fun (s11 : Z)
- (rc : zrange)
- (c : expr ℤ)
- (xx : Z)
- (rshiftl rland
- ry : zrange)
- (y : expr ℤ)
- (mask
- offset : Z) =>
- if
- (s11 =?
- 2 ^ Z.log2 s11) &&
- (ZRange.normalize
- rland <<
- ZRange.normalize
- (ZRange.constant
- offset) <=?
- ZRange.normalize
- rshiftl)%zrange &&
- (ZRange.normalize
- rshiftl <=?
- r[0 ~> s11 - 1])%zrange &&
- (ZRange.normalize
- ry &'
- ZRange.normalize
- (ZRange.constant
- mask) <=?
- ZRange.normalize
- rland)%zrange &&
- (mask =?
- Z.ones
- (Z.log2 s11 -
- offset)) &&
- (0 <=? offset) &&
- (offset <=?
- Z.log2 s11)
- then
- Some
- (#(Z_cast2
- (r1, r2))%expr @
- (#(fancy_addc
- (Z.log2
- s11)
- offset)%expr @
- (#(Z_cast rc)%expr @
- c,
- (##xx)%expr,
- #(Z_cast ry)%expr @
- y)))%expr_pat
- else None)
- (let (x12, _) :=
- xv in
- x12) args7
- (v
- (Compile.reflect
- x4))
- (let (x12, _) :=
- xv0 in
- x12) args5 args3
- args1
- (v0
- (Compile.reflect
- x11))
- (let (x12, _) :=
- xv1 in
- x12)
- (let (x12, _) :=
- xv2 in
- x12);
- Some (Base x12));
- Some
- (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
- end
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- ($_)%expr))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.Abs _ _ _ _ _ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- (_ @ _)))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.LetIn _ _ _ _ _ _ _))%expr_pat =>
- None
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ ($_)%expr _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Abs _ _ _ _ _ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (_ @ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.LetIn _ _ _ _ _ _ _) _ @ _))%expr_pat =>
- None
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ #(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _
- _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _
- _ _ _ _ _ @ _))%expr_pat => None
- | (@expr.Ident _ _ _ t5 idc5 @ #(_))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _
- _ _ _)%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (#(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (($_)%expr @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _
- _ _ _ _ _)%expr_pat => None
- | _ => None
- end;;
- match x7 with
- | @expr.App _ _ _ s7 _
- (@expr.Ident _ _ _ t5 idc5) x8 =>
- match x6 with
- | @expr.Ident _ _ _ t6 idc6 =>
- args <- invert_bind_args idc6
- Raw.ident.Literal;
- args0 <- invert_bind_args idc5
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc4
- Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc3
- Raw.ident.Z_cast;
- args3 <- invert_bind_args idc2
- Raw.ident.Literal;
- args4 <- invert_bind_args idc1
- Raw.ident.Z_cast;
- args5 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_add_with_get_carry;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ -> ℤ)%ptype
- ((((projT1 args5) -> s3) ->
- (projT1 args3)) ->
- s7 -> (projT1 args))%ptype
- with
- | Some (_, _, _, (_, _))%zrange =>
- if
- type.type_beq base.type
- base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ -> ℤ)%ptype
- ((((projT1 args5) -> s3) ->
- (projT1 args3)) ->
- s7 -> (projT1 args))%ptype
- then
- xv <- ident.unify
- pattern.ident.Literal
- ##(projT2 args5);
- v <- type.try_make_transport_cps s3 ℤ;
- xv0 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args3);
- v0 <- type.try_make_transport_cps s7 ℤ;
- xv1 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args);
- fv <- (x9 <- (let
- '(r1, r2)%zrange :=
- range in
- fun (s8 : Z)
- (rc : zrange)
- (c : expr ℤ)
- (xx : Z)
- (rshiftr
- ry : zrange)
- (y : expr ℤ)
- (offset : Z) =>
- if
- (s8 =?
- 2 ^ Z.log2 s8) &&
- (ZRange.normalize
- ry >>
- ZRange.normalize
- (ZRange.constant
- offset) <=?
- ZRange.normalize
- rshiftr)%zrange &&
- (ZRange.normalize
- rshiftr <=?
- r[0 ~> s8 - 1])%zrange
- then
- Some
- (#(Z_cast2
- (r1, r2))%expr @
- (#(fancy_addc
- (Z.log2 s8)
- (- offset))%expr @
- (#(Z_cast rc)%expr @
- c,
- (##xx)%expr,
- #(Z_cast ry)%expr @
- y)))%expr_pat
- else None)
- (let (x9, _) :=
- xv in
- x9) args4
- (v
- (Compile.reflect
- x4))
- (let (x9, _) :=
- xv0 in
- x9) args2 args0
- (v0
- (Compile.reflect
- x8))
- (let (x9, _) :=
- xv1 in
- x9);
- Some (Base x9));
- Some
- (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
- end
- | @expr.App _ _ _ s7 _ ($_)%expr _ | @expr.App
- _ _ _ s7 _ (@expr.Abs _ _ _ _ _ _) _ |
- @expr.App _ _ _ s7 _ (_ @ _)%expr_pat _ |
- @expr.App _ _ _ s7 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | _ => None
- end;;
- args <- invert_bind_args idc3 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc2 Raw.ident.Literal;
- args1 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args2 <- invert_bind_args idc0 Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_add_with_get_carry;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s3) -> (projT1 args0)) ->
- s4)%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s3) -> (projT1 args0)) ->
- s4)%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args2);
- v <- type.try_make_transport_cps s3 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- v0 <- type.try_make_transport_cps s4 ℤ;
- fv <- (x6 <- (let
- '(r1, r2)%zrange := range in
- fun (s5 : Z) (rc : zrange)
- (c : expr ℤ) (xx : Z)
- (ry : zrange) (y : expr ℤ) =>
- if
- (s5 =? 2 ^ Z.log2 s5) &&
- (ZRange.normalize ry <=?
- r[0 ~> s5 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_addc (Z.log2 s5) 0)%expr @
- (#(Z_cast rc)%expr @ c,
- (##xx)%expr,
- #(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x6, _) := xv in x6) args1
- (v (Compile.reflect x4))
- (let (x6, _) := xv0 in x6) args
- (v0 (Compile.reflect x5));
- Some (Base x6));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s4 _ ($_)%expr _ | @expr.App _ _ _ s4
- _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s4 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s4 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | @expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5 =>
+ | @expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t3 idc3) x6 =>
match x0 with
- | @expr.Ident _ _ _ t3 idc3 =>
- match x5 with
- | (@expr.Ident _ _ _ t4 idc4 @ x7 @ x6)%expr_pat =>
- match x7 with
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.Ident _ _ _ t8 idc8))%expr_pat =>
- match x6 with
- | @expr.Ident _ _ _ t9 idc9 =>
- args <- invert_bind_args idc9
- Raw.ident.Literal;
- args0 <- invert_bind_args idc8
- Raw.ident.Literal;
- args1 <- invert_bind_args idc7
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc6
- Raw.ident.Z_land;
- args3 <- invert_bind_args idc5
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc4
- Raw.ident.Z_shiftl;
- args5 <- invert_bind_args idc3
- Raw.ident.Literal;
- args6 <- invert_bind_args idc2
- Raw.ident.Z_cast;
- args7 <- invert_bind_args idc1
- Raw.ident.Z_cast;
- args8 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_add_with_get_carry;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> (ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args8) -> s3) ->
- (s10 -> (projT1 args0)) ->
- (projT1 args)) -> (projT1 args5))%ptype
- with
- | Some (_, _, (_, _, _), _)%zrange =>
- if
- type.type_beq base.type
- base.type.type_beq
- (((ℤ -> ℤ) -> (ℤ -> ℤ) -> ℤ) ->
- ℤ)%ptype
- ((((projT1 args8) -> s3) ->
- (s10 -> (projT1 args0)) ->
- (projT1 args)) ->
- (projT1 args5))%ptype
- then
- xv <- ident.unify
- pattern.ident.Literal
- ##(projT2 args8);
- v <- type.try_make_transport_cps s3 ℤ;
- v0 <- type.try_make_transport_cps s10 ℤ;
- xv0 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args0);
- xv1 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args);
- xv2 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args5);
- fv <- (x12 <- (let
- '(r1, r2)%zrange :=
- range in
- fun (s11 : Z)
- (rc : zrange)
- (c : expr ℤ)
- (rshiftl rland
- ry : zrange)
- (y : expr ℤ)
- (mask offset
- xx : Z) =>
- if
- (s11 =?
- 2 ^ Z.log2 s11) &&
- (ZRange.normalize
- rland <<
- ZRange.normalize
- (ZRange.constant
- offset) <=?
- ZRange.normalize
- rshiftl)%zrange &&
- (ZRange.normalize
- rshiftl <=?
- r[0 ~> s11 - 1])%zrange &&
- (ZRange.normalize
- ry &'
- ZRange.normalize
- (ZRange.constant
- mask) <=?
- ZRange.normalize
- rland)%zrange &&
- (mask =?
- Z.ones
- (Z.log2 s11 -
- offset)) &&
- (0 <=? offset) &&
- (offset <=?
- Z.log2 s11)
- then
- Some
- (#(Z_cast2
- (r1, r2))%expr @
- (#(fancy_addc
- (Z.log2
- s11)
- offset)%expr @
- (#(Z_cast rc)%expr @
- c,
- (##xx)%expr,
- #(Z_cast ry)%expr @
- y)))%expr_pat
- else None)
- (let (x12, _) :=
- xv in
- x12) args7
- (v
- (Compile.reflect
- x4)) args6
- args3 args1
- (v0
- (Compile.reflect
- x11))
- (let (x12, _) :=
- xv0 in
- x12)
- (let (x12, _) :=
- xv1 in
- x12)
- (let (x12, _) :=
- xv2 in
- x12);
- Some (Base x12));
- Some
- (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
- end
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- ($_)%expr))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.Abs _ _ _ _ _ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- (_ @ _)))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.LetIn _ _ _ _ _ _ _))%expr_pat =>
- None
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ ($_)%expr _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Abs _ _ _ _ _ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (_ @ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.LetIn _ _ _ _ _ _ _) _ @ _))%expr_pat =>
- None
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ #(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _
- _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _
- _ _ _ _ _ @ _))%expr_pat => None
- | (@expr.Ident _ _ _ t5 idc5 @ #(_))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _
- _ _ _)%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (#(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (($_)%expr @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _
- _ _ _ _ _)%expr_pat => None
- | _ => None
- end;;
- match x7 with
- | @expr.App _ _ _ s7 _
- (@expr.Ident _ _ _ t5 idc5) x8 =>
- match x6 with
- | @expr.Ident _ _ _ t6 idc6 =>
- args <- invert_bind_args idc6
- Raw.ident.Literal;
- args0 <- invert_bind_args idc5
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc4
- Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc3
- Raw.ident.Literal;
- args3 <- invert_bind_args idc2
- Raw.ident.Z_cast;
- args4 <- invert_bind_args idc1
- Raw.ident.Z_cast;
- args5 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_add_with_get_carry;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args5) -> s3) ->
- s7 -> (projT1 args)) ->
- (projT1 args2))%ptype
- with
- | Some (_, _, (_, _), _)%zrange =>
- if
- type.type_beq base.type
- base.type.type_beq
- (((ℤ -> ℤ) -> ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args5) -> s3) ->
- s7 -> (projT1 args)) ->
- (projT1 args2))%ptype
- then
- xv <- ident.unify
- pattern.ident.Literal
- ##(projT2 args5);
- v <- type.try_make_transport_cps s3 ℤ;
- v0 <- type.try_make_transport_cps s7 ℤ;
- xv0 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args);
- xv1 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args2);
- fv <- (x9 <- (let
- '(r1, r2)%zrange :=
- range in
- fun (s8 : Z)
- (rc : zrange)
- (c : expr ℤ)
- (rshiftr
- ry : zrange)
- (y : expr ℤ)
- (offset xx : Z)
- =>
- if
- (s8 =?
- 2 ^ Z.log2 s8) &&
- (ZRange.normalize
- ry >>
- ZRange.normalize
- (ZRange.constant
- offset) <=?
- ZRange.normalize
- rshiftr)%zrange &&
- (ZRange.normalize
- rshiftr <=?
- r[0 ~> s8 - 1])%zrange
- then
- Some
- (#(Z_cast2
- (r1, r2))%expr @
- (#(fancy_addc
- (Z.log2 s8)
- (- offset))%expr @
- (#(Z_cast rc)%expr @
- c,
- (##xx)%expr,
- #(Z_cast ry)%expr @
- y)))%expr_pat
- else None)
- (let (x9, _) :=
- xv in
- x9) args4
- (v
- (Compile.reflect
- x4)) args3
- args0
- (v0
- (Compile.reflect
- x8))
- (let (x9, _) :=
- xv0 in
- x9)
- (let (x9, _) :=
- xv1 in
- x9);
- Some (Base x9));
- Some
- (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
- end
- | @expr.App _ _ _ s7 _ ($_)%expr _ | @expr.App
- _ _ _ s7 _ (@expr.Abs _ _ _ _ _ _) _ |
- @expr.App _ _ _ s7 _ (_ @ _)%expr_pat _ |
- @expr.App _ _ _ s7 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | _ => None
- end;;
- args <- invert_bind_args idc3 Raw.ident.Literal;
- args0 <- invert_bind_args idc2 Raw.ident.Z_cast;
- args1 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args2 <- invert_bind_args idc0 Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_add_with_get_carry;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s3) -> s4) ->
- (projT1 args))%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s3) -> s4) ->
- (projT1 args))%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args2);
- v <- type.try_make_transport_cps s3 ℤ;
- v0 <- type.try_make_transport_cps s4 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x6 <- (let
- '(r1, r2)%zrange := range in
- fun (s5 : Z) (rc : zrange)
- (c : expr ℤ) (rx : zrange)
- (x6 : expr ℤ) (yy : Z) =>
- if
- (s5 =? 2 ^ Z.log2 s5) &&
- (ZRange.normalize
- (ZRange.constant yy) <=?
- r[0 ~> s5 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_addc (Z.log2 s5) 0)%expr @
- (#(Z_cast rc)%expr @ c,
- #(Z_cast rx)%expr @ x6,
- (##yy)%expr)))%expr_pat
- else None)
- (let (x6, _) := xv in x6) args1
- (v (Compile.reflect x4)) args0
- (v0 (Compile.reflect x5))
- (let (x6, _) := xv0 in x6);
- Some (Base x6));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t3 idc3)
- x6 =>
- match x6 with
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
- @expr.Ident _ _ _ t8 idc8)) @ @expr.Ident _ _
- _ t9 idc9)%expr_pat =>
- args <- invert_bind_args idc9 Raw.ident.Literal;
- args0 <- invert_bind_args idc8
- Raw.ident.Literal;
- args1 <- invert_bind_args idc7 Raw.ident.Z_cast;
- _ <- invert_bind_args idc6 Raw.ident.Z_land;
- args3 <- invert_bind_args idc5 Raw.ident.Z_cast;
- _ <- invert_bind_args idc4 Raw.ident.Z_shiftl;
- args5 <- invert_bind_args idc3 Raw.ident.Z_cast;
- args6 <- invert_bind_args idc2 Raw.ident.Z_cast;
- args7 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args8 <- invert_bind_args idc0
+ | @expr.App _ _ _ s6 _ (@expr.Ident _ _ _ t4 idc4)
+ x7 =>
+ match x7 with
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @
+ (@expr.Ident _ _ _ t11 idc11 @ @expr.Ident _ _ _
+ t12 idc12))%expr_pat =>
+ args <- invert_bind_args idc12
+ Raw.ident.Literal;
+ args0 <- invert_bind_args idc11
+ Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc10
Raw.ident.Literal;
+ args2 <- invert_bind_args idc9 Raw.ident.Z_cast;
+ args3 <- invert_bind_args idc8 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc7 Raw.ident.Z_land;
+ args5 <- invert_bind_args idc6 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc5 Raw.ident.Z_shiftl;
+ args7 <- invert_bind_args idc4 Raw.ident.Z_cast;
+ args8 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args9 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args10 <- invert_bind_args idc1
+ Raw.ident.Literal;
+ args11 <- invert_bind_args idc0
+ Raw.ident.Z_cast;
_ <- invert_bind_args idc
Raw.ident.Z_add_with_get_carry;
match
pattern.type.unify_extracted
(((ℤ -> ℤ) -> ℤ) -> (ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args8) -> s3) -> s4) ->
- (s11 -> (projT1 args0)) -> (projT1 args))%ptype
+ ((((projT1 args10) -> s4) -> s5) ->
+ (s12 -> (projT1 args1)) -> (projT1 args))%ptype
with
| Some (_, _, _, (_, _, _))%zrange =>
if
type.type_beq base.type base.type.type_beq
(((ℤ -> ℤ) -> ℤ) -> (ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args8) -> s3) -> s4) ->
- (s11 -> (projT1 args0)) ->
+ ((((projT1 args10) -> s4) -> s5) ->
+ (s12 -> (projT1 args1)) ->
(projT1 args))%ptype
then
xv <- ident.unify pattern.ident.Literal
- ##(projT2 args8);
- v <- type.try_make_transport_cps s3 ℤ;
- v0 <- type.try_make_transport_cps s4 ℤ;
- v1 <- type.try_make_transport_cps s11 ℤ;
+ ##(projT2 args10);
+ v <- type.try_make_transport_cps s4 ℤ;
+ v0 <- type.try_make_transport_cps s5 ℤ;
+ v1 <- type.try_make_transport_cps s12 ℤ;
xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
+ ##(projT2 args1);
xv1 <- ident.unify pattern.ident.Literal
##(projT2 args);
- fv <- (x13 <- (let
+ fv <- (x16 <- (let
'(r1, r2)%zrange := range
in
- fun (s12 : Z)
- (rc : zrange)
+ fun (rs : zrange)
+ (s15 : Z) (rc : zrange)
(c : expr ℤ)
(rx : zrange)
- (x13 : expr ℤ)
+ (x16 : expr ℤ)
(rshiftl rland
ry : zrange)
(y : expr ℤ)
- (mask offset : Z) =>
+ (rmask : zrange)
+ (mask : Z)
+ (roffset : zrange)
+ (offset : Z) =>
if
- (s12 =? 2 ^ Z.log2 s12) &&
+ (s15 =? 2 ^ Z.log2 s15) &&
(ZRange.normalize rland <<
ZRange.normalize
(ZRange.constant
@@ -7434,2039 +4726,1031 @@ match idc in (Compilers.ident t) return (Compile.value' true t) with
(ZRange.constant mask) <=?
ZRange.normalize rland)%zrange &&
(ZRange.normalize rshiftl <=?
- r[0 ~> s12 - 1])%zrange &&
+ r[0 ~> s15 - 1])%zrange &&
(mask =?
Z.ones
- (Z.log2 s12 - offset)) &&
+ (Z.log2 s15 - offset)) &&
(0 <=? offset) &&
- (offset <=? Z.log2 s12)
+ (offset <=? Z.log2 s15) &&
+ is_bounded_by_bool s15
+ (ZRange.normalize rs) &&
+ is_bounded_by_bool mask
+ (ZRange.normalize rmask) &&
+ is_bounded_by_bool offset
+ (ZRange.normalize
+ roffset)
then
Some
(#(Z_cast2 (r1, r2))%expr @
(#(fancy_addc
- (Z.log2 s12)
+ (Z.log2 s15)
offset)%expr @
(#(Z_cast rc)%expr @
c,
#(Z_cast rx)%expr @
- x13,
+ x16,
#(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x13, _) := xv in x13)
- args7
- (v (Compile.reflect x4))
- args6
- (v0 (Compile.reflect x5))
- args5 args3 args1
- (v1 (Compile.reflect x12))
- (let (x13, _) := xv0 in
- x13)
- (let (x13, _) := xv1 in
- x13);
- Some (Base x13));
+ else None) args11
+ (let (x16, _) := xv in x16)
+ args9
+ (v (Compile.reflect x5))
+ args8
+ (v0 (Compile.reflect x6))
+ args7 args5 args3
+ (v1 (Compile.reflect x13))
+ args2
+ (let (x16, _) := xv0 in
+ x16) args0
+ (let (x16, _) := xv1 in
+ x16);
+ Some (Base x16));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
- @expr.Ident _ _ _ t8 idc8)) @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
- @expr.Ident _ _ _ t8 idc8)) @ @expr.Abs _ _ _
- _ _ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
- @expr.Ident _ _ _ t8 idc8)) @ (_ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
- @expr.Ident _ _ _ t8 idc8)) @ @expr.LetIn _ _
- _ _ _ _ _)%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @
+ (@expr.Ident _ _ _ t11 idc11 @ ($_)%expr))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @
+ (@expr.Ident _ _ _ t11 idc11 @ @expr.Abs _ _ _ _
+ _ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @
+ (@expr.Ident _ _ _ t11 idc11 @ (_ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @
+ (@expr.Ident _ _ _ t11 idc11 @ @expr.LetIn _ _ _
+ _ _ _ _))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @ #(_))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @ (($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @ (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @ (_ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @ @expr.LetIn _ _ _ _ _ _ _)%expr_pat =>
+ None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ ($_)%expr))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Abs _ _ _ _
+ _ _))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ (_ @ _)))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.LetIn _ _ _
+ _ _ _ _))) @ _)%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @ #
+ (_))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
($_)%expr)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
@expr.Abs _ _ _ _ _ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
- (_ @ _))) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (($_)%expr @ _))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Abs _ _ _ _ _ _ @ _))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (_ @ _ @ _))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
@expr.LetIn _ _ _ _ _ _ _)) @ _)%expr_pat =>
None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ ($_)%expr _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Abs _ _ _ _ _ _) _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (_ @ _) _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.LetIn _ _ _ _ _ _ _) _ @ _)) @ _)%expr_pat =>
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ ($_)%expr _ @ _)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Abs _ _ _ _ _ _) _ @ _)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (_ @ _) _ @ _)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.LetIn _ _ _ _ _ _ _) _ @ _)) @ _)%expr_pat =>
None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ #(_) @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr @ _)) @
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ #(_) @ _)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ ($_)%expr @ _)) @
_)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _ _
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Abs _ _ _ _
_ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _ _
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.LetIn _ _ _
_ _ _ _ @ _)) @ _)%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ #(_)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ #(_)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _ _ _
_) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ (#(_) @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _)) @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ (#(_) @ _)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ (($_)%expr @ _)) @
_)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
(@expr.Abs _ _ _ _ _ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _ @ _)) @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ (($_)%expr @ _ @ _)) @
_)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
(@expr.Abs _ _ _ _ _ _ @ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _ @ _)) @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ (_ @ _ @ _ @ _)) @
_)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
(@expr.LetIn _ _ _ _ _ _ _ @ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
(@expr.LetIn _ _ _ _ _ _ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _ _ _
_ _ _) @ _)%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @ #(_) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ ($_)%expr @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.Abs _ _ _ _ _
+ | (@expr.Ident _ _ _ t5 idc5 @ #(_) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _
_ @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
(@expr.Abs _ _ _ _ _ _ @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (_ @ _ @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
(@expr.LetIn _ _ _ _ _ _ _ @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.LetIn _ _ _ _
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _
_ _ _ @ _)%expr_pat => None
| _ => None
end;;
- match x5 with
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
- @expr.Ident _ _ _ t8 idc8)) @ @expr.Ident _ _
- _ t9 idc9)%expr_pat =>
- args <- invert_bind_args idc9 Raw.ident.Literal;
- args0 <- invert_bind_args idc8
- Raw.ident.Literal;
- args1 <- invert_bind_args idc7 Raw.ident.Z_cast;
- _ <- invert_bind_args idc6 Raw.ident.Z_land;
- args3 <- invert_bind_args idc5 Raw.ident.Z_cast;
- _ <- invert_bind_args idc4 Raw.ident.Z_shiftl;
- args5 <- invert_bind_args idc3 Raw.ident.Z_cast;
- args6 <- invert_bind_args idc2 Raw.ident.Z_cast;
- args7 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args8 <- invert_bind_args idc0
+ match x6 with
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @
+ (@expr.Ident _ _ _ t11 idc11 @ @expr.Ident _ _ _
+ t12 idc12))%expr_pat =>
+ args <- invert_bind_args idc12
+ Raw.ident.Literal;
+ args0 <- invert_bind_args idc11
+ Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc10
Raw.ident.Literal;
+ args2 <- invert_bind_args idc9 Raw.ident.Z_cast;
+ args3 <- invert_bind_args idc8 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc7 Raw.ident.Z_land;
+ args5 <- invert_bind_args idc6 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc5 Raw.ident.Z_shiftl;
+ args7 <- invert_bind_args idc4 Raw.ident.Z_cast;
+ args8 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args9 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args10 <- invert_bind_args idc1
+ Raw.ident.Literal;
+ args11 <- invert_bind_args idc0
+ Raw.ident.Z_cast;
_ <- invert_bind_args idc
Raw.ident.Z_add_with_get_carry;
match
pattern.type.unify_extracted
(((ℤ -> ℤ) -> (ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args8) -> s3) ->
- (s11 -> (projT1 args0)) -> (projT1 args)) ->
- s5)%ptype
+ ((((projT1 args10) -> s4) ->
+ (s12 -> (projT1 args1)) -> (projT1 args)) ->
+ s6)%ptype
with
| Some (_, _, (_, _, _), _)%zrange =>
if
type.type_beq base.type base.type.type_beq
(((ℤ -> ℤ) -> (ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args8) -> s3) ->
- (s11 -> (projT1 args0)) ->
- (projT1 args)) -> s5)%ptype
+ ((((projT1 args10) -> s4) ->
+ (s12 -> (projT1 args1)) ->
+ (projT1 args)) -> s6)%ptype
then
xv <- ident.unify pattern.ident.Literal
- ##(projT2 args8);
- v <- type.try_make_transport_cps s3 ℤ;
- v0 <- type.try_make_transport_cps s11 ℤ;
+ ##(projT2 args10);
+ v <- type.try_make_transport_cps s4 ℤ;
+ v0 <- type.try_make_transport_cps s12 ℤ;
xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
+ ##(projT2 args1);
xv1 <- ident.unify pattern.ident.Literal
##(projT2 args);
- v1 <- type.try_make_transport_cps s5 ℤ;
- fv <- (x13 <- (let
+ v1 <- type.try_make_transport_cps s6 ℤ;
+ fv <- (x16 <- (let
'(r1, r2)%zrange := range
in
- fun (s12 : Z)
- (rc : zrange)
+ fun (rs : zrange)
+ (s15 : Z) (rc : zrange)
(c : expr ℤ)
(rshiftl rland
ry : zrange)
(y : expr ℤ)
- (mask offset : Z)
+ (rmask : zrange)
+ (mask : Z)
+ (roffset : zrange)
+ (offset : Z)
(rx : zrange)
- (x13 : expr ℤ) =>
+ (x16 : expr ℤ) =>
if
- (s12 =? 2 ^ Z.log2 s12) &&
+ (s15 =? 2 ^ Z.log2 s15) &&
(ZRange.normalize rland <<
ZRange.normalize
(ZRange.constant
offset) <=?
ZRange.normalize rshiftl)%zrange &&
(ZRange.normalize rshiftl <=?
- r[0 ~> s12 - 1])%zrange &&
+ r[0 ~> s15 - 1])%zrange &&
(ZRange.normalize ry &'
ZRange.normalize
(ZRange.constant mask) <=?
ZRange.normalize rland)%zrange &&
(mask =?
Z.ones
- (Z.log2 s12 - offset)) &&
+ (Z.log2 s15 - offset)) &&
(0 <=? offset) &&
- (offset <=? Z.log2 s12)
+ (offset <=? Z.log2 s15) &&
+ is_bounded_by_bool s15
+ (ZRange.normalize rs) &&
+ is_bounded_by_bool mask
+ (ZRange.normalize rmask) &&
+ is_bounded_by_bool offset
+ (ZRange.normalize
+ roffset)
then
Some
(#(Z_cast2 (r1, r2))%expr @
(#(fancy_addc
- (Z.log2 s12)
+ (Z.log2 s15)
offset)%expr @
(#(Z_cast rc)%expr @
c,
#(Z_cast rx)%expr @
- x13,
+ x16,
#(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x13, _) := xv in x13)
- args7
- (v (Compile.reflect x4))
- args6 args3 args1
- (v0 (Compile.reflect x12))
- (let (x13, _) := xv0 in
- x13)
- (let (x13, _) := xv1 in
- x13) args5
- (v1 (Compile.reflect x6));
- Some (Base x13));
+ else None) args11
+ (let (x16, _) := xv in x16)
+ args9
+ (v (Compile.reflect x5))
+ args8 args5 args3
+ (v0 (Compile.reflect x13))
+ args2
+ (let (x16, _) := xv0 in
+ x16) args0
+ (let (x16, _) := xv1 in
+ x16) args7
+ (v1 (Compile.reflect x7));
+ Some (Base x16));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
- @expr.Ident _ _ _ t8 idc8)) @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
- @expr.Ident _ _ _ t8 idc8)) @ @expr.Abs _ _ _
- _ _ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
- @expr.Ident _ _ _ t8 idc8)) @ (_ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
- @expr.Ident _ _ _ t8 idc8)) @ @expr.LetIn _ _
- _ _ _ _ _)%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @
+ (@expr.Ident _ _ _ t11 idc11 @ ($_)%expr))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @
+ (@expr.Ident _ _ _ t11 idc11 @ @expr.Abs _ _ _ _
+ _ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @
+ (@expr.Ident _ _ _ t11 idc11 @ (_ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @
+ (@expr.Ident _ _ _ t11 idc11 @ @expr.LetIn _ _ _
+ _ _ _ _))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @ #(_))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @ (($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @ (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @ (_ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _ _ _
+ t10 idc10))) @ @expr.LetIn _ _ _ _ _ _ _)%expr_pat =>
+ None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ ($_)%expr))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Abs _ _ _ _
+ _ _))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ (_ @ _)))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.LetIn _ _ _
+ _ _ _ _))) @ _)%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @ #
+ (_))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
($_)%expr)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
@expr.Abs _ _ _ _ _ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
- (_ @ _))) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (($_)%expr @ _))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Abs _ _ _ _ _ _ @ _))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (_ @ _ @ _))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _))) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
@expr.LetIn _ _ _ _ _ _ _)) @ _)%expr_pat =>
None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ ($_)%expr _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Abs _ _ _ _ _ _) _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (_ @ _) _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.LetIn _ _ _ _ _ _ _) _ @ _)) @ _)%expr_pat =>
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ ($_)%expr _ @ _)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Abs _ _ _ _ _ _) _ @ _)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (_ @ _) _ @ _)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.LetIn _ _ _ _ _ _ _) _ @ _)) @ _)%expr_pat =>
None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ #(_) @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr @ _)) @
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ #(_) @ _)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ ($_)%expr @ _)) @
_)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _ _
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Abs _ _ _ _
_ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _ _
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.LetIn _ _ _
_ _ _ _ @ _)) @ _)%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ #(_)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _
+ | (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ #(_)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _ _ _
_) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ (#(_) @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _)) @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ (#(_) @ _)) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ (($_)%expr @ _)) @
_)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
(@expr.Abs _ _ _ _ _ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _ @ _)) @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ (($_)%expr @ _ @ _)) @
_)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
(@expr.Abs _ _ _ _ _ _ @ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _ @ _)) @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ (_ @ _ @ _ @ _)) @
_)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
(@expr.LetIn _ _ _ _ _ _ _ @ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
(@expr.LetIn _ _ _ _ _ _ _ @ _)) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
- (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _
+ (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _ _ _
_ _ _) @ _)%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @ #(_) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ ($_)%expr @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.Abs _ _ _ _ _
+ | (@expr.Ident _ _ _ t5 idc5 @ #(_) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _
_ @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (($_)%expr @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
(@expr.Abs _ _ _ _ _ _ @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ (_ @ _ @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @
+ (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @
(@expr.LetIn _ _ _ _ _ _ _ @ _) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.LetIn _ _ _ _
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _
_ _ _ @ _)%expr_pat => None
| _ => None
end;;
- match x6 with
- | (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s8 _
- (@expr.Ident _ _ _ t5 idc5) x9 @ @expr.Ident _ _
- _ t6 idc6)%expr_pat =>
- args <- invert_bind_args idc6 Raw.ident.Literal;
- args0 <- invert_bind_args idc5 Raw.ident.Z_cast;
- _ <- invert_bind_args idc4 Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc3 Raw.ident.Z_cast;
- args3 <- invert_bind_args idc2 Raw.ident.Z_cast;
- args4 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args5 <- invert_bind_args idc0
+ match x7 with
+ | (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Ident _ _ _
+ t8 idc8))%expr_pat =>
+ args <- invert_bind_args idc8 Raw.ident.Literal;
+ args0 <- invert_bind_args idc7 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc6 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc5 Raw.ident.Z_shiftr;
+ args3 <- invert_bind_args idc4 Raw.ident.Z_cast;
+ args4 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args5 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args6 <- invert_bind_args idc1
Raw.ident.Literal;
+ args7 <- invert_bind_args idc0 Raw.ident.Z_cast;
_ <- invert_bind_args idc
Raw.ident.Z_add_with_get_carry;
match
pattern.type.unify_extracted
(((ℤ -> ℤ) -> ℤ) -> ℤ -> ℤ)%ptype
- ((((projT1 args5) -> s3) -> s4) ->
- s8 -> (projT1 args))%ptype
+ ((((projT1 args6) -> s4) -> s5) ->
+ s9 -> (projT1 args))%ptype
with
| Some (_, _, _, (_, _))%zrange =>
if
type.type_beq base.type base.type.type_beq
(((ℤ -> ℤ) -> ℤ) -> ℤ -> ℤ)%ptype
- ((((projT1 args5) -> s3) -> s4) ->
- s8 -> (projT1 args))%ptype
+ ((((projT1 args6) -> s4) -> s5) ->
+ s9 -> (projT1 args))%ptype
then
xv <- ident.unify pattern.ident.Literal
- ##(projT2 args5);
- v <- type.try_make_transport_cps s3 ℤ;
- v0 <- type.try_make_transport_cps s4 ℤ;
- v1 <- type.try_make_transport_cps s8 ℤ;
+ ##(projT2 args6);
+ v <- type.try_make_transport_cps s4 ℤ;
+ v0 <- type.try_make_transport_cps s5 ℤ;
+ v1 <- type.try_make_transport_cps s9 ℤ;
xv0 <- ident.unify pattern.ident.Literal
##(projT2 args);
- fv <- (x10 <- (let
+ fv <- (x12 <- (let
'(r1, r2)%zrange := range
in
- fun (s9 : Z) (rc : zrange)
+ fun (rs : zrange)
+ (s11 : Z) (rc : zrange)
(c : expr ℤ)
(rx : zrange)
- (x10 : expr ℤ)
+ (x12 : expr ℤ)
(rshiftr ry : zrange)
(y : expr ℤ)
+ (roffset : zrange)
(offset : Z) =>
if
- (s9 =? 2 ^ Z.log2 s9) &&
+ (s11 =? 2 ^ Z.log2 s11) &&
(ZRange.normalize ry >>
ZRange.normalize
(ZRange.constant
offset) <=?
ZRange.normalize rshiftr)%zrange &&
(ZRange.normalize rshiftr <=?
- r[0 ~> s9 - 1])%zrange
+ r[0 ~> s11 - 1])%zrange &&
+ is_bounded_by_bool s11
+ (ZRange.normalize rs) &&
+ is_bounded_by_bool offset
+ (ZRange.normalize
+ roffset)
then
Some
(#(Z_cast2 (r1, r2))%expr @
(#(fancy_addc
- (Z.log2 s9)
+ (Z.log2 s11)
(- offset))%expr @
(#(Z_cast rc)%expr @
c,
#(Z_cast rx)%expr @
- x10,
+ x12,
#(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x10, _) := xv in x10)
+ else None) args7
+ (let (x12, _) := xv in x12)
+ args5
+ (v (Compile.reflect x5))
args4
- (v (Compile.reflect x4))
- args3
- (v0 (Compile.reflect x5))
- args2 args0
- (v1 (Compile.reflect x9))
- (let (x10, _) := xv0 in
- x10);
- Some (Base x10));
+ (v0 (Compile.reflect x6))
+ args3 args1
+ (v1 (Compile.reflect x10))
+ args0
+ (let (x12, _) := xv0 in
+ x12);
+ Some (Base x12));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end
- | (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s8 _
- (@expr.Ident _ _ _ t5 idc5) x9 @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s8 _
- (@expr.Ident _ _ _ t5 idc5) x9 @ @expr.Abs _ _ _
- _ _ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s8 _
- (@expr.Ident _ _ _ t5 idc5) x9 @ (_ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s8 _
- (@expr.Ident _ _ _ t5 idc5) x9 @ @expr.LetIn _ _
- _ _ _ _ _)%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s8 _
+ | (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @
+ (@expr.Ident _ _ _ t7 idc7 @ ($_)%expr))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Abs _ _ _ _ _
+ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @
+ (@expr.Ident _ _ _ t7 idc7 @ (_ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.LetIn _ _ _ _
+ _ _ _))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @ #(_))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @ @expr.Abs _ _
+ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @
+ (($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @
+ (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @ (_ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @ @expr.LetIn _
+ _ _ _ _ _ _)%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
($_)%expr _ @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s8 _
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
(@expr.Abs _ _ _ _ _ _) _ @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s8 _
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
(_ @ _) _ @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s8 _
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
(@expr.LetIn _ _ _ _ _ _ _) _ @ _)%expr_pat =>
None
- | (@expr.Ident _ _ _ t4 idc4 @ #(_) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ ($_)%expr @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.Abs _ _ _ _ _
+ | (@expr.Ident _ _ _ t5 idc5 @ #(_) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _
_ @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.LetIn _ _ _ _
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _
_ _ _ @ _)%expr_pat => None
| _ => None
end;;
- match x5 with
- | (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s8 _
- (@expr.Ident _ _ _ t5 idc5) x9 @ @expr.Ident _ _
- _ t6 idc6)%expr_pat =>
- args <- invert_bind_args idc6 Raw.ident.Literal;
- args0 <- invert_bind_args idc5 Raw.ident.Z_cast;
- _ <- invert_bind_args idc4 Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc3 Raw.ident.Z_cast;
- args3 <- invert_bind_args idc2 Raw.ident.Z_cast;
- args4 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args5 <- invert_bind_args idc0
+ match x6 with
+ | (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Ident _ _ _
+ t8 idc8))%expr_pat =>
+ args <- invert_bind_args idc8 Raw.ident.Literal;
+ args0 <- invert_bind_args idc7 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc6 Raw.ident.Z_cast;
+ _ <- invert_bind_args idc5 Raw.ident.Z_shiftr;
+ args3 <- invert_bind_args idc4 Raw.ident.Z_cast;
+ args4 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args5 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args6 <- invert_bind_args idc1
Raw.ident.Literal;
+ args7 <- invert_bind_args idc0 Raw.ident.Z_cast;
_ <- invert_bind_args idc
Raw.ident.Z_add_with_get_carry;
match
pattern.type.unify_extracted
(((ℤ -> ℤ) -> ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args5) -> s3) ->
- s8 -> (projT1 args)) -> s5)%ptype
+ ((((projT1 args6) -> s4) ->
+ s9 -> (projT1 args)) -> s6)%ptype
with
| Some (_, _, (_, _), _)%zrange =>
if
type.type_beq base.type base.type.type_beq
(((ℤ -> ℤ) -> ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args5) -> s3) ->
- s8 -> (projT1 args)) -> s5)%ptype
+ ((((projT1 args6) -> s4) ->
+ s9 -> (projT1 args)) -> s6)%ptype
then
xv <- ident.unify pattern.ident.Literal
- ##(projT2 args5);
- v <- type.try_make_transport_cps s3 ℤ;
- v0 <- type.try_make_transport_cps s8 ℤ;
+ ##(projT2 args6);
+ v <- type.try_make_transport_cps s4 ℤ;
+ v0 <- type.try_make_transport_cps s9 ℤ;
xv0 <- ident.unify pattern.ident.Literal
##(projT2 args);
- v1 <- type.try_make_transport_cps s5 ℤ;
- fv <- (x10 <- (let
+ v1 <- type.try_make_transport_cps s6 ℤ;
+ fv <- (x12 <- (let
'(r1, r2)%zrange := range
in
- fun (s9 : Z) (rc : zrange)
+ fun (rs : zrange)
+ (s11 : Z) (rc : zrange)
(c : expr ℤ)
(rshiftr ry : zrange)
(y : expr ℤ)
+ (roffset : zrange)
(offset : Z)
(rx : zrange)
- (x10 : expr ℤ) =>
+ (x12 : expr ℤ) =>
if
- (s9 =? 2 ^ Z.log2 s9) &&
+ (s11 =? 2 ^ Z.log2 s11) &&
(ZRange.normalize ry >>
ZRange.normalize
(ZRange.constant
offset) <=?
ZRange.normalize rshiftr)%zrange &&
(ZRange.normalize rshiftr <=?
- r[0 ~> s9 - 1])%zrange
+ r[0 ~> s11 - 1])%zrange &&
+ is_bounded_by_bool s11
+ (ZRange.normalize rs) &&
+ is_bounded_by_bool offset
+ (ZRange.normalize
+ roffset)
then
Some
(#(Z_cast2 (r1, r2))%expr @
(#(fancy_addc
- (Z.log2 s9)
+ (Z.log2 s11)
(- offset))%expr @
(#(Z_cast rc)%expr @
c,
#(Z_cast rx)%expr @
- x10,
+ x12,
#(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x10, _) := xv in x10)
- args4
- (v (Compile.reflect x4))
- args3 args0
- (v0 (Compile.reflect x9))
- (let (x10, _) := xv0 in
- x10) args2
- (v1 (Compile.reflect x6));
- Some (Base x10));
+ else None) args7
+ (let (x12, _) := xv in x12)
+ args5
+ (v (Compile.reflect x5))
+ args4 args1
+ (v0 (Compile.reflect x10))
+ args0
+ (let (x12, _) := xv0 in
+ x12) args3
+ (v1 (Compile.reflect x7));
+ Some (Base x12));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end
- | (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s8 _
- (@expr.Ident _ _ _ t5 idc5) x9 @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s8 _
- (@expr.Ident _ _ _ t5 idc5) x9 @ @expr.Abs _ _ _
- _ _ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s8 _
- (@expr.Ident _ _ _ t5 idc5) x9 @ (_ @ _))%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s8 _
- (@expr.Ident _ _ _ t5 idc5) x9 @ @expr.LetIn _ _
- _ _ _ _ _)%expr_pat => None
- | (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s8 _
+ | (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @
+ (@expr.Ident _ _ _ t7 idc7 @ ($_)%expr))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Abs _ _ _ _ _
+ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @
+ (@expr.Ident _ _ _ t7 idc7 @ (_ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.LetIn _ _ _ _
+ _ _ _))%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @ #(_))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @ @expr.Abs _ _
+ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @
+ (($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @
+ (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @ (_ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 @ @expr.LetIn _
+ _ _ _ _ _ _)%expr_pat => None
+ | (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
($_)%expr _ @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s8 _
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
(@expr.Abs _ _ _ _ _ _) _ @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s8 _
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
(_ @ _) _ @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.App _ _ _ s8 _
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.App _ _ _ s9 _
(@expr.LetIn _ _ _ _ _ _ _) _ @ _)%expr_pat =>
None
- | (@expr.Ident _ _ _ t4 idc4 @ #(_) @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ ($_)%expr @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.Abs _ _ _ _ _
+ | (@expr.Ident _ _ _ t5 idc5 @ #(_) @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr @ _)%expr_pat |
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _ _ _
_ @ _)%expr_pat |
- (@expr.Ident _ _ _ t4 idc4 @ @expr.LetIn _ _ _ _
+ (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _ _ _
_ _ _ @ _)%expr_pat => None
| _ => None
end;;
- args <- invert_bind_args idc3 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc2 Raw.ident.Z_cast;
- args1 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args2 <- invert_bind_args idc0 Raw.ident.Literal;
+ args <- invert_bind_args idc4 Raw.ident.Z_cast;
+ args0 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args2 <- invert_bind_args idc1 Raw.ident.Literal;
+ args3 <- invert_bind_args idc0 Raw.ident.Z_cast;
_ <- invert_bind_args idc
Raw.ident.Z_add_with_get_carry;
match
pattern.type.unify_extracted
(((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s3) -> s4) -> s5)%ptype
+ ((((projT1 args2) -> s4) -> s5) -> s6)%ptype
with
| Some (_, _, _, _)%zrange =>
if
type.type_beq base.type base.type.type_beq
(((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s3) -> s4) -> s5)%ptype
+ ((((projT1 args2) -> s4) -> s5) -> s6)%ptype
then
xv <- ident.unify pattern.ident.Literal
##(projT2 args2);
- v <- type.try_make_transport_cps s3 ℤ;
- v0 <- type.try_make_transport_cps s4 ℤ;
- v1 <- type.try_make_transport_cps s5 ℤ;
- fv <- (x7 <- (let
+ v <- type.try_make_transport_cps s4 ℤ;
+ v0 <- type.try_make_transport_cps s5 ℤ;
+ v1 <- type.try_make_transport_cps s6 ℤ;
+ fv <- (x8 <- (let
'(r1, r2)%zrange := range in
- fun (s6 : Z) (rc : zrange)
- (c : expr ℤ) (rx : zrange)
- (x7 : expr ℤ) (ry : zrange)
- (y : expr ℤ) =>
+ fun (rs : zrange) (s7 : Z)
+ (rc : zrange) (c : expr ℤ)
+ (rx : zrange) (x8 : expr ℤ)
+ (ry : zrange) (y : expr ℤ) =>
if
- (s6 =? 2 ^ Z.log2 s6) &&
+ (s7 =? 2 ^ Z.log2 s7) &&
(ZRange.normalize ry <=?
- r[0 ~> s6 - 1])%zrange
+ r[0 ~> s7 - 1])%zrange &&
+ is_bounded_by_bool s7
+ (ZRange.normalize rs)
then
Some
(#(Z_cast2 (r1, r2))%expr @
- (#(fancy_addc (Z.log2 s6) 0)%expr @
+ (#(fancy_addc (Z.log2 s7) 0)%expr @
(#(Z_cast rc)%expr @ c,
- #(Z_cast rx)%expr @ x7,
+ #(Z_cast rx)%expr @ x8,
#(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x7, _) := xv in x7) args1
- (v (Compile.reflect x4)) args0
- (v0 (Compile.reflect x5)) args
- (v1 (Compile.reflect x6));
- Some (Base x7));
+ else None) args3
+ (let (x8, _) := xv in x8) args1
+ (v (Compile.reflect x5)) args0
+ (v0 (Compile.reflect x6)) args
+ (v1 (Compile.reflect x7));
+ Some (Base x8));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end
- | @expr.App _ _ _ s5 _ ($_)%expr _ | @expr.App _ _ _ s5
- _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s5 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s5 _
+ | @expr.App _ _ _ s6 _ ($_)%expr _ | @expr.App _ _ _ s6
+ _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s6 _
+ (_ @ _)%expr_pat _ | @expr.App _ _ _ s6 _
(@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end
- | @expr.App _ _ _ s4 _ ($_)%expr _ | @expr.App _ _ _ s4 _
- (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s4 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s4 _
+ | @expr.App _ _ _ s5 _ ($_)%expr _ | @expr.App _ _ _ s5 _
+ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s5 _
+ (_ @ _)%expr_pat _ | @expr.App _ _ _ s5 _
(@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end
- | @expr.App _ _ _ s3 _ ($_)%expr _ | @expr.App _ _ _ s3 _
- (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s3 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s3 _
+ | @expr.App _ _ _ s4 _ ($_)%expr _ | @expr.App _ _ _ s4 _
+ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s4 _
+ (_ @ _)%expr_pat _ | @expr.App _ _ _ s4 _
(@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end
+ | (@expr.Ident _ _ _ t0 idc0 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t0 idc0 @ (_ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.LetIn _ _ _ _ _ _ _)%expr_pat =>
+ None
| _ => None
end;;
match x3 with
- | @expr.Ident _ _ _ t0 idc0 =>
+ | (@expr.Ident _ _ _ t0 idc0 @ @expr.Ident _ _ _ t1 idc1)%expr_pat =>
match x2 with
- | @expr.Ident _ _ _ t1 idc1 =>
- match x1 with
- | @expr.Ident _ _ _ t2 idc2 =>
- match x0 with
- | @expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t3 idc3)
- x4 =>
- match x4 with
- | (@expr.Ident _ _ _ t4 idc4 @ x6 @ x5)%expr_pat =>
- match x6 with
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (@expr.Ident _ _ _ t7 idc7) x10 @
- @expr.Ident _ _ _ t8 idc8))%expr_pat =>
- match x5 with
- | @expr.Ident _ _ _ t9 idc9 =>
- args <- invert_bind_args idc9
- Raw.ident.Literal;
- args0 <- invert_bind_args idc8
- Raw.ident.Literal;
- args1 <- invert_bind_args idc7
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc6
- Raw.ident.Z_land;
- args3 <- invert_bind_args idc5
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc4
- Raw.ident.Z_shiftl;
- args5 <- invert_bind_args idc3
- Raw.ident.Z_cast;
- args6 <- invert_bind_args idc2
- Raw.ident.Literal;
- args7 <- invert_bind_args idc1
- Raw.ident.Literal;
- args8 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_sub_with_get_borrow;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> (ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args8) -> (projT1 args7)) ->
- (projT1 args6)) ->
- (s9 -> (projT1 args0)) ->
- (projT1 args))%ptype
- with
- | Some (_, _, _, (_, _, _))%zrange =>
- if
- type.type_beq base.type
- base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) ->
- (ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args8) ->
- (projT1 args7)) ->
- (projT1 args6)) ->
- (s9 -> (projT1 args0)) ->
- (projT1 args))%ptype
- then
- xv <- ident.unify
- pattern.ident.Literal
- ##(projT2 args8);
- xv0 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args7);
- xv1 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args6);
- v <- type.try_make_transport_cps s9 ℤ;
- xv2 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args0);
- xv3 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args);
- fv <- (x11 <- (let
- '(r1, r2)%zrange :=
- range in
- fun
- (s10 bb xx : Z)
- (rshiftl rland
- ry : zrange)
- (y : expr ℤ)
- (mask
- offset : Z) =>
- if
- (s10 =?
- 2 ^ Z.log2 s10) &&
- (ZRange.normalize
- rland <<
- ZRange.normalize
- (ZRange.constant
- offset) <=?
- ZRange.normalize
- rshiftl)%zrange &&
- (ZRange.normalize
- rshiftl <=?
- r[0 ~> s10 - 1])%zrange &&
- (ZRange.normalize
- ry &'
- ZRange.normalize
- (ZRange.constant
- mask) <=?
- ZRange.normalize
- rland)%zrange &&
- (mask =?
- Z.ones
- (Z.log2 s10 -
- offset)) &&
- (0 <=? offset) &&
- (offset <=?
- Z.log2 s10)
- then
- Some
- (#(Z_cast2
- (r1, r2))%expr @
- (#(fancy_subb
- (Z.log2
- s10)
- offset)%expr @
- ((##bb)%expr,
- (##xx)%expr,
- #(Z_cast ry)%expr @
- y)))%expr_pat
- else None)
- (let (x11, _) :=
- xv in
- x11)
- (let (x11, _) :=
- xv0 in
- x11)
- (let (x11, _) :=
- xv1 in
- x11) args5 args3
- args1
- (v
- (Compile.reflect
- x10))
- (let (x11, _) :=
- xv2 in
- x11)
- (let (x11, _) :=
- xv3 in
- x11);
- Some (Base x11));
- Some
- (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
- end
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (@expr.Ident _ _ _ t7 idc7) x10 @
- ($_)%expr))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (@expr.Ident _ _ _ t7 idc7) x10 @
- @expr.Abs _ _ _ _ _ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (@expr.Ident _ _ _ t7 idc7) x10 @
- (_ @ _)))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (@expr.Ident _ _ _ t7 idc7) x10 @
- @expr.LetIn _ _ _ _ _ _ _))%expr_pat =>
- None
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ ($_)%expr _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (@expr.Abs _ _ _ _ _ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (_ @ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s9 _ (@expr.LetIn _ _ _ _ _ _ _) _ @ _))%expr_pat =>
- None
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ #(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _
- _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _
- _ _ _ _ _ @ _))%expr_pat => None
- | (@expr.Ident _ _ _ t5 idc5 @ #(_))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _
- _ _ _)%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (#(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (($_)%expr @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _
- _ _ _ _ _)%expr_pat => None
- | _ => None
- end;;
- match x6 with
- | @expr.App _ _ _ s6 _
- (@expr.Ident _ _ _ t5 idc5) x7 =>
- match x5 with
- | @expr.Ident _ _ _ t6 idc6 =>
- args <- invert_bind_args idc6
- Raw.ident.Literal;
- args0 <- invert_bind_args idc5
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc4
- Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc3
- Raw.ident.Z_cast;
- args3 <- invert_bind_args idc2
- Raw.ident.Literal;
- args4 <- invert_bind_args idc1
- Raw.ident.Literal;
- args5 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_sub_with_get_borrow;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ -> ℤ)%ptype
- ((((projT1 args5) -> (projT1 args4)) ->
- (projT1 args3)) ->
- s6 -> (projT1 args))%ptype
- with
- | Some (_, _, _, (_, _))%zrange =>
- if
- type.type_beq base.type
- base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ -> ℤ)%ptype
- ((((projT1 args5) ->
- (projT1 args4)) ->
- (projT1 args3)) ->
- s6 -> (projT1 args))%ptype
- then
- xv <- ident.unify
- pattern.ident.Literal
- ##(projT2 args5);
- xv0 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args4);
- xv1 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args3);
- v <- type.try_make_transport_cps s6 ℤ;
- xv2 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args);
- fv <- (x8 <- (let
- '(r1, r2)%zrange :=
- range in
- fun (s7 bb xx : Z)
- (rshiftr
- ry : zrange)
- (y : expr ℤ)
- (offset : Z) =>
- if
- (s7 =?
- 2 ^ Z.log2 s7) &&
- (ZRange.normalize
- ry >>
- ZRange.normalize
- (ZRange.constant
- offset) <=?
- ZRange.normalize
- rshiftr)%zrange &&
- (ZRange.normalize
- rshiftr <=?
- r[0 ~> s7 - 1])%zrange
- then
- Some
- (#(Z_cast2
- (r1, r2))%expr @
- (#(fancy_subb
- (Z.log2 s7)
- (- offset))%expr @
- ((##bb)%expr,
- (##xx)%expr,
- #(Z_cast ry)%expr @
- y)))%expr_pat
- else None)
- (let (x8, _) :=
- xv in
- x8)
- (let (x8, _) :=
- xv0 in
- x8)
- (let (x8, _) :=
- xv1 in
- x8) args2 args0
- (v
- (Compile.reflect
- x7))
- (let (x8, _) :=
- xv2 in
- x8);
- Some (Base x8));
- Some
- (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
- end
- | @expr.App _ _ _ s6 _ ($_)%expr _ | @expr.App
- _ _ _ s6 _ (@expr.Abs _ _ _ _ _ _) _ |
- @expr.App _ _ _ s6 _ (_ @ _)%expr_pat _ |
- @expr.App _ _ _ s6 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | _ => None
- end;;
- args <- invert_bind_args idc3 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc2 Raw.ident.Literal;
- args1 <- invert_bind_args idc1 Raw.ident.Literal;
- args2 <- invert_bind_args idc0 Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_sub_with_get_borrow;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> (projT1 args1)) ->
- (projT1 args0)) -> s3)%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> (projT1 args1)) ->
- (projT1 args0)) -> s3)%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args2);
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args1);
- xv1 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- v <- type.try_make_transport_cps s3 ℤ;
- fv <- (x5 <- (let
- '(r1, r2)%zrange := range in
- fun (s4 bb xx : Z)
- (ry : zrange) (y : expr ℤ) =>
- if
- (s4 =? 2 ^ Z.log2 s4) &&
- (ZRange.normalize ry <=?
- r[0 ~> s4 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_subb (Z.log2 s4) 0)%expr @
- ((##bb)%expr, (##xx)%expr,
- #(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x5, _) := xv in x5)
- (let (x5, _) := xv0 in x5)
- (let (x5, _) := xv1 in x5) args
- (v (Compile.reflect x4));
- Some (Base x5));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s3 _ ($_)%expr _ | @expr.App _ _ _ s3
- _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s3 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s3 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | @expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t2 idc2) x4 =>
- match x0 with
- | @expr.Ident _ _ _ t3 idc3 =>
- args <- invert_bind_args idc3 Raw.ident.Literal;
- args0 <- invert_bind_args idc2 Raw.ident.Z_cast;
- args1 <- invert_bind_args idc1 Raw.ident.Literal;
- args2 <- invert_bind_args idc0 Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_sub_with_get_borrow;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> (projT1 args1)) -> s3) ->
- (projT1 args))%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> (projT1 args1)) -> s3) ->
- (projT1 args))%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args2);
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args1);
- v <- type.try_make_transport_cps s3 ℤ;
- xv1 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x5 <- (let
- '(r1, r2)%zrange := range in
- fun (s4 bb : Z) (rx : zrange)
- (x5 : expr ℤ) (yy : Z) =>
- if
- (s4 =? 2 ^ Z.log2 s4) &&
- (ZRange.normalize
- (ZRange.constant yy) <=?
- r[0 ~> s4 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_subb (Z.log2 s4) 0)%expr @
- ((##bb)%expr,
- #(Z_cast rx)%expr @ x5,
- (##yy)%expr)))%expr_pat
- else None)
- (let (x5, _) := xv in x5)
- (let (x5, _) := xv0 in x5)
- args0 (v (Compile.reflect x4))
- (let (x5, _) := xv1 in x5);
- Some (Base x5));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t3 idc3)
- x5 =>
- match x5 with
- | (@expr.Ident _ _ _ t4 idc4 @ x7 @ x6)%expr_pat =>
- match x7 with
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.Ident _ _ _ t8 idc8))%expr_pat =>
- match x6 with
- | @expr.Ident _ _ _ t9 idc9 =>
- args <- invert_bind_args idc9
- Raw.ident.Literal;
- args0 <- invert_bind_args idc8
- Raw.ident.Literal;
- args1 <- invert_bind_args idc7
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc6
- Raw.ident.Z_land;
- args3 <- invert_bind_args idc5
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc4
- Raw.ident.Z_shiftl;
- args5 <- invert_bind_args idc3
- Raw.ident.Z_cast;
- args6 <- invert_bind_args idc2
- Raw.ident.Z_cast;
- args7 <- invert_bind_args idc1
- Raw.ident.Literal;
- args8 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_sub_with_get_borrow;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> (ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args8) -> (projT1 args7)) ->
- s3) ->
- (s10 -> (projT1 args0)) ->
- (projT1 args))%ptype
- with
- | Some (_, _, _, (_, _, _))%zrange =>
- if
- type.type_beq base.type
- base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) ->
- (ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args8) ->
- (projT1 args7)) -> s3) ->
- (s10 -> (projT1 args0)) ->
- (projT1 args))%ptype
- then
- xv <- ident.unify
- pattern.ident.Literal
- ##(projT2 args8);
- xv0 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args7);
- v <- type.try_make_transport_cps s3 ℤ;
- v0 <- type.try_make_transport_cps s10 ℤ;
- xv1 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args0);
- xv2 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args);
- fv <- (x12 <- (let
- '(r1, r2)%zrange :=
- range in
- fun (s11 bb : Z)
- (rx : zrange)
- (x12 : expr ℤ)
- (rshiftl rland
- ry : zrange)
- (y : expr ℤ)
- (mask
- offset : Z) =>
- if
- (s11 =?
- 2 ^ Z.log2 s11) &&
- (ZRange.normalize
- rland <<
- ZRange.normalize
- (ZRange.constant
- offset) <=?
- ZRange.normalize
- rshiftl)%zrange &&
- (ZRange.normalize
- rshiftl <=?
- r[0 ~> s11 - 1])%zrange &&
- (ZRange.normalize
- ry &'
- ZRange.normalize
- (ZRange.constant
- mask) <=?
- ZRange.normalize
- rland)%zrange &&
- (mask =?
- Z.ones
- (Z.log2 s11 -
- offset)) &&
- (0 <=? offset) &&
- (offset <=?
- Z.log2 s11)
- then
- Some
- (#(Z_cast2
- (r1, r2))%expr @
- (#(fancy_subb
- (Z.log2
- s11)
- offset)%expr @
- ((##bb)%expr,
- #(Z_cast rx)%expr @
- x12,
- #(Z_cast ry)%expr @
- y)))%expr_pat
- else None)
- (let (x12, _) :=
- xv in
- x12)
- (let (x12, _) :=
- xv0 in
- x12) args6
- (v
- (Compile.reflect
- x4)) args5
- args3 args1
- (v0
- (Compile.reflect
- x11))
- (let (x12, _) :=
- xv1 in
- x12)
- (let (x12, _) :=
- xv2 in
- x12);
- Some (Base x12));
- Some
- (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
- end
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- ($_)%expr))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.Abs _ _ _ _ _ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- (_ @ _)))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.LetIn _ _ _ _ _ _ _))%expr_pat =>
- None
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ ($_)%expr _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Abs _ _ _ _ _ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (_ @ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.LetIn _ _ _ _ _ _ _) _ @ _))%expr_pat =>
- None
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ #(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _
- _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _
- _ _ _ _ _ @ _))%expr_pat => None
- | (@expr.Ident _ _ _ t5 idc5 @ #(_))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _
- _ _ _)%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (#(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (($_)%expr @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _
- _ _ _ _ _)%expr_pat => None
- | _ => None
- end;;
- match x7 with
- | @expr.App _ _ _ s7 _
- (@expr.Ident _ _ _ t5 idc5) x8 =>
- match x6 with
- | @expr.Ident _ _ _ t6 idc6 =>
- args <- invert_bind_args idc6
- Raw.ident.Literal;
- args0 <- invert_bind_args idc5
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc4
- Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc3
- Raw.ident.Z_cast;
- args3 <- invert_bind_args idc2
- Raw.ident.Z_cast;
- args4 <- invert_bind_args idc1
- Raw.ident.Literal;
- args5 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_sub_with_get_borrow;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ -> ℤ)%ptype
- ((((projT1 args5) -> (projT1 args4)) ->
- s3) -> s7 -> (projT1 args))%ptype
- with
- | Some (_, _, _, (_, _))%zrange =>
- if
- type.type_beq base.type
- base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ -> ℤ)%ptype
- ((((projT1 args5) ->
- (projT1 args4)) -> s3) ->
- s7 -> (projT1 args))%ptype
- then
- xv <- ident.unify
- pattern.ident.Literal
- ##(projT2 args5);
- xv0 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args4);
- v <- type.try_make_transport_cps s3 ℤ;
- v0 <- type.try_make_transport_cps s7 ℤ;
- xv1 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args);
- fv <- (x9 <- (let
- '(r1, r2)%zrange :=
- range in
- fun (s8 bb : Z)
- (rx : zrange)
- (x9 : expr ℤ)
- (rshiftr
- ry : zrange)
- (y : expr ℤ)
- (offset : Z) =>
- if
- (s8 =?
- 2 ^ Z.log2 s8) &&
- (ZRange.normalize
- ry >>
- ZRange.normalize
- (ZRange.constant
- offset) <=?
- ZRange.normalize
- rshiftr)%zrange &&
- (ZRange.normalize
- rshiftr <=?
- r[0 ~> s8 - 1])%zrange
- then
- Some
- (#(Z_cast2
- (r1, r2))%expr @
- (#(fancy_subb
- (Z.log2 s8)
- (- offset))%expr @
- ((##bb)%expr,
- #(Z_cast rx)%expr @
- x9,
- #(Z_cast ry)%expr @
- y)))%expr_pat
- else None)
- (let (x9, _) :=
- xv in
- x9)
- (let (x9, _) :=
- xv0 in
- x9) args3
- (v
- (Compile.reflect
- x4)) args2
- args0
- (v0
- (Compile.reflect
- x8))
- (let (x9, _) :=
- xv1 in
- x9);
- Some (Base x9));
- Some
- (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
- end
- | @expr.App _ _ _ s7 _ ($_)%expr _ | @expr.App
- _ _ _ s7 _ (@expr.Abs _ _ _ _ _ _) _ |
- @expr.App _ _ _ s7 _ (_ @ _)%expr_pat _ |
- @expr.App _ _ _ s7 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | _ => None
- end;;
- args <- invert_bind_args idc3 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc2 Raw.ident.Z_cast;
- args1 <- invert_bind_args idc1 Raw.ident.Literal;
- args2 <- invert_bind_args idc0 Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_sub_with_get_borrow;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> (projT1 args1)) -> s3) ->
- s4)%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> (projT1 args1)) -> s3) ->
- s4)%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args2);
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args1);
- v <- type.try_make_transport_cps s3 ℤ;
- v0 <- type.try_make_transport_cps s4 ℤ;
- fv <- (x6 <- (let
- '(r1, r2)%zrange := range in
- fun (s5 bb : Z) (rx : zrange)
- (x6 : expr ℤ) (ry : zrange)
- (y : expr ℤ) =>
- if
- (s5 =? 2 ^ Z.log2 s5) &&
- (ZRange.normalize ry <=?
- r[0 ~> s5 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_subb (Z.log2 s5) 0)%expr @
- ((##bb)%expr,
- #(Z_cast rx)%expr @ x6,
- #(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x6, _) := xv in x6)
- (let (x6, _) := xv0 in x6)
- args0 (v (Compile.reflect x4))
- args (v0 (Compile.reflect x5));
- Some (Base x6));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s4 _ ($_)%expr _ | @expr.App _ _ _ s4
- _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s4 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s4 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | @expr.App _ _ _ s3 _ ($_)%expr _ | @expr.App _ _ _ s3 _
- (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s3 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s3 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | @expr.App _ _ _ s3 _ (@expr.Ident _ _ _ t1 idc1) x4 =>
+ | @expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5 =>
match x1 with
- | @expr.Ident _ _ _ t2 idc2 =>
+ | @expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t3 idc3) x6 =>
match x0 with
- | @expr.Ident _ _ _ t3 idc3 =>
- args <- invert_bind_args idc3 Raw.ident.Literal;
- args0 <- invert_bind_args idc2 Raw.ident.Literal;
- args1 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args2 <- invert_bind_args idc0 Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_sub_with_get_borrow;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s3) -> (projT1 args0)) ->
- (projT1 args))%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s3) -> (projT1 args0)) ->
- (projT1 args))%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args2);
- v <- type.try_make_transport_cps s3 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- xv1 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x5 <- (let
- '(r1, r2)%zrange := range in
- fun (s4 : Z) (rb : zrange)
- (b2 : expr ℤ) (xx yy : Z) =>
- if
- (s4 =? 2 ^ Z.log2 s4) &&
- (ZRange.normalize
- (ZRange.constant yy) <=?
- r[0 ~> s4 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_subb (Z.log2 s4) 0)%expr @
- (#(Z_cast rb)%expr @ b2,
- (##xx)%expr, (##yy)%expr)))%expr_pat
- else None)
- (let (x5, _) := xv in x5) args1
- (v (Compile.reflect x4))
- (let (x5, _) := xv0 in x5)
- (let (x5, _) := xv1 in x5);
- Some (Base x5));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t3 idc3)
- x5 =>
- match x5 with
- | (@expr.Ident _ _ _ t4 idc4 @ x7 @ x6)%expr_pat =>
- match x7 with
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.Ident _ _ _ t8 idc8))%expr_pat =>
- match x6 with
- | @expr.Ident _ _ _ t9 idc9 =>
- args <- invert_bind_args idc9
- Raw.ident.Literal;
- args0 <- invert_bind_args idc8
- Raw.ident.Literal;
- args1 <- invert_bind_args idc7
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc6
- Raw.ident.Z_land;
- args3 <- invert_bind_args idc5
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc4
- Raw.ident.Z_shiftl;
- args5 <- invert_bind_args idc3
- Raw.ident.Z_cast;
- args6 <- invert_bind_args idc2
- Raw.ident.Literal;
- args7 <- invert_bind_args idc1
- Raw.ident.Z_cast;
- args8 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_sub_with_get_borrow;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> (ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args8) -> s3) ->
- (projT1 args6)) ->
- (s10 -> (projT1 args0)) ->
- (projT1 args))%ptype
- with
- | Some (_, _, _, (_, _, _))%zrange =>
- if
- type.type_beq base.type
- base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) ->
- (ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args8) -> s3) ->
- (projT1 args6)) ->
- (s10 -> (projT1 args0)) ->
- (projT1 args))%ptype
- then
- xv <- ident.unify
- pattern.ident.Literal
- ##(projT2 args8);
- v <- type.try_make_transport_cps s3 ℤ;
- xv0 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args6);
- v0 <- type.try_make_transport_cps s10 ℤ;
- xv1 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args0);
- xv2 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args);
- fv <- (x12 <- (let
- '(r1, r2)%zrange :=
- range in
- fun (s11 : Z)
- (rb : zrange)
- (b4 : expr ℤ)
- (xx : Z)
- (rshiftl rland
- ry : zrange)
- (y : expr ℤ)
- (mask
- offset : Z) =>
- if
- (s11 =?
- 2 ^ Z.log2 s11) &&
- (ZRange.normalize
- rland <<
- ZRange.normalize
- (ZRange.constant
- offset) <=?
- ZRange.normalize
- rshiftl)%zrange &&
- (ZRange.normalize
- rshiftl <=?
- r[0 ~> s11 - 1])%zrange &&
- (ZRange.normalize
- ry &'
- ZRange.normalize
- (ZRange.constant
- mask) <=?
- ZRange.normalize
- rland)%zrange &&
- (mask =?
- Z.ones
- (Z.log2 s11 -
- offset)) &&
- (0 <=? offset) &&
- (offset <=?
- Z.log2 s11)
- then
- Some
- (#(Z_cast2
- (r1, r2))%expr @
- (#(fancy_subb
- (Z.log2
- s11)
- offset)%expr @
- (#(Z_cast rb)%expr @
- b4,
- (##xx)%expr,
- #(Z_cast ry)%expr @
- y)))%expr_pat
- else None)
- (let (x12, _) :=
- xv in
- x12) args7
- (v
- (Compile.reflect
- x4))
- (let (x12, _) :=
- xv0 in
- x12) args5 args3
- args1
- (v0
- (Compile.reflect
- x11))
- (let (x12, _) :=
- xv1 in
- x12)
- (let (x12, _) :=
- xv2 in
- x12);
- Some (Base x12));
- Some
- (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
- end
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- ($_)%expr))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.Abs _ _ _ _ _ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- (_ @ _)))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Ident _ _ _ t7 idc7) x11 @
- @expr.LetIn _ _ _ _ _ _ _))%expr_pat =>
- None
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ ($_)%expr _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.Abs _ _ _ _ _ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (_ @ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s10 _ (@expr.LetIn _ _ _ _ _ _ _) _ @ _))%expr_pat =>
- None
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ #(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _
- _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _
- _ _ _ _ _ @ _))%expr_pat => None
- | (@expr.Ident _ _ _ t5 idc5 @ #(_))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _
- _ _ _)%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (#(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (($_)%expr @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _
- _ _ _ _ _)%expr_pat => None
- | _ => None
- end;;
- match x7 with
- | @expr.App _ _ _ s7 _
- (@expr.Ident _ _ _ t5 idc5) x8 =>
- match x6 with
- | @expr.Ident _ _ _ t6 idc6 =>
- args <- invert_bind_args idc6
+ | @expr.App _ _ _ s6 _ (@expr.Ident _ _ _ t4 idc4)
+ x7 =>
+ match x7 with
+ | (@expr.Ident _ _ _ t5 idc5 @ x9 @ x8)%expr_pat =>
+ match x9 with
+ | (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Ident _
+ _ _ t10 idc10)))%expr_pat =>
+ match x8 with
+ | (@expr.Ident _ _ _ t11 idc11 @
+ @expr.Ident _ _ _ t12 idc12)%expr_pat =>
+ args <- invert_bind_args idc12
Raw.ident.Literal;
- args0 <- invert_bind_args idc5
- Raw.ident.Z_cast;
- _ <- invert_bind_args idc4
- Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc3
+ args0 <- invert_bind_args idc11
Raw.ident.Z_cast;
- args3 <- invert_bind_args idc2
+ args1 <- invert_bind_args idc10
Raw.ident.Literal;
- args4 <- invert_bind_args idc1
+ args2 <- invert_bind_args idc9
Raw.ident.Z_cast;
- args5 <- invert_bind_args idc0
- Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_sub_with_get_borrow;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ -> ℤ)%ptype
- ((((projT1 args5) -> s3) ->
- (projT1 args3)) ->
- s7 -> (projT1 args))%ptype
- with
- | Some (_, _, _, (_, _))%zrange =>
- if
- type.type_beq base.type
- base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ -> ℤ)%ptype
- ((((projT1 args5) -> s3) ->
- (projT1 args3)) ->
- s7 -> (projT1 args))%ptype
- then
- xv <- ident.unify
- pattern.ident.Literal
- ##(projT2 args5);
- v <- type.try_make_transport_cps s3 ℤ;
- xv0 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args3);
- v0 <- type.try_make_transport_cps s7 ℤ;
- xv1 <- ident.unify
- pattern.ident.Literal
- ##(projT2 args);
- fv <- (x9 <- (let
- '(r1, r2)%zrange :=
- range in
- fun (s8 : Z)
- (rb : zrange)
- (b3 : expr ℤ)
- (xx : Z)
- (rshiftr
- ry : zrange)
- (y : expr ℤ)
- (offset : Z) =>
- if
- (s8 =?
- 2 ^ Z.log2 s8) &&
- (ZRange.normalize
- ry >>
- ZRange.normalize
- (ZRange.constant
- offset) <=?
- ZRange.normalize
- rshiftr)%zrange &&
- (ZRange.normalize
- rshiftr <=?
- r[0 ~> s8 - 1])%zrange
- then
- Some
- (#(Z_cast2
- (r1, r2))%expr @
- (#(fancy_subb
- (Z.log2 s8)
- (- offset))%expr @
- (#(Z_cast rb)%expr @
- b3,
- (##xx)%expr,
- #(Z_cast ry)%expr @
- y)))%expr_pat
- else None)
- (let (x9, _) :=
- xv in
- x9) args4
- (v
- (Compile.reflect
- x4))
- (let (x9, _) :=
- xv0 in
- x9) args2 args0
- (v0
- (Compile.reflect
- x8))
- (let (x9, _) :=
- xv1 in
- x9);
- Some (Base x9));
- Some
- (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | _ => None
- end
- | @expr.App _ _ _ s7 _ ($_)%expr _ | @expr.App
- _ _ _ s7 _ (@expr.Abs _ _ _ _ _ _) _ |
- @expr.App _ _ _ s7 _ (_ @ _)%expr_pat _ |
- @expr.App _ _ _ s7 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | _ => None
- end;;
- args <- invert_bind_args idc3 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc2 Raw.ident.Literal;
- args1 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args2 <- invert_bind_args idc0 Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_sub_with_get_borrow;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s3) -> (projT1 args0)) ->
- s4)%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s3) -> (projT1 args0)) ->
- s4)%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args2);
- v <- type.try_make_transport_cps s3 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args0);
- v0 <- type.try_make_transport_cps s4 ℤ;
- fv <- (x6 <- (let
- '(r1, r2)%zrange := range in
- fun (s5 : Z) (rb : zrange)
- (b2 : expr ℤ) (xx : Z)
- (ry : zrange) (y : expr ℤ) =>
- if
- (s5 =? 2 ^ Z.log2 s5) &&
- (ZRange.normalize ry <=?
- r[0 ~> s5 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_subb (Z.log2 s5) 0)%expr @
- (#(Z_cast rb)%expr @ b2,
- (##xx)%expr,
- #(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x6, _) := xv in x6) args1
- (v (Compile.reflect x4))
- (let (x6, _) := xv0 in x6) args
- (v0 (Compile.reflect x5));
- Some (Base x6));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s4 _ ($_)%expr _ | @expr.App _ _ _ s4
- _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s4 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s4 _
- (@expr.LetIn _ _ _ _ _ _ _) _ => None
- | _ => None
- end
- | @expr.App _ _ _ s4 _ (@expr.Ident _ _ _ t2 idc2) x5 =>
- match x0 with
- | @expr.Ident _ _ _ t3 idc3 =>
- args <- invert_bind_args idc3 Raw.ident.Literal;
- args0 <- invert_bind_args idc2 Raw.ident.Z_cast;
- args1 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args2 <- invert_bind_args idc0 Raw.ident.Literal;
- _ <- invert_bind_args idc
- Raw.ident.Z_sub_with_get_borrow;
- match
- pattern.type.unify_extracted
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s3) -> s4) ->
- (projT1 args))%ptype
- with
- | Some (_, _, _, _)%zrange =>
- if
- type.type_beq base.type base.type.type_beq
- (((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s3) -> s4) ->
- (projT1 args))%ptype
- then
- xv <- ident.unify pattern.ident.Literal
- ##(projT2 args2);
- v <- type.try_make_transport_cps s3 ℤ;
- v0 <- type.try_make_transport_cps s4 ℤ;
- xv0 <- ident.unify pattern.ident.Literal
- ##(projT2 args);
- fv <- (x6 <- (let
- '(r1, r2)%zrange := range in
- fun (s5 : Z) (rb : zrange)
- (b2 : expr ℤ) (rx : zrange)
- (x6 : expr ℤ) (yy : Z) =>
- if
- (s5 =? 2 ^ Z.log2 s5) &&
- (ZRange.normalize
- (ZRange.constant yy) <=?
- r[0 ~> s5 - 1])%zrange
- then
- Some
- (#(Z_cast2 (r1, r2))%expr @
- (#(fancy_subb (Z.log2 s5) 0)%expr @
- (#(Z_cast rb)%expr @ b2,
- #(Z_cast rx)%expr @ x6,
- (##yy)%expr)))%expr_pat
- else None)
- (let (x6, _) := xv in x6) args1
- (v (Compile.reflect x4)) args0
- (v0 (Compile.reflect x5))
- (let (x6, _) := xv0 in x6);
- Some (Base x6));
- Some (fv0 <-- fv;
- Base fv0)%under_lets
- else None
- | None => None
- end
- | @expr.App _ _ _ s5 _ (@expr.Ident _ _ _ t3 idc3)
- x6 =>
- match x6 with
- | (@expr.Ident _ _ _ t4 idc4 @ x8 @ x7)%expr_pat =>
- match x8 with
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
- @expr.Ident _ _ _ t8 idc8))%expr_pat =>
- match x7 with
- | @expr.Ident _ _ _ t9 idc9 =>
- args <- invert_bind_args idc9
- Raw.ident.Literal;
- args0 <- invert_bind_args idc8
- Raw.ident.Literal;
- args1 <- invert_bind_args idc7
+ args3 <- invert_bind_args idc8
Raw.ident.Z_cast;
- _ <- invert_bind_args idc6
+ _ <- invert_bind_args idc7
Raw.ident.Z_land;
- args3 <- invert_bind_args idc5
+ args5 <- invert_bind_args idc6
Raw.ident.Z_cast;
- _ <- invert_bind_args idc4
+ _ <- invert_bind_args idc5
Raw.ident.Z_shiftl;
- args5 <- invert_bind_args idc3
+ args7 <- invert_bind_args idc4
Raw.ident.Z_cast;
- args6 <- invert_bind_args idc2
+ args8 <- invert_bind_args idc3
Raw.ident.Z_cast;
- args7 <- invert_bind_args idc1
+ args9 <- invert_bind_args idc2
Raw.ident.Z_cast;
- args8 <- invert_bind_args idc0
- Raw.ident.Literal;
+ args10 <- invert_bind_args idc1
+ Raw.ident.Literal;
+ args11 <- invert_bind_args idc0
+ Raw.ident.Z_cast;
_ <- invert_bind_args idc
Raw.ident.Z_sub_with_get_borrow;
match
pattern.type.unify_extracted
(((ℤ -> ℤ) -> ℤ) -> (ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args8) -> s3) -> s4) ->
- (s11 -> (projT1 args0)) ->
+ ((((projT1 args10) -> s4) -> s5) ->
+ (s12 -> (projT1 args1)) ->
(projT1 args))%ptype
with
| Some (_, _, _, (_, _, _))%zrange =>
@@ -9475,38 +5759,41 @@ match idc in (Compilers.ident t) return (Compile.value' true t) with
base.type.type_beq
(((ℤ -> ℤ) -> ℤ) ->
(ℤ -> ℤ) -> ℤ)%ptype
- ((((projT1 args8) -> s3) -> s4) ->
- (s11 -> (projT1 args0)) ->
+ ((((projT1 args10) -> s4) -> s5) ->
+ (s12 -> (projT1 args1)) ->
(projT1 args))%ptype
then
xv <- ident.unify
pattern.ident.Literal
- ##(projT2 args8);
- v <- type.try_make_transport_cps s3 ℤ;
- v0 <- type.try_make_transport_cps s4 ℤ;
- v1 <- type.try_make_transport_cps s11 ℤ;
+ ##(projT2 args10);
+ v <- type.try_make_transport_cps s4 ℤ;
+ v0 <- type.try_make_transport_cps s5 ℤ;
+ v1 <- type.try_make_transport_cps s12 ℤ;
xv0 <- ident.unify
pattern.ident.Literal
- ##(projT2 args0);
+ ##(projT2 args1);
xv1 <- ident.unify
pattern.ident.Literal
##(projT2 args);
- fv <- (x13 <- (let
+ fv <- (x16 <- (let
'(r1, r2)%zrange :=
range in
- fun (s12 : Z)
+ fun (rs : zrange)
+ (s15 : Z)
(rb : zrange)
(b4 : expr ℤ)
(rx : zrange)
- (x13 : expr ℤ)
+ (x16 : expr ℤ)
(rshiftl rland
ry : zrange)
(y : expr ℤ)
- (mask
- offset : Z) =>
+ (rmask : zrange)
+ (mask : Z)
+ (roffset : zrange)
+ (offset : Z) =>
if
- (s12 =?
- 2 ^ Z.log2 s12) &&
+ (s15 =?
+ 2 ^ Z.log2 s15) &&
(ZRange.normalize
rland <<
ZRange.normalize
@@ -9516,7 +5803,7 @@ match idc in (Compilers.ident t) return (Compile.value' true t) with
rshiftl)%zrange &&
(ZRange.normalize
rshiftl <=?
- r[0 ~> s12 - 1])%zrange &&
+ r[0 ~> s15 - 1])%zrange &&
(ZRange.normalize
ry &'
ZRange.normalize
@@ -9526,174 +5813,234 @@ match idc in (Compilers.ident t) return (Compile.value' true t) with
rland)%zrange &&
(mask =?
Z.ones
- (Z.log2 s12 -
+ (Z.log2 s15 -
offset)) &&
(0 <=? offset) &&
(offset <=?
- Z.log2 s12)
+ Z.log2 s15) &&
+ is_bounded_by_bool
+ s15
+ (ZRange.normalize
+ rs) &&
+ is_bounded_by_bool
+ mask
+ (ZRange.normalize
+ rmask) &&
+ is_bounded_by_bool
+ offset
+ (ZRange.normalize
+ roffset)
then
Some
(#(Z_cast2
(r1, r2))%expr @
(#(fancy_subb
(Z.log2
- s12)
+ s15)
offset)%expr @
(#(Z_cast rb)%expr @
b4,
#(Z_cast rx)%expr @
- x13,
+ x16,
#(Z_cast ry)%expr @
y)))%expr_pat
- else None)
- (let (x13, _) :=
+ else None) args11
+ (let (x16, _) :=
xv in
- x13) args7
+ x16) args9
(v
(Compile.reflect
- x4)) args6
+ x5)) args8
(v0
(Compile.reflect
- x5)) args5
- args3 args1
+ x6)) args7
+ args5 args3
(v1
(Compile.reflect
- x12))
- (let (x13, _) :=
+ x13)) args2
+ (let (x16, _) :=
xv0 in
- x13)
- (let (x13, _) :=
+ x16) args0
+ (let (x16, _) :=
xv1 in
- x13);
- Some (Base x13));
+ x16);
+ Some (Base x16));
Some
(fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end
+ | (@expr.Ident _ _ _ t11 idc11 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t11 idc11 @ @expr.Abs
+ _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t11 idc11 @ (_ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t11 idc11 @
+ @expr.LetIn _ _ _ _ _ _ _)%expr_pat =>
+ None
| _ => None
end
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
+ | (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ ($_)%expr)))%expr_pat |
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.Abs _ _
+ _ _ _ _)))%expr_pat |
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ (_ @ _))))%expr_pat |
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Ident _ _ _ t9 idc9 @ @expr.LetIn _
+ _ _ _ _ _ _)))%expr_pat => None
+ | (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ #(_)))%expr_pat |
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
($_)%expr))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
@expr.Abs _ _ _ _ _ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
- (_ @ _)))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Ident _ _ _ t7 idc7) x12 @
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (($_)%expr @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.Abs _ _ _ _ _ _ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (_ @ _ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
+ (@expr.LetIn _ _ _ _ _ _ _ @ _)))%expr_pat |
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Ident _ _ _ t8 idc8) x13 @
@expr.LetIn _ _ _ _ _ _ _))%expr_pat =>
None
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ ($_)%expr _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.Abs _ _ _ _ _ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (_ @ _) _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.App _ _ _
- s11 _ (@expr.LetIn _ _ _ _ _ _ _) _ @ _))%expr_pat =>
+ | (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ ($_)%expr _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.Abs _ _ _ _ _ _) _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (_ @ _) _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.App _ _ _
+ s12 _ (@expr.LetIn _ _ _ _ _ _ _) _ @ _))%expr_pat =>
None
- | (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ #(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _
+ | (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ #(_) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ ($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Abs _ _ _
_ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
- (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _
+ (@expr.Ident _ _ _ t6 idc6 @
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.LetIn _ _
_ _ _ _ _ @ _))%expr_pat => None
- | (@expr.Ident _ _ _ t5 idc5 @ #(_))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ ($_)%expr)%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ @expr.Abs _ _ _
+ | (@expr.Ident _ _ _ t6 idc6 @ #(_))%expr_pat |
+ (@expr.Ident _ _ _ t6 idc6 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.Abs _ _ _
_ _ _)%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (#(_) @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (($_)%expr @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ (#(_) @ _))%expr_pat |
+ (@expr.Ident _ _ _ t6 idc6 @ (($_)%expr @ _))%expr_pat |
+ (@expr.Ident _ _ _ t6 idc6 @
(@expr.Abs _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
(($_)%expr @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
(@expr.Abs _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ (_ @ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @ (_ @ _ @ _ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t6 idc6 @
(@expr.LetIn _ _ _ _ _ _ _ @ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @
+ (@expr.Ident _ _ _ t6 idc6 @
(@expr.LetIn _ _ _ _ _ _ _ @ _))%expr_pat |
- (@expr.Ident _ _ _ t5 idc5 @ @expr.LetIn _ _
+ (@expr.Ident _ _ _ t6 idc6 @ @expr.LetIn _ _
_ _ _ _ _)%expr_pat => None
| _ => None
end;;
- match x8 with
- | @expr.App _ _ _ s8 _
- (@expr.Ident _ _ _ t5 idc5) x9 =>
- match x7 with
- | @expr.Ident _ _ _ t6 idc6 =>
- args <- invert_bind_args idc6
+ match x9 with
+ | @expr.App _ _ _ s9 _
+ (@expr.Ident _ _ _ t6 idc6) x10 =>
+ match x8 with
+ | (@expr.Ident _ _ _ t7 idc7 @ @expr.Ident
+ _ _ _ t8 idc8)%expr_pat =>
+ args <- invert_bind_args idc8
Raw.ident.Literal;
- args0 <- invert_bind_args idc5
+ args0 <- invert_bind_args idc7
+ Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc6
Raw.ident.Z_cast;
- _ <- invert_bind_args idc4
+ _ <- invert_bind_args idc5
Raw.ident.Z_shiftr;
- args2 <- invert_bind_args idc3
+ args3 <- invert_bind_args idc4
Raw.ident.Z_cast;
- args3 <- invert_bind_args idc2
+ args4 <- invert_bind_args idc3
Raw.ident.Z_cast;
- args4 <- invert_bind_args idc1
+ args5 <- invert_bind_args idc2
Raw.ident.Z_cast;
- args5 <- invert_bind_args idc0
+ args6 <- invert_bind_args idc1
Raw.ident.Literal;
+ args7 <- invert_bind_args idc0
+ Raw.ident.Z_cast;
_ <- invert_bind_args idc
Raw.ident.Z_sub_with_get_borrow;
match
pattern.type.unify_extracted
(((ℤ -> ℤ) -> ℤ) -> ℤ -> ℤ)%ptype
- ((((projT1 args5) -> s3) -> s4) ->
- s8 -> (projT1 args))%ptype
+ ((((projT1 args6) -> s4) -> s5) ->
+ s9 -> (projT1 args))%ptype
with
| Some (_, _, _, (_, _))%zrange =>
if
type.type_beq base.type
base.type.type_beq
(((ℤ -> ℤ) -> ℤ) -> ℤ -> ℤ)%ptype
- ((((projT1 args5) -> s3) -> s4) ->
- s8 -> (projT1 args))%ptype
+ ((((projT1 args6) -> s4) -> s5) ->
+ s9 -> (projT1 args))%ptype
then
xv <- ident.unify
pattern.ident.Literal
- ##(projT2 args5);
- v <- type.try_make_transport_cps s3 ℤ;
- v0 <- type.try_make_transport_cps s4 ℤ;
- v1 <- type.try_make_transport_cps s8 ℤ;
+ ##(projT2 args6);
+ v <- type.try_make_transport_cps s4 ℤ;
+ v0 <- type.try_make_transport_cps s5 ℤ;
+ v1 <- type.try_make_transport_cps s9 ℤ;
xv0 <- ident.unify
pattern.ident.Literal
##(projT2 args);
- fv <- (x10 <- (let
+ fv <- (x12 <- (let
'(r1, r2)%zrange :=
range in
- fun (s9 : Z)
+ fun (rs : zrange)
+ (s11 : Z)
(rb : zrange)
(b3 : expr ℤ)
(rx : zrange)
- (x10 : expr ℤ)
+ (x12 : expr ℤ)
(rshiftr
ry : zrange)
(y : expr ℤ)
+ (roffset : zrange)
(offset : Z) =>
if
- (s9 =?
- 2 ^ Z.log2 s9) &&
+ (s11 =?
+ 2 ^ Z.log2 s11) &&
(ZRange.normalize
ry >>
ZRange.normalize
@@ -9703,124 +6050,146 @@ match idc in (Compilers.ident t) return (Compile.value' true t) with
rshiftr)%zrange &&
(ZRange.normalize
rshiftr <=?
- r[0 ~> s9 - 1])%zrange
+ r[0 ~> s11 - 1])%zrange &&
+ is_bounded_by_bool
+ s11
+ (ZRange.normalize
+ rs) &&
+ is_bounded_by_bool
+ offset
+ (ZRange.normalize
+ roffset)
then
Some
(#(Z_cast2
(r1, r2))%expr @
(#(fancy_subb
(Z.log2
- s9)
+ s11)
(- offset))%expr @
(#(Z_cast rb)%expr @
b3,
#(Z_cast rx)%expr @
- x10,
+ x12,
#(Z_cast ry)%expr @
y)))%expr_pat
- else None)
- (let (x10, _) :=
+ else None) args7
+ (let (x12, _) :=
xv in
- x10) args4
+ x12) args5
(v
(Compile.reflect
- x4)) args3
+ x5)) args4
(v0
(Compile.reflect
- x5)) args2
- args0
+ x6)) args3
+ args1
(v1
(Compile.reflect
- x9))
- (let (x10, _) :=
+ x10)) args0
+ (let (x12, _) :=
xv0 in
- x10);
- Some (Base x10));
+ x12);
+ Some (Base x12));
Some
(fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end
+ | (@expr.Ident _ _ _ t7 idc7 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.Abs _
+ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t7 idc7 @ (_ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t7 idc7 @ @expr.LetIn
+ _ _ _ _ _ _ _)%expr_pat => None
| _ => None
end
- | @expr.App _ _ _ s8 _ ($_)%expr _ | @expr.App
- _ _ _ s8 _ (@expr.Abs _ _ _ _ _ _) _ |
- @expr.App _ _ _ s8 _ (_ @ _)%expr_pat _ |
- @expr.App _ _ _ s8 _
+ | @expr.App _ _ _ s9 _ ($_)%expr _ | @expr.App
+ _ _ _ s9 _ (@expr.Abs _ _ _ _ _ _) _ |
+ @expr.App _ _ _ s9 _ (_ @ _)%expr_pat _ |
+ @expr.App _ _ _ s9 _
(@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end
| _ => None
end;;
- args <- invert_bind_args idc3 Raw.ident.Z_cast;
- args0 <- invert_bind_args idc2 Raw.ident.Z_cast;
- args1 <- invert_bind_args idc1 Raw.ident.Z_cast;
- args2 <- invert_bind_args idc0 Raw.ident.Literal;
+ args <- invert_bind_args idc4 Raw.ident.Z_cast;
+ args0 <- invert_bind_args idc3 Raw.ident.Z_cast;
+ args1 <- invert_bind_args idc2 Raw.ident.Z_cast;
+ args2 <- invert_bind_args idc1 Raw.ident.Literal;
+ args3 <- invert_bind_args idc0 Raw.ident.Z_cast;
_ <- invert_bind_args idc
Raw.ident.Z_sub_with_get_borrow;
match
pattern.type.unify_extracted
(((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s3) -> s4) -> s5)%ptype
+ ((((projT1 args2) -> s4) -> s5) -> s6)%ptype
with
| Some (_, _, _, _)%zrange =>
if
type.type_beq base.type base.type.type_beq
(((ℤ -> ℤ) -> ℤ) -> ℤ)%ptype
- ((((projT1 args2) -> s3) -> s4) -> s5)%ptype
+ ((((projT1 args2) -> s4) -> s5) -> s6)%ptype
then
xv <- ident.unify pattern.ident.Literal
##(projT2 args2);
- v <- type.try_make_transport_cps s3 ℤ;
- v0 <- type.try_make_transport_cps s4 ℤ;
- v1 <- type.try_make_transport_cps s5 ℤ;
- fv <- (x7 <- (let
+ v <- type.try_make_transport_cps s4 ℤ;
+ v0 <- type.try_make_transport_cps s5 ℤ;
+ v1 <- type.try_make_transport_cps s6 ℤ;
+ fv <- (x8 <- (let
'(r1, r2)%zrange := range in
- fun (s6 : Z) (rb : zrange)
- (b2 : expr ℤ) (rx : zrange)
- (x7 : expr ℤ) (ry : zrange)
- (y : expr ℤ) =>
+ fun (rs : zrange) (s7 : Z)
+ (rb : zrange) (b2 : expr ℤ)
+ (rx : zrange) (x8 : expr ℤ)
+ (ry : zrange) (y : expr ℤ) =>
if
- (s6 =? 2 ^ Z.log2 s6) &&
+ (s7 =? 2 ^ Z.log2 s7) &&
(ZRange.normalize ry <=?
- r[0 ~> s6 - 1])%zrange
+ r[0 ~> s7 - 1])%zrange &&
+ is_bounded_by_bool s7
+ (ZRange.normalize rs)
then
Some
(#(Z_cast2 (r1, r2))%expr @
- (#(fancy_subb (Z.log2 s6) 0)%expr @
+ (#(fancy_subb (Z.log2 s7) 0)%expr @
(#(Z_cast rb)%expr @ b2,
- #(Z_cast rx)%expr @ x7,
+ #(Z_cast rx)%expr @ x8,
#(Z_cast ry)%expr @ y)))%expr_pat
- else None)
- (let (x7, _) := xv in x7) args1
- (v (Compile.reflect x4)) args0
- (v0 (Compile.reflect x5)) args
- (v1 (Compile.reflect x6));
- Some (Base x7));
+ else None) args3
+ (let (x8, _) := xv in x8) args1
+ (v (Compile.reflect x5)) args0
+ (v0 (Compile.reflect x6)) args
+ (v1 (Compile.reflect x7));
+ Some (Base x8));
Some (fv0 <-- fv;
Base fv0)%under_lets
else None
| None => None
end
- | @expr.App _ _ _ s5 _ ($_)%expr _ | @expr.App _ _ _ s5
- _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s5 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s5 _
+ | @expr.App _ _ _ s6 _ ($_)%expr _ | @expr.App _ _ _ s6
+ _ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s6 _
+ (_ @ _)%expr_pat _ | @expr.App _ _ _ s6 _
(@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end
- | @expr.App _ _ _ s4 _ ($_)%expr _ | @expr.App _ _ _ s4 _
- (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s4 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s4 _
+ | @expr.App _ _ _ s5 _ ($_)%expr _ | @expr.App _ _ _ s5 _
+ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s5 _
+ (_ @ _)%expr_pat _ | @expr.App _ _ _ s5 _
(@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end
- | @expr.App _ _ _ s3 _ ($_)%expr _ | @expr.App _ _ _ s3 _
- (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s3 _
- (_ @ _)%expr_pat _ | @expr.App _ _ _ s3 _
+ | @expr.App _ _ _ s4 _ ($_)%expr _ | @expr.App _ _ _ s4 _
+ (@expr.Abs _ _ _ _ _ _) _ | @expr.App _ _ _ s4 _
+ (_ @ _)%expr_pat _ | @expr.App _ _ _ s4 _
(@expr.LetIn _ _ _ _ _ _ _) _ => None
| _ => None
end
+ | (@expr.Ident _ _ _ t0 idc0 @ ($_)%expr)%expr_pat |
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.Abs _ _ _ _ _ _)%expr_pat |
+ (@expr.Ident _ _ _ t0 idc0 @ (_ @ _))%expr_pat |
+ (@expr.Ident _ _ _ t0 idc0 @ @expr.LetIn _ _ _ _ _ _ _)%expr_pat =>
+ None
| _ => None
end
| _ => None