Datasets:
AI4M
/

text
stringlengths
0
3.34M
lemma dist_triangle: "dist x z \<le> dist x y + dist y z"
State Before: ι : Sort u_1 α : Type u_2 β : Type ?u.1140 l : Filter α inst✝¹ : CountableInterFilter l inst✝ : Countable ι p : α → ι → Prop ⊢ (∀ᶠ (x : α) in l, ∀ (i : ι), p x i) ↔ ∀ (i : ι), ∀ᶠ (x : α) in l, p x i State After: no goals Tactic: simpa only [Filter.Eventually, setOf_forall] using @countable_iInter_mem _ _ l _ _ fun i => { x | p x i }
module CheckEqDec data Vect : Nat -> (elem : Type) -> Type where Nil : Vect Z elem (::) : elem -> Vect n elem -> Vect (1 + n) elem zeroNotSuc : (0 = S k) -> Void zeroNotSuc Refl impossible sucNotZero : (S k = 0) -> Void sucNotZero Refl impossible noRec : (contra : (k = j) -> Void) -> (S k = S j) -> Void noRec contra Refl = contra Refl checkEqNat : (num1 : Nat) -> (num2 : Nat) -> Dec (num1 = num2) checkEqNat Z Z = Yes Refl checkEqNat Z (S k) = No zeroNotSuc checkEqNat (S k) Z = No sucNotZero checkEqNat (S k) (S j) = case checkEqNat k j of (Yes prf) => Yes (cong prf) (No contra) => No (noRec contra) -- Ex 8.3 #1 headUnequal : DecEq a => {xs : Vect n a} -> {ys : Vect n a} -> (contra : (x = y) -> Void) -> ((x :: xs) = (y :: ys)) -> Void headUnequal contra Refl = contra Refl tailUnequal : DecEq a => {xs : Vect n a} -> {ys : Vect n a} -> (contra : (xs = ys) -> Void) -> ((x :: xs) = (y :: ys)) -> Void tailUnequal contra Refl = contra Refl -- Ex 8.3 #2 DecEq a => DecEq (Vect n a) where decEq [] [] = Yes Refl decEq (x :: xs) (y :: ys) = case decEq x y of (Yes prf1) => case decEq xs ys of (Yes prf2) => Yes $ rewrite prf1 in rewrite prf2 in Refl (No contra2) => No $ tailUnequal contra2 (No contra1) => No $ headUnequal contra1
function v = tfocs_size( x ) % SIZE TFOCS-friendly size operator. v = { @zeros, m, n }; % TFOCS v1.3 by Stephen Becker, Emmanuel Candes, and Michael Grant. % Copyright 2013 California Institute of Technology and CVX Research. % See the file LICENSE for full license information.
[STATEMENT] lemma insert_noteq_member: assumes BC: "add_mset b B = add_mset c C" and bnotc: "b \<noteq> c" shows "c \<in># B" [PROOF STATE] proof (prove) goal (1 subgoal): 1. c \<in># B [PROOF STEP] proof - [PROOF STATE] proof (state) goal (1 subgoal): 1. c \<in># B [PROOF STEP] have "c \<in># add_mset c C" [PROOF STATE] proof (prove) goal (1 subgoal): 1. c \<in># add_mset c C [PROOF STEP] by simp [PROOF STATE] proof (state) this: c \<in># add_mset c C goal (1 subgoal): 1. c \<in># B [PROOF STEP] have nc: "\<not> c \<in># {#b#}" [PROOF STATE] proof (prove) goal (1 subgoal): 1. c \<notin># {#b#} [PROOF STEP] using bnotc [PROOF STATE] proof (prove) using this: b \<noteq> c goal (1 subgoal): 1. c \<notin># {#b#} [PROOF STEP] by simp [PROOF STATE] proof (state) this: c \<notin># {#b#} goal (1 subgoal): 1. c \<in># B [PROOF STEP] then [PROOF STATE] proof (chain) picking this: c \<notin># {#b#} [PROOF STEP] have "c \<in># add_mset b B" [PROOF STATE] proof (prove) using this: c \<notin># {#b#} goal (1 subgoal): 1. c \<in># add_mset b B [PROOF STEP] using BC [PROOF STATE] proof (prove) using this: c \<notin># {#b#} add_mset b B = add_mset c C goal (1 subgoal): 1. c \<in># add_mset b B [PROOF STEP] by simp [PROOF STATE] proof (state) this: c \<in># add_mset b B goal (1 subgoal): 1. c \<in># B [PROOF STEP] then [PROOF STATE] proof (chain) picking this: c \<in># add_mset b B [PROOF STEP] show "c \<in># B" [PROOF STATE] proof (prove) using this: c \<in># add_mset b B goal (1 subgoal): 1. c \<in># B [PROOF STEP] using nc [PROOF STATE] proof (prove) using this: c \<in># add_mset b B c \<notin># {#b#} goal (1 subgoal): 1. c \<in># B [PROOF STEP] by simp [PROOF STATE] proof (state) this: c \<in># B goal: No subgoals! [PROOF STEP] qed
The limit of $f(x)$ as $x$ approaches $a$ is the same as the limit of $f(x + a)$ as $x$ approaches $0$.
data Vect : Nat -> Type -> Type where Nil : Vect Z a (::) : a -> Vect k a -> Vect (S k) a %name Vect xs, ys Eq a => Eq (Vect n a) where (==) [] [] = True (==) (x :: xs) (y :: ys) = x == y && xs == ys Foldable (Vect n) where foldr f acc [] = acc foldr f acc (x :: xs) = f x (foldr f acc xs)
[STATEMENT] lemma map_update: "map f (xs[k:= y]) = (map f xs)[k := f y]" [PROOF STATE] proof (prove) goal (1 subgoal): 1. map f (xs[k := y]) = (map f xs)[k := f y] [PROOF STEP] by(induct xs arbitrary: k)(auto split:nat.splits)
[STATEMENT] lemma widen_Iface2: "G\<turnstile>S\<preceq> Iface J \<Longrightarrow> S = NT \<or> (\<exists>I. S = Iface I) \<or> (\<exists>D. S = Class D)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. G\<turnstile>S\<preceq>Iface J \<Longrightarrow> S = NT \<or> (\<exists>I. S = Iface I) \<or> (\<exists>D. S = Class D) [PROOF STEP] apply (ind_cases "G\<turnstile>S\<preceq> Iface J") [PROOF STATE] proof (prove) goal (4 subgoals): 1. Iface J = S \<Longrightarrow> S = NT \<or> (\<exists>I. S = Iface I) \<or> (\<exists>D. S = Class D) 2. \<And>I. \<lbrakk>S = Iface I; G\<turnstile>I\<preceq>I J\<rbrakk> \<Longrightarrow> S = NT \<or> (\<exists>I. S = Iface I) \<or> (\<exists>D. S = Class D) 3. \<And>C. \<lbrakk>S = Class C; G\<turnstile>C\<leadsto>J\<rbrakk> \<Longrightarrow> S = NT \<or> (\<exists>I. S = Iface I) \<or> (\<exists>D. S = Class D) 4. S = NT \<Longrightarrow> S = NT \<or> (\<exists>I. S = Iface I) \<or> (\<exists>D. S = Class D) [PROOF STEP] by auto
[STATEMENT] lemma gb_schema_dummy_domI1: "gb_schema_dummy_dom (data, D, bs, [])" [PROOF STATE] proof (prove) goal (1 subgoal): 1. gb_schema_dummy_dom (data, D, bs, []) [PROOF STEP] by (rule gb_schema_dummy.domintros, simp)
import LeanSandbox.Nat macro "nat_ring_all" : tactic => `(simp_all [Nat.mul_assoc, Nat.mul_comm, Nat.mul_left_comm, Nat.add_assoc, Nat.add_left_comm, Nat.add_comm, Nat.left_distrib, Nat.right_distrib]) macro "nat_ring" : tactic => `(simp [Nat.mul_assoc, Nat.mul_comm, Nat.mul_left_comm, Nat.add_assoc, Nat.add_left_comm, Nat.add_comm, Nat.left_distrib, Nat.right_distrib]) macro "quotient_madness" : tactic => `(simp [Quotient.mk', Quotient.mk, Quotient.liftOn₂, Quotient.lift₂, Quotient.lift]) structure RawInt where pos : Nat neg : Nat deriving Repr private def eqv : (x y: RawInt) → Prop | ⟨a, b⟩, ⟨c, d⟩ => a + d = c + b infix:50 " ~ " => eqv private theorem eqv.refl (x: RawInt) : x ~ x := rfl private theorem eqv.symm {x y: RawInt} (xy: x ~ y): y ~ x := Eq.symm xy /- a - b c - d e - f a + d = c + b c + f = e + d => a + f = e + b -- the target a + d + c + f = c + b + e + d a + f + e + b -- done -/ private theorem eqv.trans {x y z: RawInt} (xy: x ~ y) (yz: y ~ z): x ~ z := by have summed: _ := Nat.add_equations xy yz apply @Nat.add_right_cancel _ (y.pos + y.neg) _ nat_ring_all private theorem is_equivalence: Equivalence eqv := { refl := eqv.refl, symm := eqv.symm, trans := eqv.trans } instance rawIntSetoid: Setoid RawInt where r := eqv iseqv := is_equivalence def MyInt: Type := Quotient rawIntSetoid private theorem eqv.sound: x ~ y → Quotient.mk' x = Quotient.mk' y := Quot.sound @[simp] def MyInt.mk (pos neg: Nat): MyInt := Quotient.mk' ⟨pos, neg⟩ notation "{ " a₁ ", " a₂ " }" => MyInt.mk a₁ a₂ @[simp, inline] private def MyInt.ofRawInt(raw: RawInt) := MyInt.mk raw.pos raw.neg @[simp, inline] private def RawInt.ofNat(nat: Nat): RawInt := ⟨nat, 0⟩ @[simp, inline] private def MyInt.ofNat(nat: Nat): MyInt := {nat, 0} private instance rawIntOfNat: OfNat RawInt n where ofNat := RawInt.ofNat n instance myIntOfNat: OfNat MyInt n where ofNat := MyInt.ofNat n namespace MyInt private def negateRawInt: RawInt → MyInt | ⟨pos, neg⟩ => {neg, pos} /- a - b = c - d a + d = c + b b + c = d + a b - a = d - c -/ private theorem negateRawInt.respects {x y: RawInt} (xy: x ~ y): negateRawInt x = negateRawInt y := by apply eqv.sound simp_all [eqv, Nat.add_comm] def negate (τ: MyInt): MyInt := Quotient.liftOn τ negateRawInt @negateRawInt.respects instance negMyInt: Neg MyInt where neg := negate private theorem double_neg_elim: ∀x, x = negate (negate x) := by intro x induction x using Quotient.ind rfl private def addRawInts: RawInt → RawInt → MyInt | ⟨a, b⟩, ⟨c, d⟩ => {a + c, b + d} private theorem addRawInts.respects {a b c d: RawInt} (ac: a ~ c) (bd: b ~ d): addRawInts a b = addRawInts c d := by have summed: _ := Nat.add_equations ac bd apply eqv.sound simp [eqv] at summed ⊢ nat_ring_all private theorem addRawInts.comm (a b: RawInt): addRawInts a b = addRawInts b a := by simp_all [addRawInts, Nat.add_comm] def add (τ β: MyInt): MyInt := Quotient.liftOn₂ τ β addRawInts @addRawInts.respects private instance hAddRawInts: HAdd RawInt RawInt MyInt where hAdd := addRawInts instance addMyInts: Add MyInt where add := add def sub (a b: MyInt): MyInt := a + (-b) instance subMyInt: Sub MyInt where sub := sub @[simp] theorem sub.x_minus_x_is_zero (a: MyInt): a - a = 0 := by simp_all [HSub.hSub, sub, HAdd.hAdd, add, negate, Neg.neg, MyInt.ofNat] induction a using Quotient.ind apply eqv.sound simp [eqv] apply Nat.add_comm theorem add.comm: ∀x y: MyInt, x + y = y + x := by intro x y simp_all [HAdd.hAdd, add] induction x, y using Quotient.ind₂ quotient_madness apply addRawInts.comm theorem add.assoc(x y z: MyInt): x + (y + z) = (x + y) + z := by simp_all [HAdd.hAdd, add] induction x, y using Quotient.ind₂ induction z using Quotient.ind apply eqv.sound simp [eqv] nat_ring_all @[simp] theorem add.zero(x: MyInt): x + 0 = x := by simp_all [HAdd.hAdd, add] induction x using Quotient.ind apply eqv.sound simp [eqv] /- (a - b) * (c - d) ac - bc - ad + bd -/ private def multiplyRawInts: RawInt → RawInt → MyInt | ⟨a, b⟩, ⟨c, d⟩ => {a * c + b * d, b * c + a * d} /- ac : c.neg + a.pos = a.neg + c.pos bd : d.neg + b.pos = b.neg + d.pos ⊢ a.neg * b.neg + (a.pos * b.pos + (c.pos * d.neg + c.neg * d.pos)) = c.neg * d.neg + (a.pos * b.neg + (a.neg * b.pos + c.pos * d.pos)) a - b c - d e - f g - h f + a = b + e h + c = d + g bd + ac + eh + fg = fh + ad + bc + eg bd + ac + fc + eh + fg + ec = fh + ad + bc + ec + eg + fc + cf + ce bd + c(a + f) + eh + fg + ec = fh + ad + c(b + e) + eg + fc bd + eh + fg + ec = fh + ad + eg + fc bd + e(h + c) + fg = f(h + c) + ad + eg + bg + ag b(d + g) + e(h + c) + fg + ag = f(h + c) + a(d + g) + bg + eg (h + c)(b + e) + g(a + f) = (h + c)(f + a) + g(b + e) -/ private theorem multiplyRawInts.respects: ∀ {x y z w: RawInt} (xz: x ~ z) (yw: y ~ w), (multiplyRawInts x y = multiplyRawInts z w) | ⟨a, b⟩, ⟨c, d⟩, ⟨e, f⟩, ⟨g, h⟩ => by intro xz yw apply eqv.sound simp_all [eqv] have first: (c + h) * (b + e) + g * (a + f) + c * (a + f) = (c + h) * (f + a) + g * (b + e) + c * (b + e) := by simp [Nat.add_comm, xz, yw] have second: b * (d + g) + e * (c + h) + c * (a + f) + f * g + a * g = f * (c + h) + a * (d + g) + c * (b + e) + b * g + e * g := by simp [yw, xz] at first ⊢ conv at first in g * (e + b) => rw [<-xz] conv at first => tactic => nat_ring nat_ring exact first conv at second => tactic => nat_ring apply @Nat.subtract_to_equation_left _ _ (a * g + b * g + c * f + c * e) nat_ring_all def multiply (τ β: MyInt): MyInt := Quotient.liftOn₂ τ β multiplyRawInts @multiplyRawInts.respects private instance hMulRawInt: HMul RawInt RawInt MyInt where hMul := multiplyRawInts instance mulMyInt: Mul MyInt where mul := multiply private theorem multiplyRawInts.comm (a b: RawInt): a * b = b * a := by apply eqv.sound simp [eqv] simp_all [multiplyRawInts, Nat.mul_comm] nat_ring_all theorem multiply.comm (a b: MyInt): a * b = b * a := by simp_all [Mul.mul, multiply] induction a, b using Quotient.ind₂ quotient_madness apply multiplyRawInts.comm theorem multiply.assoc(x y z: MyInt): x * (y * z) = (x * y) * z := by simp_all [Mul.mul, multiply] induction x, y using Quotient.ind₂ induction z using Quotient.ind apply eqv.sound simp [eqv] nat_ring_all @[simp] theorem multiply.one(x: MyInt): x * 1 = 1 * x := by simp_all [Mul.mul, multiply] induction x using Quotient.ind apply eqv.sound simp [eqv] @[simp] theorem multiply.zero(x: MyInt): x * 0 = 0 := by simp_all [Mul.mul, multiply] induction x using Quotient.ind apply eqv.sound simp [eqv] theorem left_distrib(x y z: MyInt): x * (y + z) = x * y + x * z := by simp_all [Mul.mul, Add.add, add, multiply] induction x, y using Quotient.ind₂ induction z using Quotient.ind apply eqv.sound simp [eqv] nat_ring_all theorem right_distrib(x y z: MyInt): (x + y) * z = x * z + y * z := by simp_all [Mul.mul, Add.add, add, multiply] induction x, y using Quotient.ind₂ induction z using Quotient.ind apply eqv.sound simp [eqv] nat_ring_all /- notes on division? t * (c - d) + r = a - b t * c + b + r = a + t * d -/ @[simp] def is_even(x: MyInt) := ∃h, h + h = x @[simp] def is_odd(x: MyInt) := ∃h, h + h + 1 = x theorem double_is_even(x: MyInt): is_even (2 * x) := by simp exists x induction x using Quotient.ind apply eqv.sound simp [eqv, Nat.double.addition_is_multiplication] theorem raw_int_induction (P: MyInt → Prop) (pz: P 0) (pn: ∀k, P k ↔ P (k + 1)): (x: RawInt) → ∃k, k ~ x ∧ P (MyInt.ofRawInt k) | ⟨0, 0⟩ => ⟨0, ⟨rfl, pz⟩⟩ | ⟨Nat.succ a, 0⟩ => by have ⟨⟨kp, kn⟩, pk⟩ := raw_int_induction P pz pn ⟨a, 0⟩ exists (⟨kp + 1, kn⟩ : RawInt) apply And.intro . simp [eqv, Nat.succ_add] rw [<-pk.left] simp [Nat.add_zero] . apply (@pn {kp, kn}).mp exact pk.right | ⟨Nat.succ a, Nat.succ b⟩ => by have ⟨k, pk⟩ := raw_int_induction P pz pn ⟨a, b⟩ exists k apply And.intro . simp [eqv, Nat.succ_add] rw [<-pk.left] simp_arith . exact pk.right | ⟨0, Nat.succ a⟩ => by have ⟨⟨kp, kn⟩, pk⟩ := raw_int_induction P pz pn ⟨0, a⟩ exists (⟨kp, kn + 1⟩ : RawInt) apply And.intro . have pkl := pk.left simp [eqv, Nat.succ_add, Nat.add_zero] at pkl ⊢ rw [<-pkl] simp_arith . have recurse := (@pn {kp, kn + 1}).mpr have rewriter: {kp, kn + 1} + 1 = {kp, kn} := by apply eqv.sound simp [eqv] simp_arith rw [rewriter] at recurse exact (recurse pk.right) theorem int_induction (P: MyInt → Prop) (zero: P 0) (succ: ∀k, P k ↔ P (k + 1)): ∀k, P k := by intro k induction k using Quotient.ind rename RawInt => kRaw have ⟨e, ⟨eIsK, proof⟩⟩ := raw_int_induction P zero succ kRaw have eIsKQuot : MyInt.ofRawInt e = MyInt.ofRawInt kRaw := by exact (eqv.sound eIsK) simp [Quotient.mk'] at eIsKQuot rw [<-eIsKQuot] exact proof theorem add_left_cancel {a b c: MyInt}: a + b = a + c → b = c := by intro hip induction b, c using Quotient.ind₂ induction a using Quotient.ind rename RawInt => c simp_all [HAdd.hAdd, Add.add, add] conv at hip => tactic => quotient_madness /- apply eqv.sound -/ /- simp [eqv] -/ /- nat_ring -/ simp_all [MyInt.addRawInts, Quotient.mk', Quotient.mk] sorry /- induction a using int_induction with -/ /- | zero => -/ /- rw [add.comm 0 c, add.comm 0 b] -/ /- simp_all -/ /- | succ k => -/ /- apply Iff.intro -/ /- . intro win -/ /- intro previous -/ /- have p: k + b = k + c := by -/ /- rw [add.comm k 1] at previous -/ /- induction b, c using Quotient.ind₂ -/ /- induction k using Quotient.ind -/ /- rename RawInt => c -/ /- simp [HAdd.hAdd, Add.add, add] -/ /- apply eqv.sound -/ /- simp [eqv] -/ /- nat_ring -/ /- -/ /- sorry -/ /- exact (win p) -/ /- . sorry -/ /- -/ theorem odd_and_even_contradict(x: MyInt): ¬(is_odd x ∧ is_even x) | ⟨⟨h₁, oddProof⟩, ⟨h₂, evenProof⟩⟩ => by have wrong: (1: MyInt) = 0 := by apply @add_left_cancel (h₁ + h₂) exact oddProof.trans evenProof.symm sorry contradiction theorem odds_not_even(x: MyInt): is_odd x ↔ ¬(is_even x) := by apply Iff.intro case mp => intro oddProof intro evenProof apply odd_and_even_contradict x exact ⟨oddProof, evenProof⟩ case mpr => simp [is_even, is_odd] sorry end MyInt
//============================================================================== // Copyright 2003 - 2012 LASMEA UMR 6602 CNRS/Univ. Clermont II // Copyright 2009 - 2012 LRI UMR 8623 CNRS/Univ Paris Sud XI // // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE.txt or copy at // http://www.boost.org/LICENSE_1_0.txt //============================================================================== #ifndef BOOST_SIMD_SWAR_FUNCTIONS_SPLIT_MULTIPLIES_HPP_INCLUDED #define BOOST_SIMD_SWAR_FUNCTIONS_SPLIT_MULTIPLIES_HPP_INCLUDED #include <boost/simd/include/functor.hpp> #include <boost/dispatch/include/functor.hpp> namespace boost { namespace simd { namespace tag { /// @brief Hierarchy tag for split_multiplies function struct split_multiplies_ : ext::elementwise_<split_multiplies_> { typedef ext::elementwise_<split_multiplies_> parent; template<class... Args> static BOOST_FORCEINLINE BOOST_AUTO_DECLTYPE dispatch(Args&&... args) BOOST_AUTO_DECLTYPE_BODY( dispatching_split_multiplies_( ext::adl_helper(), static_cast<Args&&>(args)... ) ) }; } namespace ext { template<class Site> BOOST_FORCEINLINE generic_dispatcher<tag::split_multiplies_, Site> dispatching_split_multiplies_(adl_helper, boost::dispatch::meta::unknown_<Site>, ...) { return generic_dispatcher<tag::split_multiplies_, Site>(); } template<class... Args> struct impl_split_multiplies_; } /*! @brief SIMD register type-based multiplies and split @c split_multiplies multiplies two x-bit SIMD registers and returns two 2x-bit registers each having half the cardinal of the original inputs. @param a0 LHS of multiplication @param a1 RHS of multiplication @return A Fusion Sequence containing the result of @c a0 * @c a1 **/ BOOST_DISPATCH_FUNCTION_IMPLEMENTATION(tag::split_multiplies_, split_multiplies, 2) BOOST_DISPATCH_FUNCTION_IMPLEMENTATION(tag::split_multiplies_, full_mul, 2) BOOST_DISPATCH_FUNCTION_IMPLEMENTATION(tag::split_multiplies_, wide_mul, 2) /*! @brief SIMD register type-based multiplies and split @c split_multiplies multiplies two x-bit SIMD registers and returns two 2x-bit registers each having half the cardinal of the original inputs. @param a0 LHS of multiplication @param a1 RHS of multiplication @param a2 L-Value that will receive the second sub-part of @c a0 * @c a1 @return The first sub-part of @c a0 * @c a1 **/ BOOST_DISPATCH_FUNCTION_IMPLEMENTATION_TPL( tag::split_multiplies_, split_multiplies , (A0 const &)(A0 const&)(A1&) , 2 ) /*! @brief SIMD register type-based multiplies and split @c split_multiplies multiplies two x-bit SIMD registers and returns two 2x-bit registers each having half the cardinal of the original inputs. @param a0 LHS of multiplication @param a1 RHS of multiplication @param a2 L-Value that will receive the first sub-part of @c a0 * @c a1 @param a3 L-Value that will receive the second sub-part of @c a0 * @c a1 **/ BOOST_DISPATCH_FUNCTION_IMPLEMENTATION_TPL( tag::split_multiplies_, split_multiplies , (A0 const &)(A0 const&)(A1&)(A1&) , 2 ) } } #endif
lemma assumes holf: "f holomorphic_on (S - {\<xi>})" and \<xi>: "\<xi> \<in> interior S" shows holomorphic_on_extend_lim: "(\<exists>g. g holomorphic_on S \<and> (\<forall>z \<in> S - {\<xi>}. g z = f z)) \<longleftrightarrow> ((\<lambda>z. (z - \<xi>) * f z) \<longlongrightarrow> 0) (at \<xi>)" (is "?P = ?Q") and holomorphic_on_extend_bounded: "(\<exists>g. g holomorphic_on S \<and> (\<forall>z \<in> S - {\<xi>}. g z = f z)) \<longleftrightarrow> (\<exists>B. eventually (\<lambda>z. norm(f z) \<le> B) (at \<xi>))" (is "?P = ?R")
{-# OPTIONS --without-K --safe #-} module Categories.Category.Helper where open import Level open import Relation.Binary using (Rel; IsEquivalence) open import Categories.Category.Core using (Category) -- Since we add extra proofs in the definition of `Category` (i.e. `sym-assoc` and -- `identity²`), we might still want to construct a `Category` in its originally -- easier manner. Thus, this redundant definition is here to ease the construction. record CategoryHelper (o ℓ e : Level) : Set (suc (o ⊔ ℓ ⊔ e)) where infix 4 _≈_ _⇒_ infixr 9 _∘_ field Obj : Set o _⇒_ : Rel Obj ℓ _≈_ : ∀ {A B} → Rel (A ⇒ B) e id : ∀ {A} → (A ⇒ A) _∘_ : ∀ {A B C} → (B ⇒ C) → (A ⇒ B) → (A ⇒ C) field assoc : ∀ {A B C D} {f : A ⇒ B} {g : B ⇒ C} {h : C ⇒ D} → (h ∘ g) ∘ f ≈ h ∘ (g ∘ f) identityˡ : ∀ {A B} {f : A ⇒ B} → id ∘ f ≈ f identityʳ : ∀ {A B} {f : A ⇒ B} → f ∘ id ≈ f equiv : ∀ {A B} → IsEquivalence (_≈_ {A} {B}) ∘-resp-≈ : ∀ {A B C} {f h : B ⇒ C} {g i : A ⇒ B} → f ≈ h → g ≈ i → f ∘ g ≈ h ∘ i categoryHelper : ∀ {o ℓ e} → CategoryHelper o ℓ e → Category o ℓ e categoryHelper C = record { Obj = Obj ; _⇒_ = _⇒_ ; _≈_ = _≈_ ; id = id ; _∘_ = _∘_ ; assoc = assoc ; sym-assoc = sym assoc ; identityˡ = identityˡ ; identityʳ = identityʳ ; identity² = identityˡ ; equiv = equiv ; ∘-resp-≈ = ∘-resp-≈ } where open CategoryHelper C module _ {A B} where open IsEquivalence (equiv {A} {B}) public
#' @useDynLib hola hola_available_variables adios_available_variables = function(af) { .Call(hola_available_variables, af[[1]]) }
/- Copyright (c) 2021 Andrew Yang. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Andrew Yang -/ import group_theory.submonoid.pointwise /-! # Submonoid of inverses Given a submonoid `N` of a monoid `M`, we define the submonoid `N.left_inv` as the submonoid of left inverses of `N`. When `M` is commutative, we may define `from_comm_left_inv : N.left_inv →* N` since the inverses are unique. When `N ≤ is_unit.submonoid M`, this is precisely the pointwise inverse of `N`, and we may define `left_inv_equiv : S.left_inv ≃* S`. For the pointwise inverse of submonoids of groups, please refer to `group_theory.submonoid.pointwise`. ## TODO Define the submonoid of right inverses and two-sided inverses. See the comments of #10679 for a possible implementation. -/ variables {M : Type*} namespace submonoid @[to_additive] noncomputable instance [monoid M] : group (is_unit.submonoid M) := { inv := λ x, ⟨_, (x.prop.unit⁻¹).is_unit⟩, mul_left_inv := λ x, subtype.eq x.prop.unit.inv_val, ..(show monoid (is_unit.submonoid M), by apply_instance) } @[to_additive] noncomputable instance [comm_monoid M] : comm_group (is_unit.submonoid M) := { mul_comm := λ a b, mul_comm a b, ..(show group (is_unit.submonoid M), by apply_instance) } @[to_additive] lemma is_unit.submonoid.coe_inv [monoid M] (x : is_unit.submonoid M) : ↑(x⁻¹) = (↑x.prop.unit⁻¹ : M) := rfl section monoid variables [monoid M] (S : submonoid M) /-- `S.left_inv` is the submonoid containing all the left inverses of `S`. -/ @[to_additive "`S.left_neg` is the additive submonoid containing all the left additive inverses of `S`."] def left_inv : submonoid M := { carrier := { x : M | ∃ y : S, x * y = 1 }, one_mem' := ⟨1, mul_one 1⟩, mul_mem' := λ a b ⟨a', ha⟩ ⟨b', hb⟩, ⟨b' * a', by rw [coe_mul, ← mul_assoc, mul_assoc a, hb, mul_one, ha]⟩ } @[to_additive] lemma left_inv_left_inv_le : S.left_inv.left_inv ≤ S := begin rintros x ⟨⟨y, z, h₁⟩, h₂ : x * y = 1⟩, convert z.prop, rw [← mul_one x, ← h₁, ← mul_assoc, h₂, one_mul], end @[to_additive] lemma unit_mem_left_inv (x : Mˣ) (hx : (x : M) ∈ S) : ((x⁻¹ : _) : M) ∈ S.left_inv := ⟨⟨x, hx⟩, x.inv_val⟩ @[to_additive] lemma left_inv_left_inv_eq (hS : S ≤ is_unit.submonoid M) : S.left_inv.left_inv = S := begin refine le_antisymm S.left_inv_left_inv_le _, intros x hx, have : x = ((hS hx).unit⁻¹⁻¹ : Mˣ) := by { rw [inv_inv (hS hx).unit], refl }, rw this, exact S.left_inv.unit_mem_left_inv _ (S.unit_mem_left_inv _ hx) end /-- The function from `S.left_inv` to `S` sending an element to its right inverse in `S`. This is a `monoid_hom` when `M` is commutative. -/ @[to_additive "The function from `S.left_add` to `S` sending an element to its right additive inverse in `S`. This is an `add_monoid_hom` when `M` is commutative."] noncomputable def from_left_inv : S.left_inv → S := λ x, x.prop.some @[simp, to_additive] lemma mul_from_left_inv (x : S.left_inv) : (x : M) * S.from_left_inv x = 1 := x.prop.some_spec @[simp, to_additive] lemma from_left_inv_one : S.from_left_inv 1 = 1 := (one_mul _).symm.trans (subtype.eq $ S.mul_from_left_inv 1) end monoid section comm_monoid variables [comm_monoid M] (S : submonoid M) @[simp, to_additive] lemma from_left_inv_mul (x : S.left_inv) : (S.from_left_inv x : M) * x = 1 := by rw [mul_comm, mul_from_left_inv] @[to_additive] lemma left_inv_le_is_unit : S.left_inv ≤ is_unit.submonoid M := λ x ⟨y, hx⟩, ⟨⟨x, y, hx, mul_comm x y ▸ hx⟩, rfl⟩ @[to_additive] lemma from_left_inv_eq_iff (a : S.left_inv) (b : M) : (S.from_left_inv a : M) = b ↔ (a : M) * b = 1 := by rw [← is_unit.mul_right_inj (left_inv_le_is_unit _ a.prop), S.mul_from_left_inv, eq_comm] /-- The `monoid_hom` from `S.left_inv` to `S` sending an element to its right inverse in `S`. -/ @[to_additive "The `add_monoid_hom` from `S.left_neg` to `S` sending an element to its right additive inverse in `S`.", simps] noncomputable def from_comm_left_inv : S.left_inv →* S := { to_fun := S.from_left_inv, map_one' := S.from_left_inv_one, map_mul' := λ x y, subtype.ext $ by rw [from_left_inv_eq_iff, mul_comm x, submonoid.coe_mul, submonoid.coe_mul, mul_assoc, ← mul_assoc (x : M), mul_from_left_inv, one_mul, mul_from_left_inv] } variable (hS : S ≤ is_unit.submonoid M) include hS /-- The submonoid of pointwise inverse of `S` is `mul_equiv` to `S`. -/ @[to_additive "The additive submonoid of pointwise additive inverse of `S` is `add_equiv` to `S`.", simps apply] noncomputable def left_inv_equiv : S.left_inv ≃* S := { inv_fun := λ x, by { choose x' hx using (hS x.prop), exact ⟨x'.inv, x, hx ▸ x'.inv_val⟩ }, left_inv := λ x, subtype.eq $ begin dsimp, generalize_proofs h, rw ← h.some.mul_left_inj, exact h.some.inv_val.trans ((S.mul_from_left_inv x).symm.trans (by rw h.some_spec)), end, right_inv := λ x, by { dsimp, ext, rw [from_left_inv_eq_iff], convert (hS x.prop).some.inv_val, exact (hS x.prop).some_spec.symm }, ..S.from_comm_left_inv } @[simp, to_additive] lemma from_left_inv_left_inv_equiv_symm (x : S) : S.from_left_inv ((S.left_inv_equiv hS).symm x) = x := (S.left_inv_equiv hS).right_inv x @[simp, to_additive] lemma left_inv_equiv_symm_from_left_inv (x : S.left_inv) : (S.left_inv_equiv hS).symm (S.from_left_inv x) = x := (S.left_inv_equiv hS).left_inv x @[to_additive] lemma left_inv_equiv_mul (x : S.left_inv) : (S.left_inv_equiv hS x : M) * x = 1 := by simp @[to_additive] lemma mul_left_inv_equiv (x : S.left_inv) : (x : M) * S.left_inv_equiv hS x = 1 := by simp @[simp, to_additive] lemma left_inv_equiv_symm_mul (x : S) : ((S.left_inv_equiv hS).symm x : M) * x = 1 := by { convert S.mul_left_inv_equiv hS ((S.left_inv_equiv hS).symm x), simp } @[simp, to_additive] lemma mul_left_inv_equiv_symm (x : S) : (x : M) * (S.left_inv_equiv hS).symm x = 1 := by { convert S.left_inv_equiv_mul hS ((S.left_inv_equiv hS).symm x), simp } end comm_monoid section group variables [group M] (S : submonoid M) open_locale pointwise @[to_additive] lemma left_inv_eq_inv : S.left_inv = S⁻¹ := submonoid.ext $ λ x, ⟨λ h, submonoid.mem_inv.mpr ((inv_eq_of_mul_eq_one_right h.some_spec).symm ▸ h.some.prop), λ h, ⟨⟨_, h⟩, mul_right_inv _⟩⟩ @[simp, to_additive] lemma from_left_inv_eq_inv (x : S.left_inv) : (S.from_left_inv x : M) = x⁻¹ := by rw [← mul_right_inj (x : M), mul_right_inv, mul_from_left_inv] end group section comm_group variables [comm_group M] (S : submonoid M) (hS : S ≤ is_unit.submonoid M) @[simp, to_additive] lemma left_inv_equiv_symm_eq_inv (x : S) : ((S.left_inv_equiv hS).symm x : M) = x⁻¹ := by rw [← mul_right_inj (x : M), mul_right_inv, mul_left_inv_equiv_symm] end comm_group end submonoid
import algebra.module.linear_map -- import algebra.module.graded_module import ring_theory.graded_algebra.homogeneous_ideal import ring_theory.ideal.quotient import ring_theory.ideal.quotient_operations section classes section linear_map variables {R : Type*} [semiring R] variables {β γ : Type*} [add_comm_monoid β] [module R β] [add_comm_monoid γ] [module R γ] instance {F : Type*} [linear_map_class F R β γ] : has_coe_t F (β →ₗ[R] γ) := { coe := λ h, ⟨h, map_add h, map_smulₛₗ h⟩ } lemma linear_map.coe_coe {F : Type*} [linear_map_class F R β γ] (f : F) : ((f : β →ₗ[R] γ) : β → γ) = f := rfl lemma linear_map.coe_coe' {F : Type*} [linear_map_class F R β γ] (f : F) : ((f : β →ₗ[R] γ) : β →+ γ) = f := rfl example {F : Type*} [linear_map_class F R β γ] (h : F) (b : β): (h : β →ₗ[R] γ) b = h b := rfl end linear_map section alg_hom variables {R : Type*} [comm_semiring R] variables {β γ : Type*} [semiring β] [algebra R β] [semiring γ] [algebra R γ] lemma alg_hom.to_linear_map_coe_coe {F : Type*} [alg_hom_class F R β γ] (h : F) : ((h : β →ₗ[R] γ) : β → γ) = h := rfl end alg_hom section Nat_module example {β : Type*} [add_comm_monoid β] : module ℕ β := add_comm_monoid.nat_module example {β γ : Type*} [add_comm_monoid β] [add_comm_monoid γ] (f : β →+ γ) : β →ₗ[ℕ] γ := { to_fun := f, map_add' := f.map_add, map_smul' := λ r x, by simp only [map_nsmul, eq_nat_cast, nat.cast_id] } example {β γ : Type*} [add_comm_monoid β] [add_comm_monoid γ] (f : β →+ γ) : β →ₗ[ℕ] γ := f.to_nat_linear_map example {β γ : Type*} [add_comm_monoid β] [add_comm_monoid γ] (f : β →ₗ[ℕ] γ) : β →+ γ := f.to_add_monoid_hom example {β γ : Type*} [add_comm_monoid β] [add_comm_monoid γ] (f : β →ₗ[ℕ] γ) : f = f.to_add_monoid_hom.to_nat_linear_map := linear_map.ext (λ _, eq.refl _) example {β γ : Type*} [add_comm_monoid β] [add_comm_monoid γ] (f : β →+ γ) : f = f.to_nat_linear_map.to_add_monoid_hom := add_monoid_hom.ext (λ _, eq.refl _) end Nat_module section Int_module example {β : Type*} [add_comm_group β]: module ℤ β := add_comm_group.int_module β example {β γ : Type*} [add_comm_group β] [add_comm_group γ] (f : β →+ γ) : β →ₗ[ℤ] γ := { to_fun := f, map_add' := f.map_add, map_smul' := λ r x, by simp only [eq_int_cast, int.cast_id, map_zsmul f r x] } example {β γ : Type*} [add_comm_group β] [add_comm_group γ] (f : β →+ γ) : β →ₗ[ℤ] γ := f.to_int_linear_map end Int_module section direct_sum variables {ι : Type*} [decidable_eq ι] variables {R : Type*} [semiring R] /-- The components of a direct sum, as add_monoid_hom -/ def direct_sum.component' {β : ι → Type* } [Π i, add_comm_monoid (β i)] (i : ι) : direct_sum ι β →+ β i := direct_sum.component ℕ ι β i lemma direct_sum.component'_eq {β : ι → Type* } [Π i, add_comm_monoid (β i)] (x : direct_sum ι β) (i : ι): direct_sum.component' i x = x i := rfl lemma direct_sum.eq_iff_component'_eq {β : ι → Type* } [Π i, add_comm_monoid (β i)] (x y : direct_sum ι β) : x = y ↔ ∀ i, direct_sum.component' i x = direct_sum.component' i y := direct_sum.ext_iff ℕ -- add_monoid_hom from a direct_sum to an add_comm_monoid example {β : ι → Type*} [Π i, add_comm_monoid (β i)] {γ : Type*} [add_comm_monoid γ] (h : Π i, β i →+ γ) : direct_sum ι β →+ γ := direct_sum.to_add_monoid h -- linear_map from a direct_sum to a module example {β : ι → Type*} [Π i, add_comm_monoid (β i)] [Π i, module R (β i)] {γ : Type*} [add_comm_monoid γ] [module R γ] (h : Π i, β i →ₗ[R] γ) : direct_sum ι β →ₗ[R] γ := direct_sum.to_module R ι γ h -- linear_map, with classes : example {β : ι → Type*} [Π i, add_comm_monoid (β i)] [Π i, module R (β i)] {γ : Type*} [add_comm_monoid γ] [module R γ] {F : Π (i : ι), Type*} [Π i, linear_map_class (F i) R (β i) γ] (h : Π i, F i) : direct_sum ι β →ₗ[R] γ := direct_sum.to_module R ι γ (λ i, h i) -- ⟨h i, map_add _, map_smulₛₗ _⟩ example {β : ι → Type*} [Π i, add_comm_monoid (β i)] [Π i, module R (β i)] {γ : Type*} [add_comm_monoid γ] [module R γ] {F : Π (i : ι), Type*} [Π i, linear_map_class (F i) R (β i) γ] (h : Π i, F i) : direct_sum ι β →ₗ[R] γ := direct_sum.to_module R ι γ (λ i, h i) /- Four versions of a direct sum of maps direct_sum.map' : for add_monoid_hom direct_sum.lmap' : for linear_map the unprimed versions are defined in terms of classes In principle, the latter should suffice. -/ /-- Linear_maps from a direct sum to a direct sum given by families of linear_maps-/ def direct_sum.map {β γ : ι → Type*} [Π i, add_comm_monoid (β i)] [Π i, add_comm_monoid (γ i)] {F : Π (i : ι), Type*} [Π i, add_monoid_hom_class (F i) (β i) (γ i)] (h : Π i, F i) : direct_sum ι β →+ direct_sum ι γ := direct_sum.to_add_monoid (λ i, add_monoid_hom.comp (direct_sum.of γ i) (h i)) def direct_sum.lmap {β γ : ι → Type*} [Π i, add_comm_monoid (β i)] [Π i, module R (β i)] [Π i, add_comm_monoid (γ i)] [Π i, module R (γ i)] {F : Π (i : ι), Type*} [Π i, linear_map_class (F i) R (β i) (γ i)] (h : Π i, F i) : direct_sum ι β →ₗ[R] direct_sum ι γ := direct_sum.to_module R ι (direct_sum ι γ) (λ i, linear_map.comp (direct_sum.lof R ι γ i) (h i : β i →ₗ[R] γ i)) def direct_sum.map' {β γ : ι → Type*} [Π i, add_comm_monoid (β i)] [Π i, add_comm_monoid (γ i)] (h : Π i, β i →+ γ i) : direct_sum ι β →+ direct_sum ι γ := direct_sum.to_add_monoid (λ i, add_monoid_hom.comp (direct_sum.of γ i) (h i)) example {β γ : ι → Type*} [Π i, add_comm_monoid (β i)] [Π i, add_comm_monoid (γ i)] (h : Π i, β i →+ γ i) : direct_sum.map' h = direct_sum.map h := rfl def direct_sum.lmap' {β γ : ι → Type*} [Π i, add_comm_monoid (β i)] [Π i, module R (β i)] [Π i, add_comm_monoid (γ i)] [Π i, module R (γ i)] (h : Π i, β i →ₗ[R] γ i) : direct_sum ι β →ₗ[R] direct_sum ι γ := direct_sum.to_module R ι _ (λ i, linear_map.comp (direct_sum.lof R ι γ i) (h i)) example {β γ : ι → Type*} [Π i, add_comm_monoid (β i)] -- [Π i, module R (β i)] [Π i, add_comm_monoid (γ i)] -- [Π i, module R (γ i)] (h : Π i, β i →+ γ i) : direct_sum ι β →+ direct_sum ι γ := direct_sum.map' h example {β γ : ι → Type*} [Π i, add_comm_monoid (β i)] -- [Π i, module ℕ (β i)] [Π i, add_comm_monoid (γ i)] -- [Π i, module ℕ (γ i)] (h : Π i, (β i) →+ (γ i)) : direct_sum ι β →+ direct_sum ι γ := direct_sum.lmap' (λ i, ((h i).to_nat_linear_map : (β i) →ₗ[ℕ] (γ i))) lemma direct_sum.map'_eq_lmap'_to_add_monoid_hom {β γ : ι → Type*} [Π i, add_comm_monoid (β i)] -- [Π i, module R (β i)] [Π i, add_comm_monoid (γ i)] -- [Π i, module R (γ i)] (h : Π i, β i →+ γ i) : direct_sum.map' h = (direct_sum.lmap' (λ i, (h i).to_nat_linear_map)).to_add_monoid_hom := rfl lemma direct_sum.lmap'_to_add_monoid_hom_eq_map' {β γ : ι → Type*} [Π i, add_comm_monoid (β i)] [Π i, module R (β i)] [Π i, add_comm_monoid (γ i)] [Π i, module R (γ i)] (h : Π i, β i →ₗ[R] γ i) : (direct_sum.lmap' h).to_add_monoid_hom = direct_sum.map' (λ i, (h i).to_add_monoid_hom) := rfl example {β γ : ι → Type*} [Π i, add_comm_monoid (β i)] [Π i, module R (β i)] [Π i, add_comm_monoid (γ i)] [Π i, module R (γ i)] (h : Π i, β i →ₗ[R] γ i) : (direct_sum.lmap' h) = direct_sum.lmap (h) := begin refl, end /- Lemmas to help computation -/ lemma direct_sum.map_of {β γ : ι → Type*} [Π i, add_comm_monoid (β i)] [Π i, add_comm_monoid (γ i)] {F : Π i, Type*} [Π i, add_monoid_hom_class (F i) (β i) (γ i)] (h : Π i, F i) (i : ι) (x : β i) : direct_sum.map h (direct_sum.of β i x) = direct_sum.of γ i (h i x) := by simp only [direct_sum.map, direct_sum.to_add_monoid_of, add_monoid_hom.coe_comp, add_monoid_hom.coe_coe] /- unknown constant… lemma direct_sum.map_apply {β γ : ι → Type*} [Π i, add_comm_monoid (β i)] [Π i, add_comm_monoid (γ i)] {F : Π i, Type*} [Π i, add_monoid_hom_class (F i) (β i) (γ i)] (h : Π i, F i) (x : direct_sum ι β) (i : ι) : direct_sum.map h x i = h i (x i) := begin let f : direct_sum ι β →+ γ i := { to_fun := λ x, direct_sum.map' h x i, map_zero' := by simp, map_add' := by simp, }, let g : direct_sum ι β →+ γ i := { to_fun := λ y, h i (y i), map_zero' := by simp, map_add' := by simp, } , change f x = g x, suffices : f = g, rw this, apply direct_sum.add_hom_ext , intros j y, simp [f, g, direct_sum.map'_of], by_cases hj : j = i, { rw ← hj, simp only [direct_sum.of_eq_same], }, { simp only [direct_sum.of_eq_of_ne _ j i _ hj, map_zero], }, end -/ lemma direct_sum.map'_of {β γ : ι → Type*} [Π i, add_comm_monoid (β i)] [Π i, add_comm_monoid (γ i)] (h : Π i, β i →+ γ i) (i : ι) (x : β i) : direct_sum.map' h (direct_sum.of β i x) = direct_sum.of γ i (h i x) := begin dsimp only [direct_sum.map'], rw direct_sum.to_add_monoid_of , simp only [add_monoid_hom.coe_comp], end lemma direct_sum.lmap'_lof {β γ : ι → Type*} [Π i, add_comm_monoid (β i)] [Π i, add_comm_monoid (γ i)] [Π i, module R (β i)] [Π i, module R (γ i)] (h : Π i, β i →ₗ[R] γ i) (i : ι) (x : β i) : direct_sum.lmap' h (direct_sum.lof R ι β i x) = direct_sum.lof R ι γ i (h i x) := begin dsimp only [direct_sum.lmap'], rw direct_sum.to_module_lof, simp only [linear_map.coe_comp], end lemma direct_sum.lmap'_apply {β γ : ι → Type*} [Π i, add_comm_monoid (β i)] [Π i, add_comm_monoid (γ i)] [Π i, module R (β i)] [Π i, module R (γ i)] (h : Π i, β i →ₗ[R] γ i) (x : direct_sum ι β) (i : ι) : direct_sum.lmap' h x i = h i (x i) := begin simp only [direct_sum.apply_eq_component R], rw ← linear_map.comp_apply, rw ← linear_map.comp_apply, revert x, rw ← linear_map.ext_iff, apply direct_sum.linear_map_ext , intro j, ext y, simp only [linear_map.comp_apply], rw [direct_sum.lmap'_lof ], simp only [direct_sum.lof_eq_of], simp only [←direct_sum.apply_eq_component], by_cases hji : j = i, { rw ← hji, simp only [direct_sum.of_eq_same], }, { simp only [direct_sum.of_eq_of_ne _ j i _ hji, map_zero], }, end lemma direct_sum.to_module_comp_lmap'_eq {β γ: ι → Type*} {δ : Type*} [Π i, add_comm_monoid (β i)] [Π i, add_comm_monoid (γ i)] [add_comm_monoid δ] [Π i, module R (β i)] [Π i, module R (γ i)] [module R δ] (h : Π i, β i →ₗ[R] γ i) (f : Π i, γ i →ₗ[R] δ) (x : direct_sum ι β) : direct_sum.to_module R ι δ f (direct_sum.lmap' h x) = direct_sum.to_module R ι δ (λ i, (f i).comp (h i)) x := begin rw ← linear_map.comp_apply, revert x, rw ← linear_map.ext_iff, apply direct_sum.linear_map_ext , intro i, apply linear_map.ext, intro b, simp, rw direct_sum.lmap'_lof, rw direct_sum.to_module_lof, end lemma direct_sum.map'_apply {β γ : ι → Type*} [Π i, add_comm_monoid (β i)] [Π i, add_comm_monoid (γ i)] [Π (i : ι) (x : β i), decidable (x ≠ 0)] [Π (i : ι) (x : γ i), decidable (x ≠ 0)] (h : Π i, β i →+ γ i) (x : direct_sum ι β) (i : ι) : direct_sum.map' h x i = h i (x i) := begin let f : direct_sum ι β →+ γ i := { to_fun := λ x, direct_sum.map' h x i, map_zero' := by simp only [map_zero, direct_sum.zero_apply], map_add' := by simp only [map_add, direct_sum.add_apply, eq_self_iff_true, forall_const], }, let g : direct_sum ι β →+ γ i := { to_fun := λ y, h i (y i), map_zero' := by simp only [direct_sum.zero_apply, map_zero], map_add' := by simp only [direct_sum.add_apply, map_add, eq_self_iff_true, forall_const], } , change f x = g x, suffices : f = g, rw this, apply direct_sum.add_hom_ext , intros j y, simp [f, g, direct_sum.map'_of], by_cases hj : j = i, { rw ← hj, simp only [direct_sum.of_eq_same], }, { simp only [direct_sum.of_eq_of_ne _ j i _ hj, map_zero], }, end /- Lemmas using direct_sum.mk : could probably be removed -/ lemma direct_sum.mk_apply {β : ι → Type*} [Π i, add_comm_monoid (β i)] (s : finset ι) (f : Π (i : s), β ↑i) (i : ι) : direct_sum.mk β s f i = dite (i ∈ s) (λ h, f ⟨i, h⟩) (λ h, 0) := rfl lemma direct_sum.mk_eq_sum' {β : ι → Type*} [Π i, add_comm_monoid (β i)] [Π (i : ι) (x : β i), decidable (x ≠ 0)] (s : finset ι) (f : Π i, β i) : direct_sum.mk β s (λ (i : ↥↑s), f i) = s.sum (λ i, direct_sum.of β i (f i)) := begin ext i, rw [direct_sum.mk_apply, dfinsupp.finset_sum_apply], split_ifs with hi hi, { rw finset.sum_eq_single_of_mem i hi, { rw [← direct_sum.lof_eq_of ℕ, direct_sum.lof_apply], refl }, { intros j hj hij, exact direct_sum.of_eq_of_ne _ _ _ _ hij }}, { apply symm, apply finset.sum_eq_zero, intros j hj, exact direct_sum.of_eq_of_ne _ _ _ _ (ne_of_mem_of_not_mem hj hi) }, end lemma dfinsupp.mk_eq_sum {β : ι → Type*} [Π i, add_comm_monoid (β i)] [Π (i : ι) (x : β i), decidable (x ≠ 0)] (s : finset ι) (f : Π i, β i) : dfinsupp.mk s (λ (i : ↥↑s), f i) = s.sum (λ i, direct_sum.of β i (f i)) := begin ext i, simp only [dfinsupp.mk_apply, dfinsupp.finset_sum_apply], split_ifs with hi hi, { rw finset.sum_eq_single_of_mem i hi, rw direct_sum.of_eq_same, refl, intros j hj hij, rw direct_sum.of_eq_of_ne, exact hij, }, { apply symm, apply finset.sum_eq_zero, intros j hj, rw direct_sum.of_eq_of_ne, intro hij, apply hi, rw ← hij, exact hj, }, end lemma direct_sum.mk_eq_sum {β : ι → Type*} [Π i, add_comm_monoid (β i)] [Π (i : ι) (x : β i), decidable (x ≠ 0)] (s : finset ι) (x : Π (i : s), β i) : direct_sum.mk β s x = s.sum (λ i, direct_sum.of β i (dite (i ∈ s) (λ hi, x ⟨i, hi⟩) (λ hi, 0) )) := begin ext i, rw [dfinsupp.finset_sum_apply, direct_sum.mk_apply], split_ifs with hi hi, { rw finset.sum_eq_single i, { rw [direct_sum.of_eq_same, dif_pos hi] }, { intros j hjs hji, exact direct_sum.of_eq_of_ne _ _ _ _ hji}, { intro his, rw [direct_sum.of_eq_same, dif_neg his] }}, { apply symm, apply finset.sum_eq_zero, intros j hj, rw direct_sum.of_eq_of_ne _ _ _ _ (ne_of_mem_of_not_mem hj hi) }, end lemma direct_sum.to_add_monoid_mk {β : ι → Type*} [Π i, add_comm_monoid (β i)] {γ : Type*} [add_comm_monoid γ] [Π (i : ι) (x : β i), decidable (x ≠ 0)] [Π (x : γ), decidable (x ≠ 0)] (ψ : Π i, (β i →+ γ)) (s : finset ι) (x : Π (i : s), β i) : direct_sum.to_add_monoid ψ (direct_sum.mk β s x) = s.sum (λ i, ψ i (dite (i ∈ s) (λ hi, x ⟨i, hi⟩) (λ hi, 0))) := begin rw [direct_sum.mk_eq_sum, map_sum], apply finset.sum_congr rfl, intros i hi, rw direct_sum.to_add_monoid_of, end lemma direct_sum.map'_apply'_old {β γ : ι → Type*} [Π i, add_comm_monoid (β i)] [Π i, add_comm_monoid (γ i)] [Π (i : ι) (x : β i), decidable (x ≠ 0)] [Π (i : ι) (x : γ i), decidable (x ≠ 0)] (h : Π i, β i →+ γ i) (x : direct_sum ι β) : direct_sum.map' h x = direct_sum.mk γ (x.support) (λ i, h i (x i)) := begin conv_lhs {rw ← direct_sum.sum_support_of β x, }, rw map_sum, simp_rw direct_sum.map'_of, apply symm, convert direct_sum.mk_eq_sum (x.support) (λ i, (h i) (x i)), apply funext, intro i, dsimp, apply congr_arg, split_ifs with hi, refl, rw dfinsupp.not_mem_support_iff at hi, rw hi, simp only [map_zero], end def zoto {β γ : ι → Type*} [Π i, add_comm_monoid (β i)] [Π i, add_comm_monoid (γ i)] [Π (i : ι) (x : β i), decidable (x ≠ 0)] [Π (i : ι) (x : γ i), decidable (x ≠ 0)] {F : Π i, Type*} [Π i, add_monoid_hom_class (F i) (β i) (γ i)] (h : Π i, F i) (B : direct_sum ι β) : Π i : (B.support : set ι), (γ i) := λ i, (h i) (B i) lemma direct_sum.map_apply' {β γ : ι → Type*} [Π i, add_comm_monoid (β i)] [Π i, add_comm_monoid (γ i)] [Π (i : ι) (x : β i), decidable (x ≠ 0)] [Π (i : ι) (x : γ i), decidable (x ≠ 0)] {F : Π i, Type*} [Π i, add_monoid_hom_class (F i) (β i) (γ i)] (h : Π i, F i) (x : direct_sum ι β) : direct_sum.map h x = direct_sum.mk γ (x.support) (zoto h x) := -- (λ i, (h i) (x i)) gives `unknown fresh 0._ ` error begin conv_lhs {rw ← direct_sum.sum_support_of β x, }, rw map_sum, simp_rw direct_sum.map_of, apply symm, convert direct_sum.mk_eq_sum (x.support) (λ i, (h i) (x i)), apply funext, intro i, dsimp, apply congr_arg, split_ifs with hi, refl, rw dfinsupp.not_mem_support_iff at hi, rw hi, simp only [map_zero], end end direct_sum section graded_quot variables (R : Type*) [comm_ring R] variables {ι : Type*} [decidable_eq ι] [add_monoid ι] variables {A : Type*} [comm_ring A] [decidable_eq A] [algebra R A] /- -- graded_algebra does not work with `submodule_class` variables {σ : Type*} [set_like σ A] [add_submonoid_class σ A] [submodule_class σ R A] variable (𝒜 : ι → σ) [h𝒜 : graded_algebra 𝒜] -/ section variables {σ : Type*} [set_like σ A] [add_submonoid_class σ A] [submodule_class σ R A] #check graded_algebra variables (ℬ : ι → σ) @[reducible] def graded_algebra' := @graded_ring _ A _ _ _ _ _ _ ℬ variable [hℬ : graded_algebra' ℬ] end variables (𝒜 : ι → submodule R A) variables (I : ideal A) -- variables [h𝒜 : graded_algebra 𝒜] (hI: ideal.is_homogeneous 𝒜 I) -- It seems I start understanding what I'm doing example : semilinear_map_class (A →+* A ⧸ I) (ring_hom.id ℤ) _ _ := { coe := λ f a, f a, coe_injective' := λ f g hfg, ring_hom.ext (λ x, function.funext_iff.mp hfg x), map_add := map_add, map_smulₛₗ := λ f r a, by simp only [zsmul_eq_mul, map_mul, map_int_cast, eq_int_cast, int.cast_id], } -- This will probably be useless in the end, because I "R-modulify" everything -- ideal.quotient.mk vs ideal.quotient.mkₐ example (I : ideal A) (r : R) (a : A) : r • (ideal.quotient.mk I a) = ideal.quotient.mk I (r • a) := map_smul (ideal.quotient.mkₐ R I) r a /-- The graded pieces of A ⧸ I -/ def quot_submodule : ι → submodule R (A ⧸ I) := λ i, submodule.map (ideal.quotient.mkₐ R I) (𝒜 i) /- broken by the passage to modules… -- I think this one can be erased, since we have the laux version /-- The decomposition at the higher level -/ def quot_decompose_aux [graded_ring 𝒜] : A → direct_sum ι (λ (i : ι), ↥(quot_submodule R 𝒜 I i)) := λ a, begin refine (direct_sum.map _) (direct_sum.decompose_linear_equiv 𝒜 a), exact λ i, { to_fun := λu, ⟨ideal.quotient.mk I ↑u, begin simp [quot_submodule, submodule.mem_map], exact ⟨↑u, u.prop, rfl⟩, end⟩, map_zero' := by simp only [←subtype.coe_inj, submodule.coe_zero, map_zero, submodule.coe_mk], map_add' := λ u v, by simp only [←subtype.coe_inj, submodule.coe_add, map_add, add_mem_class.mk_add_mk] }, end -/ def quot_comp_map (i : ι) : ↥(𝒜 i) →ₗ[R] ↥(quot_submodule R 𝒜 I i) := { to_fun := λ u, ⟨ideal.quotient.mkₐ R I ↑u, by rw [quot_submodule,submodule.mem_map]; exact ⟨↑u, u.prop, rfl⟩⟩, map_add' := λ u v, by simp only [←subtype.coe_inj, submodule.coe_add, map_add, add_mem_class.mk_add_mk], map_smul' := λ r u, by simp only [submodule.coe_smul_of_tower, ring_hom.id_apply, set_like.mk_smul_mk, subtype.mk_eq_mk, map_smul], } -- lemma quot_comp_map_surjective (i : ι) : function.surjective (quot_comp_map R 𝒜 I i) := sorry example : submodule R A := I.restrict_scalars R /-- The decomposition at the higher level -/ def quot_decompose_laux [graded_algebra 𝒜]: A →ₗ[R] direct_sum ι (λ (i : ι), ↥(quot_submodule R 𝒜 I i)) := linear_map.comp (direct_sum.lmap' (quot_comp_map R 𝒜 I)) (direct_sum.decompose_alg_equiv 𝒜).to_linear_map lemma quot_decompose_laux_of_mem_eq_zero [graded_algebra 𝒜] (hI : I.is_homogeneous 𝒜) (x : A) (hx : x ∈ I) (i : ι) : ((quot_decompose_laux R 𝒜 I) x) i = 0 := begin rw [quot_decompose_laux,linear_map.comp_apply,direct_sum.lmap'_apply, quot_comp_map], simp only [ideal.quotient.mkₐ_eq_mk, alg_equiv.to_linear_map_apply, direct_sum.decompose_alg_equiv_apply, linear_map.coe_mk, submodule.mk_eq_zero], rw ideal.quotient.eq_zero_iff_mem, exact hI i hx, end lemma quot_decompose_laux_ker [graded_algebra 𝒜] (hI : I.is_homogeneous 𝒜) : I.restrict_scalars R ≤ (quot_decompose_laux R 𝒜 I).ker := begin intros x hx, simp only [submodule.restrict_scalars_mem] at hx, rw [linear_map.mem_ker], ext i, rw [direct_sum.zero_apply, submodule.coe_zero, submodule.coe_eq_zero], apply quot_decompose_laux_of_mem_eq_zero, exact hI, exact hx, end /-- The decomposition at the higher level -/ def quot_decompose [graded_algebra 𝒜] (hI : I.is_homogeneous 𝒜) : A ⧸ I →ₗ[R] direct_sum ι (λ (i : ι), ↥(quot_submodule R 𝒜 I i)) := begin apply @submodule.liftq R A _ _ _ (I.restrict_scalars R) R (direct_sum ι (λ i, quot_submodule R 𝒜 I i) ) _ _ _ (ring_hom.id R) (quot_decompose_laux R 𝒜 I), -- without explicit arguments, it is too slow -- apply submodule.liftq (I.restrict_scalars R) (quot_decompose_laux R 𝒜 I), apply quot_decompose_laux_ker R 𝒜 I hI, end lemma quot_decompose_laux_apply_mk [graded_algebra 𝒜] (hI : I.is_homogeneous 𝒜) (a : A): quot_decompose R 𝒜 I hI (ideal.quotient.mk I a) = quot_decompose_laux R 𝒜 I a := begin rw [quot_decompose], have : ideal.quotient.mk I a = submodule.quotient.mk a := rfl, rw this, -- with explicit arguments, it times out -- exact submodule.liftq_apply (I.restrict_scalars R) (quot_decompose_laux R 𝒜 I) a, -- apply works apply submodule.liftq_apply, end def quot_decomposition_left_inv [graded_algebra 𝒜] (hI : I.is_homogeneous 𝒜) : function.left_inverse (direct_sum.coe_add_monoid_hom (quot_submodule R 𝒜 I)) (quot_decompose R 𝒜 I hI) := λ a, begin obtain ⟨a, rfl⟩ := (ideal.quotient.mk I).is_surjective a, rw quot_decompose_laux_apply_mk, rw quot_decompose_laux, simp only [linear_map.comp_apply], let h𝒜 : direct_sum.decomposition 𝒜 := by apply_instance, let ha := h𝒜.left_inv a, have : (direct_sum.decompose_alg_equiv 𝒜).to_linear_map a = direct_sum.decomposition.decompose' a, refl, rw this, conv_rhs {rw ← h𝒜.left_inv a}, change _ = submodule.mkq (I.restrict_scalars R) (_), simp only [←linear_map.to_add_monoid_hom_coe], rw direct_sum.lmap'_to_add_monoid_hom_eq_map', simp only [← add_monoid_hom.comp_apply], generalize : direct_sum.decomposition.decompose' a = b, revert b, rw ← add_monoid_hom.ext_iff, apply direct_sum.add_hom_ext, intros i y, simp only [add_monoid_hom.coe_comp, function.comp_app, linear_map.to_add_monoid_hom_coe, direct_sum.coe_add_monoid_hom_of, submodule.mkq_apply], rw direct_sum.map'_of, rw direct_sum.coe_add_monoid_hom_of, simp only [linear_map.to_add_monoid_hom_coe], rw [quot_comp_map], simp only [ideal.quotient.mkₐ_eq_mk, linear_map.coe_mk, submodule.coe_mk], refl, end def quot_decomposition_right_inv [graded_algebra 𝒜] (hI : I.is_homogeneous 𝒜) : function.right_inverse (direct_sum.coe_add_monoid_hom (quot_submodule R 𝒜 I)) (quot_decompose R 𝒜 I hI) := λ x, begin simp only [←linear_map.to_add_monoid_hom_coe], rw ← add_monoid_hom.comp_apply, conv_rhs {rw ← add_monoid_hom.id_apply _ x}, revert x, rw ← add_monoid_hom.ext_iff, apply direct_sum.add_hom_ext, intros i y, obtain ⟨x, hx, hxy⟩ := y.prop, simp only [add_monoid_hom.coe_comp, linear_map.to_add_monoid_hom_coe, function.comp_app, direct_sum.coe_add_monoid_hom_of, add_monoid_hom.id_apply], rw ←hxy, rw ideal.quotient.mkₐ_eq_mk, rw quot_decompose_laux_apply_mk, rw quot_decompose_laux, simp only [linear_map.coe_comp, function.comp_app, alg_equiv.to_linear_map_apply, direct_sum.decompose_alg_equiv_apply], change direct_sum.lmap' _ (direct_sum.decompose 𝒜 x) = _, suffices : direct_sum.decompose 𝒜 x = direct_sum.lof R ι (λ i, 𝒜 i) i (⟨x, hx⟩ : 𝒜 i), rw this, rw direct_sum.lmap'_lof, rw direct_sum.lof_eq_of, apply congr_arg2 _ rfl, rw quot_comp_map, simp only [ideal.quotient.mkₐ_eq_mk, submodule.coe_mk, linear_map.coe_mk], rw [←subtype.coe_inj, subtype.coe_mk], rw ←hxy, simp only [ideal.quotient.mkₐ_eq_mk], conv_lhs {rw ← subtype.coe_mk x hx }, rw direct_sum.decompose_coe, rw direct_sum.lof_eq_of, end def quot_decomposition [graded_algebra 𝒜] (hI : I.is_homogeneous 𝒜) : direct_sum.decomposition (quot_submodule R 𝒜 I) := { decompose' := quot_decompose R 𝒜 I hI, left_inv := quot_decomposition_left_inv R 𝒜 I hI, right_inv := quot_decomposition_right_inv R 𝒜 I hI } lemma mem_quot_submodule_iff (i : ι) (g : A ⧸ I): g ∈ quot_submodule R 𝒜 I i ↔ ∃ (a : A), a ∈ 𝒜 i ∧ideal.quotient.mk I a = g := by rw [quot_submodule, submodule.mem_map, ideal.quotient.mkₐ_eq_mk] /-- The quotient of a graded algebra by a homogeneous ideal, as a graded algebra -/ def graded_quot_alg [graded_algebra 𝒜] (hI : I.is_homogeneous 𝒜) : graded_algebra (quot_submodule R 𝒜 I) := { to_decomposition := quot_decomposition R 𝒜 I hI, to_graded_monoid := { one_mem := by rw [quot_submodule, submodule.mem_map]; exact ⟨1, set_like.one_mem_graded 𝒜, rfl⟩, mul_mem := λ i j gi gj hgi hgj, begin rw mem_quot_submodule_iff at hgi hgj ⊢, obtain ⟨ai, hai, rfl⟩ := hgi, obtain ⟨aj, haj, rfl⟩ := hgj, exact ⟨ai * aj, set_like.mul_mem_graded hai haj, map_mul _ _ _⟩, end }} #exit -- variable (rel : A → A → Prop) -- open_locale big_operators /- def weights [graded_ring 𝒜] [Π (i : ι) (x : ↥(𝒜 i)), decidable (x ≠ 0)] (a : A) := dfinsupp.support (direct_sum.decompose 𝒜 a) def is_homogenous [graded_ring 𝒜] [Π (i : ι) (x : ↥(𝒜 i)), decidable (x ≠ 0)] (a : A) := subsingleton (weights 𝒜 a) -/ example (R S : Type*) [comm_ring R] [comm_ring S] (f : R →+* S) (I : submonoid R) : submonoid S := submonoid.map f I example (R : Type*) [comm_ring R] (I : ideal R) (M : ideal R) : ideal (R ⧸ I) := ideal.map (ideal.quotient.mk I) M example (R S : Type*) [comm_ring R] [comm_ring S] (f : R →+* S) (I : ideal R) : ideal S := ideal.map f I def graded_quot_submonoid (𝒜 : ι → σ) : ι → add_submonoid (A ⧸ I) := λ i, add_submonoid.map (ideal.quotient.mk I) ⟨𝒜 i, λ _ _, add_mem, zero_mem _⟩ def graded_quot_submonoid' (𝒜 : ι → submodule ℤ A) : ι → add_submonoid (A ⧸ I) := begin sorry --haveI : --exact λ i, submodule.map (ideal.quotient.mk I) (𝒜 i) end example (i : ι) : add_comm_monoid (graded_quot_submonoid I 𝒜 i) := infer_instance noncomputable def quot_some : A ⧸ I → A := function.surj_inv (ideal.quotient.mk_surjective) example (a : A ⧸ I) : ideal.quotient.mk I (quot_some I a) = a := function.surj_inv_eq _ _ noncomputable def toto := λ a i, ideal.quotient.mk I ((h𝒜.decompose' (quot_some I a)) i) noncomputable def tata := λ a, dfinsupp.support (h𝒜.decompose' (quot_some I a)) lemma direct_sum.comp_to_add_monoid {ι : Type*} [dec_ι : decidable_eq ι] {β : ι → Type*} [Π (i : ι), add_comm_monoid (β i)] {γ δ : Type*} [add_comm_monoid γ] [add_comm_monoid δ] (f : γ →+ δ) (φ : Π (i : ι), β i →+ γ) : f.comp (direct_sum.to_add_monoid φ) = direct_sum.to_add_monoid (λ i, f.comp (φ i)) := begin apply direct_sum.add_hom_ext, intros i y, simp only [direct_sum.to_add_monoid_of, add_monoid_hom.coe_comp, function.comp_app], end example {ι : Type*} [dec_ι : decidable_eq ι] {β : ι → Type*} [Π (i : ι), add_comm_monoid (β i)] {γ δ : Type*} [add_comm_monoid γ] [add_comm_monoid δ] (f : γ →+ δ) (φ : Π (i : ι), β i →+ γ) (x : direct_sum ι β) : f (direct_sum.to_add_monoid φ x) = direct_sum.to_add_monoid (λ i, f.comp (φ i)) x := by rw [← add_monoid_hom.comp_apply, direct_sum.comp_to_add_monoid] instance asdf : Π (i : ι), add_comm_monoid ((λ (i : ι), ↥(graded_quot_submonoid I 𝒜 i)) i) := sorry example [Π (x : A), decidable (x ≠ 0)] [Π (i : ι) (x : ↥(graded_quot_submonoid I 𝒜 i)), decidable (x ≠ 0)] [decidable_pred (λ x, x ∈ I)] : -- [h𝒜 : graded_ring 𝒜] : A → direct_sum ι (λ (i : ι), ↥(graded_quot_submonoid I 𝒜 i)) := λ a, begin haveI : Π i, add_comm_monoid (𝒜 i), intro i, apply_instance, suffices hh : direct_sum ι (λ i, 𝒜 i) →+ direct_sum ι (λ i, graded_quot_submonoid I 𝒜 i), sorry, -- exact hh (direct_sum.decompose 𝒜 a), apply direct_sum.map, /- intro i, let h : Π i, (𝒜 i) →+ graded_quot_submonoid 𝒜 I i := -/ exact λ i, { to_fun := λu, begin use ideal.quotient.mk I ↑u, simp only [graded_quot_submonoid, add_submonoid.mem_map, add_submonoid.mem_mk, set_like.mem_coe, exists_prop], exact ⟨↑u, u.prop, rfl⟩, end, map_zero' := begin rw ←subtype.coe_inj, simp only [add_submonoid.coe_zero, map_zero, set_like.coe_mk], sorry -- simp only [zero_mem_class.coe_eq_zero], -- simp only [zero_mem_class.coe_zero, map_zero, set_like.coe_mk], end, map_add' := λ u v, begin rw ←subtype.coe_inj, sorry --simp only [add_mem_class.coe_add, map_add, add_submonoid.mk_add_mk], end, }, /- haveI : Π i, add_comm_monoid (𝒜 i), intro i, apply_instance, have hh : direct_sum ι (λ i, 𝒜 i) →+ direct_sum ι (λ i, graded_quot_submonoid 𝒜 I i), apply direct_sum.map, -/ end example [Π (x : A), decidable (x ≠ 0)] [Π (i : ι) (x : ↥(graded_quot_submonoid I 𝒜 i)), decidable (x ≠ 0)] [decidable_pred (λ x, x ∈ I)] : direct_sum.decomposition (graded_quot_submonoid I 𝒜) := sorry/- { decompose' := /- direct_sum.mk (λ i, (graded_quot_submonoid 𝒜 I i)) (dfinsupp.support (h𝒜.decompose' (quot_some I a))) (λ i, ⟨ideal.quotient.mk I ((h𝒜.decompose' (quot_some I a)) i), add_submonoid.mem_map_of_mem _ (by simp only [subtype.val_eq_coe, add_submonoid.mem_mk, set_like.mem_coe, set_like.coe_mem])⟩), -/ begin sorry end, left_inv := λ a, begin /- have : ideal.quotient.mk I (quot_some I a) = a := function.surj_inv_eq _ _, conv_rhs { rw ← this, rw ← h𝒜.left_inv (quot_some I a), }, dsimp only, generalize : direct_sum.decomposition.decompose' (quot_some I a) = b, resetI, rw [direct_sum.to_add_monoid.unique], rw ← add_monoid_hom.comp_apply, have : (ideal.quotient.mk I) ((direct_sum.coe_add_monoid_hom 𝒜) b) = (ideal.quotient.mk I).to_add_monoid_hom.comp (direct_sum.coe_add_monoid_hom 𝒜) b, rw add_monoid_hom.comp_apply, refl, rw this, dsimp, simp_rw direct_sum.to_add_monoid_mk, have : ∀ i, (direct_sum.coe_add_monoid_hom (graded_quot_submonoid 𝒜 I)).comp (direct_sum.of (λ (i : ι), ↥(graded_quot_submonoid 𝒜 I i)) i) = _, -/sorry, end, right_inv := λ a, begin dsimp, ext i, sorry, end } -/ --sorry /- def graded_ring_quot : graded_ring (graded_quot_submonoid 𝒜 I hI) := sorry #check graded_quot example (I : ideal A) [graded_ring 𝒜] (hI: ideal.is_homogeneous 𝒜 I) : graded_algebra (graded_quot 𝒜 I hI) := begin end -/ end graded_quot
-- @@stderr -- dtrace: failed to compile script test/unittest/pointers/err.D_OP_INCOMPAT.VoidPointerArith.d: [D_OP_INCOMPAT] line 22: operands have incompatible types: "void *" + "int"
% GEOM3D Geometry 3D Toolbox % Version 1.22 06-Jun-2018 . % % Creation, transformations, algorithms and visualization of geometrical % 3D primitives, such as points, lines, planes, polyhedra, circles and % spheres. % % Euler Angles are defined as follow: % PHI is the azimut, i.e. the angle of the projection on horizontal plane % with the Ox axis, with value beween 0 and 180 degrees. % THETA is the latitude, i.e. the angle with the Oz axis, with value % between -90 and +90 degrees. % PSI is the 'roll', i.e. the rotation around the (PHI, THETA) direction, % with value in degrees % See also the 'angles3d' page. % % Base format for primitives: % Point: [x0 y0 z0] % Vector: [dx dy dz] % Line: [x0 y0 z0 dx dy dz] % Edge: [x1 y1 z1 x2 y2 z2] % Plane: [x0 y0 z0 dx1 dy1 dz1 dx2 dy2 dz2] % Sphere: [x0 y0 z0 R] % Circle: [x0 y0 z0 R PHI THETA PSI] (origin+center+normal+'roll'). % Ellipsoid: [x0 y0 z0 A B C PHI THETA PSI] % Cylinder: [X1 Y1 Z1 X2 Y2 Z2 R] % Box: [xmin xmax ymin ymax zmin zmax]. Used for clipping shapes. % % Polygons are represented by N-by-3 array of points, the last point is % not necessarily the same as the first one. Points must be coplanar. % % % 3D Points % points3d - Description of functions operating on 3D points. % midPoint3d - Middle point of two 3D points or of a 3D edge. % isCoplanar - Tests input points for coplanarity in 3-space. % transformPoint3d - Transform a point with a 3D affine transform. % distancePoints3d - Compute euclidean distance between pairs of 3D Points. % clipPoints3d - Clip a set of points by a box or other 3d shapes. % drawPoint3d - Draw 3D point on the current axis. % % 3D Vectors % vectors3d - Description of functions operating on 3D vectors. % transformVector3d - Transform a vector with a 3D affine transform. % normalizeVector3d - Normalize a 3D vector to have norm equal to 1. % vectorNorm3d - Norm of a 3D vector or of set of 3D vectors. % hypot3 - Diagonal length of a cuboidal 3D box . % crossProduct3d - Vector cross product faster than inbuilt MATLAB cross. % vectorAngle3d - Angle between two 3D vectors. % isParallel3d - Check parallelism of two 3D vectors. % isPerpendicular3d - Check orthogonality of two 3D vectors. % drawVector3d - Draw vector at a given position. % % Angles % angles3d - Conventions for manipulating angles in 3D. % anglePoints3d - Compute angle between three 3D points. % sphericalAngle - Compute angle between points on the sphere. % angleSort3d - Sort 3D coplanar points according to their angles in plane. % randomAngle3d - Return a 3D angle uniformly distributed on unit sphere. % % Coordinate transforms % sph2cart2 - Convert spherical coordinates to cartesian coordinates. % cart2sph2 - Convert cartesian coordinates to spherical coordinates. % cart2sph2d - Convert cartesian coordinates to spherical coordinates in degrees. % sph2cart2d - Convert spherical coordinates to cartesian coordinates in degrees. % cart2cyl - Convert cartesian to cylindrical coordinates. % cyl2cart - Convert cylindrical to cartesian coordinates. % % 3D Lines and Edges % lines3d - Description of functions operating on 3D lines. % edges3d - Description of functions operating on 3D edges. % createLine3d - Create a line with various inputs. % createEdge3d - Create an edge between two 3D points, or from a 3D line. % fitLine3d - Fit a 3D line to a set of points. % parallelLine3d - Create 3D line parallel to another one. % projPointOnLine3d - Project a 3D point orthogonally onto a 3D line. % distancePointLine3d - Euclidean distance between 3D point and line. % isPointOnLine3d - Test if a 3D point belongs to a 3D line. % distancePointEdge3d - Minimum distance between a 3D point and a 3D edge. % linePosition3d - Return the position of a 3D point projected on a 3D line. % distanceLines3d - Minimal distance between two 3D lines. % transformLine3d - Transform a 3D line with a 3D affine transform. % reverseLine3d - Return same 3D line but with opposite orientation. % midPoint3d - Middle point of two 3D points or of a 3D edge. % edgeLength3d - Return the length of a 3D edge. % clipEdge3d - Clip a 3D edge with a cuboid box. % lineToEdge3d - Convert a 3D straight line to a 3D finite edge. % edgeToLine3d - Convert a 3D edge to a 3D straight line. % clipLine3d - Clip a line with a box and return an edge. % drawEdge3d - Draw 3D edge in the current axes. % drawLine3d - Draw a 3D line clipped by the current axes. % % Planes % planes3d - Description of functions operating on 3D planes. % createPlane - Create a plane in parametrized form. % fitPlane - Fit a 3D plane to a set of points. % normalizePlane - Normalize parametric representation of a plane. % parallelPlane - Parallel to a plane through a point or at a given distance. % reversePlane - Return same 3D plane but with opposite orientation. % isPlane - Check if input is a plane. % transformPlane3d - Transform a 3D plane with a 3D affine transform. % planesBisector - Bisector plane between two other planes. % projPointOnPlane - Return the orthogonal projection of a point on a plane. % intersectPlanes - Return intersection line between 2 planes in space. % intersectThreePlanes - Return intersection point between 3 planes in space. % intersectLinePlane - Intersection point between a 3D line and a plane. % intersectEdgePlane - Return intersection point between a plane and a edge. % distancePointPlane - Signed distance betwen 3D point and plane. % projLineOnPlane - Return the orthogonal projection of a line on a plane. % isBelowPlane - Test whether a point is below or above a plane. % medianPlane - Create a plane in the middle of 2 points. % planeNormal - Compute the normal to a plane. % planePosition - Compute position of a point on a plane. % planePoint - Compute 3D position of a point in a plane. % dihedralAngle - Compute dihedral angle between 2 planes. % drawPlane3d - Draw a plane clipped by the current axes. % % 3D Polygons and curves % polygons3d - Description of functions operating on 3D polygons. % polygonCentroid3d - Centroid (or center of mass) of a polygon. % polygonArea3d - Area of a 3D polygon. % polygon3dNormalAngle - Normal angle at a vertex of the 3D polygon. % intersectLinePolygon3d - Intersection point of a 3D line and a 3D polygon. % intersectRayPolygon3d - Intersection point of a 3D ray and a 3D polygon. % clipConvexPolygon3dHP - Clip a convex 3D polygon with Half-space. % drawPolygon3d - Draw a 3D polygon specified by a list of vertex coords. % drawPolyline3d - Draw a 3D polyline specified by a list of vertex coords. % fillPolygon3d - Fill a 3D polygon specified by a list of vertex coords. % % 3D Triangles % triangleArea3d - Area of a 3D triangle. % distancePointTriangle3d - Minimum distance between a 3D point and a 3D triangle. % intersectLineTriangle3d - Intersection point of a 3D line and a 3D triangle. % % 3D circles and ellipses % circles3d - Description of functions operating on 3D circles. % fitCircle3d - Fit a 3D circle to a set of points. % circle3dPosition - Return the angular position of a point on a 3D circle. % circle3dPoint - Coordinates of a point on a 3D circle from its position. % circle3dOrigin - Return the first point of a 3D circle. % drawCircle3d - Draw a 3D circle. % drawCircleArc3d - Draw a 3D circle arc. % drawEllipse3d - Draw a 3D ellipse. % % Spheres % spheres - Description of functions operating on 3D spheres. % createSphere - Create a sphere containing 4 points. % intersectLineSphere - Return intersection points between a line and a sphere. % intersectPlaneSphere - Return intersection circle between a plane and a sphere. % drawSphere - Draw a sphere as a mesh. % drawSphericalEdge - Draw an edge on the surface of a sphere. % drawSphericalTriangle - Draw a triangle on a sphere. % fillSphericalTriangle - Fill a triangle on a sphere. % drawSphericalPolygon - Draw a spherical polygon. % fillSphericalPolygon - Fill a spherical polygon. % sphericalVoronoiDomain - Compute a spherical voronoi domain. % % Smooth surfaces % equivalentEllipsoid - Equivalent ellipsoid of a set of 3D points. % fitEllipse3d - Fit an ellipse to a set of points. % ellipsoidSurfaceArea - Approximated surface area of an ellipsoid. % oblateSurfaceArea - Approximated surface area of an oblate ellipsoid. % prolateSurfaceArea - Approximated surface area of a prolate ellipsoid. % cylinderSurfaceArea - Surface area of a cylinder. % intersectLineCylinder - Compute intersection points between a line and a cylinder. % revolutionSurface - Create a surface of revolution from a planar curve. % surfaceCurvature - Curvature on a surface from angle and principal curvatures. % drawEllipsoid - Draw a 3D ellipsoid. % drawTorus - Draw a torus (3D ring). % drawCylinder - Draw a cylinder. % drawEllipseCylinder - Draw a cylinder with ellipse cross-section. % drawSurfPatch - Draw a 3D surface patch, with 2 parametrized surfaces. % % Bounding boxes management % boxes3d - Description of functions operating on 3D boxes. % boundingBox3d - Bounding box of a set of 3D points. % orientedBox3d - Object-oriented bounding box of a set of 3D points. % intersectBoxes3d - Intersection of two 3D bounding boxes. % mergeBoxes3d - Merge 3D boxes, by computing their greatest extent. % box3dVolume - Volume of a 3-dimensional box. % randomPointInBox3d - Generate random point(s) within a 3D box. % drawBox3d - Draw a 3D box defined by coordinate extents. % % Geometric transforms % transforms3d - Conventions for manipulating 3D affine transforms. % fitAffineTransform3d - Fit an affine transform using two point sets. % registerPoints3dAffine - Fit 3D affine transform using iterative algorithm. % createTranslation3d - Create the 4x4 matrix of a 3D translation. % createScaling3d - Create the 4x4 matrix of a 3D scaling. % createRotationOx - Create the 4x4 matrix of a 3D rotation around x-axis. % createRotationOy - Create the 4x4 matrix of a 3D rotation around y-axis. % createRotationOz - Create the 4x4 matrix of a 3D rotation around z-axis. % createBasisTransform3d - Compute matrix for transforming a basis into another basis. % eulerAnglesToRotation3d - Convert 3D Euler angles to 3D rotation matrix. % isTransform3d - Check if input is a affine transformation matrix. % rotation3dToEulerAngles - Extract Euler angles from a rotation matrix. % createRotation3dLineAngle - Create rotation around a line by an angle theta. % rotation3dAxisAndAngle - Determine axis and angle of a 3D rotation matrix. % createRotationVector3d - Calculates the rotation between two vectors. % createRotationVectorPoint3d - Calculates the rotation between two vectors. % recenterTransform3d - Change the fixed point of an affine 3D transform. % composeTransforms3d - Concatenate several space transformations. % % Various drawing Functions % drawGrid3d - Draw a 3D grid on the current axis. % drawAxis3d - Draw a coordinate system and an origin. % drawAxisCube - Draw a colored cube representing axis orientation. % drawCube - Draw a 3D centered cube, eventually rotated. % drawCuboid - Draw a 3D cuboid, eventually rotated. % drawPlatform - Draw a rectangular platform with a given size. % drawLabels3d - Draw text labels at specified 3D positions. % % % Credits: % * Several functions contributed by Sven Holcombe % * function isCoplanar was originally written by Brett Shoelson. % * Songbai Ji enhanced file intersectPlaneLine (6/23/2006). % * several functions contributed by oqilipo % % ------ % Author: David Legland % e-mail: [email protected] % Created: 2005-11-07 % Homepage: http://github.com/mattools/matGeom % http://www.pfl-cepia.inra.fr/index.php?page=geom3d % Copyright 2005 INRA % In development: % clipPolygon3dHP - clip a 3D polygon with Half-space. % drawPartialPatch - draw surface patch, with 2 parametrized surfaces. % Deprecated: % vectorCross3d - Vector cross product faster than inbuilt MATLAB cross. % inertiaEllipsoid - Inertia ellipsoid of a set of 3D points. % Others
Load LFindLoad. From lfind Require Import LFind. From QuickChick Require Import QuickChick. From adtind Require Import goal33. Derive Show for natural. Derive Arbitrary for natural. Instance Dec_Eq_natural : Dec_Eq natural. Proof. dec_eq. Qed. Lemma conj34eqsynthconj5 : forall (lv0 : natural), (@eq natural (Succ lv0) (plus Zero (Succ lv0))). Admitted. QuickChick conj34eqsynthconj5.
= = Breed characteristics = =
If $c \neq 0$, then $f \in L^p(F,g)$ if and only if $\frac{f}{c} \in L^p(F,g)$.
/- Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import data.list.basic import data.seq.seq namespace stream open function universes u v w /- coinductive wseq (α : Type u) : Type u | nil : wseq α | cons : α → wseq α → wseq α | think : wseq α → wseq α -/ /-- Weak sequences. While the `seq` structure allows for lists which may not be finite, a weak sequence also allows the computation of each element to involve an indeterminate amount of computation, including possibly an infinite loop. This is represented as a regular `seq` interspersed with `none` elements to indicate that computation is ongoing. This model is appropriate for Haskell style lazy lists, and is closed under most interesting computation patterns on infinite lists, but conversely it is difficult to extract elements from it. -/ def wseq (α) := seq (option α) namespace wseq variables {α : Type u} {β : Type v} {γ : Type w} /-- Turn a sequence into a weak sequence -/ def of_seq : seq α → wseq α := (<$>) some /-- Turn a list into a weak sequence -/ def of_list (l : list α) : wseq α := of_seq l /-- Turn a stream into a weak sequence -/ def of_stream (l : stream α) : wseq α := of_seq l instance coe_seq : has_coe (seq α) (wseq α) := ⟨of_seq⟩ instance coe_list : has_coe (list α) (wseq α) := ⟨of_list⟩ instance coe_stream : has_coe (stream α) (wseq α) := ⟨of_stream⟩ /-- The empty weak sequence -/ def nil : wseq α := seq.nil instance : inhabited (wseq α) := ⟨nil⟩ /-- Prepend an element to a weak sequence -/ def cons (a : α) : wseq α → wseq α := seq.cons (some a) /-- Compute for one tick, without producing any elements -/ def think : wseq α → wseq α := seq.cons none /-- Destruct a weak sequence, to (eventually possibly) produce either `none` for `nil` or `some (a, s)` if an element is produced. -/ def destruct : wseq α → computation (option (α × wseq α)) := computation.corec (λ s, match seq.destruct s with | none := sum.inl none | some (none, s') := sum.inr s' | some (some a, s') := sum.inl (some (a, s')) end) /-- Recursion principle for weak sequences, compare with `list.rec_on`. -/ def rec_on {C : wseq α → Sort v} (s : wseq α) (h1 : C nil) (h2 : ∀ x s, C (cons x s)) (h3 : ∀ s, C (think s)) : C s := seq.rec_on s h1 (λ o, option.rec_on o h3 h2) /-- membership for weak sequences-/ protected def mem (a : α) (s : wseq α) := seq.mem (some a) s instance : has_mem α (wseq α) := ⟨wseq.mem⟩ theorem not_mem_nil (a : α) : a ∉ @nil α := seq.not_mem_nil a /-- Get the head of a weak sequence. This involves a possibly infinite computation. -/ def head (s : wseq α) : computation (option α) := computation.map ((<$>) prod.fst) (destruct s) /-- Encode a computation yielding a weak sequence into additional `think` constructors in a weak sequence -/ def flatten : computation (wseq α) → wseq α := seq.corec (λ c, match computation.destruct c with | sum.inl s := seq.omap return (seq.destruct s) | sum.inr c' := some (none, c') end) /-- Get the tail of a weak sequence. This doesn't need a `computation` wrapper, unlike `head`, because `flatten` allows us to hide this in the construction of the weak sequence itself. -/ def tail (s : wseq α) : wseq α := flatten $ (λ o, option.rec_on o nil prod.snd) <$> destruct s /-- drop the first `n` elements from `s`. -/ def drop (s : wseq α) : ℕ → wseq α | 0 := s | (n+1) := tail (drop n) attribute [simp] drop /-- Get the nth element of `s`. -/ def nth (s : wseq α) (n : ℕ) : computation (option α) := head (drop s n) /-- Convert `s` to a list (if it is finite and completes in finite time). -/ def to_list (s : wseq α) : computation (list α) := @computation.corec (list α) (list α × wseq α) (λ ⟨l, s⟩, match seq.destruct s with | none := sum.inl l.reverse | some (none, s') := sum.inr (l, s') | some (some a, s') := sum.inr (a::l, s') end) ([], s) /-- Get the length of `s` (if it is finite and completes in finite time). -/ def length (s : wseq α) : computation ℕ := @computation.corec ℕ (ℕ × wseq α) (λ ⟨n, s⟩, match seq.destruct s with | none := sum.inl n | some (none, s') := sum.inr (n, s') | some (some a, s') := sum.inr (n+1, s') end) (0, s) /-- A weak sequence is finite if `to_list s` terminates. Equivalently, it is a finite number of `think` and `cons` applied to `nil`. -/ class is_finite (s : wseq α) : Prop := (out : (to_list s).terminates) instance to_list_terminates (s : wseq α) [h : is_finite s] : (to_list s).terminates := h.out /-- Get the list corresponding to a finite weak sequence. -/ def get (s : wseq α) [is_finite s] : list α := (to_list s).get /-- A weak sequence is *productive* if it never stalls forever - there are always a finite number of `think`s between `cons` constructors. The sequence itself is allowed to be infinite though. -/ class productive (s : wseq α) : Prop := (nth_terminates : ∀ n, (nth s n).terminates) theorem productive_iff (s : wseq α) : productive s ↔ ∀ n, (nth s n).terminates := ⟨λ h, h.1, λ h, ⟨h⟩⟩ instance nth_terminates (s : wseq α) [h : productive s] : ∀ n, (nth s n).terminates := h.nth_terminates instance head_terminates (s : wseq α) [productive s] : (head s).terminates := s.nth_terminates 0 /-- Replace the `n`th element of `s` with `a`. -/ def update_nth (s : wseq α) (n : ℕ) (a : α) : wseq α := @seq.corec (option α) (ℕ × wseq α) (λ ⟨n, s⟩, match seq.destruct s, n with | none, n := none | some (none, s'), n := some (none, n, s') | some (some a', s'), 0 := some (some a', 0, s') | some (some a', s'), 1 := some (some a, 0, s') | some (some a', s'), (n+2) := some (some a', n+1, s') end) (n+1, s) /-- Remove the `n`th element of `s`. -/ def remove_nth (s : wseq α) (n : ℕ) : wseq α := @seq.corec (option α) (ℕ × wseq α) (λ ⟨n, s⟩, match seq.destruct s, n with | none, n := none | some (none, s'), n := some (none, n, s') | some (some a', s'), 0 := some (some a', 0, s') | some (some a', s'), 1 := some (none, 0, s') | some (some a', s'), (n+2) := some (some a', n+1, s') end) (n+1, s) /-- Map the elements of `s` over `f`, removing any values that yield `none`. -/ def filter_map (f : α → option β) : wseq α → wseq β := seq.corec (λ s, match seq.destruct s with | none := none | some (none, s') := some (none, s') | some (some a, s') := some (f a, s') end) /-- Select the elements of `s` that satisfy `p`. -/ def filter (p : α → Prop) [decidable_pred p] : wseq α → wseq α := filter_map (λ a, if p a then some a else none) -- example of infinite list manipulations /-- Get the first element of `s` satisfying `p`. -/ def find (p : α → Prop) [decidable_pred p] (s : wseq α) : computation (option α) := head $ filter p s /-- Zip a function over two weak sequences -/ def zip_with (f : α → β → γ) (s1 : wseq α) (s2 : wseq β) : wseq γ := @seq.corec (option γ) (wseq α × wseq β) (λ ⟨s1, s2⟩, match seq.destruct s1, seq.destruct s2 with | some (none, s1'), some (none, s2') := some (none, s1', s2') | some (some a1, s1'), some (none, s2') := some (none, s1, s2') | some (none, s1'), some (some a2, s2') := some (none, s1', s2) | some (some a1, s1'), some (some a2, s2') := some (some (f a1 a2), s1', s2') | _, _ := none end) (s1, s2) /-- Zip two weak sequences into a single sequence of pairs -/ def zip : wseq α → wseq β → wseq (α × β) := zip_with prod.mk /-- Get the list of indexes of elements of `s` satisfying `p` -/ def find_indexes (p : α → Prop) [decidable_pred p] (s : wseq α) : wseq ℕ := (zip s (stream.nats : wseq ℕ)).filter_map (λ ⟨a, n⟩, if p a then some n else none) /-- Get the index of the first element of `s` satisfying `p` -/ def find_index (p : α → Prop) [decidable_pred p] (s : wseq α) : computation ℕ := (λ o, option.get_or_else o 0) <$> head (find_indexes p s) /-- Get the index of the first occurrence of `a` in `s` -/ def index_of [decidable_eq α] (a : α) : wseq α → computation ℕ := find_index (eq a) /-- Get the indexes of occurrences of `a` in `s` -/ def indexes_of [decidable_eq α] (a : α) : wseq α → wseq ℕ := find_indexes (eq a) /-- `union s1 s2` is a weak sequence which interleaves `s1` and `s2` in some order (nondeterministically). -/ def union (s1 s2 : wseq α) : wseq α := @seq.corec (option α) (wseq α × wseq α) (λ ⟨s1, s2⟩, match seq.destruct s1, seq.destruct s2 with | none, none := none | some (a1, s1'), none := some (a1, s1', nil) | none, some (a2, s2') := some (a2, nil, s2') | some (none, s1'), some (none, s2') := some (none, s1', s2') | some (some a1, s1'), some (none, s2') := some (some a1, s1', s2') | some (none, s1'), some (some a2, s2') := some (some a2, s1', s2') | some (some a1, s1'), some (some a2, s2') := some (some a1, cons a2 s1', s2') end) (s1, s2) /-- Returns `tt` if `s` is `nil` and `ff` if `s` has an element -/ def is_empty (s : wseq α) : computation bool := computation.map option.is_none $ head s /-- Calculate one step of computation -/ def compute (s : wseq α) : wseq α := match seq.destruct s with | some (none, s') := s' | _ := s end /-- Get the first `n` elements of a weak sequence -/ def take (s : wseq α) (n : ℕ) : wseq α := @seq.corec (option α) (ℕ × wseq α) (λ ⟨n, s⟩, match n, seq.destruct s with | 0, _ := none | m+1, none := none | m+1, some (none, s') := some (none, m+1, s') | m+1, some (some a, s') := some (some a, m, s') end) (n, s) /-- Split the sequence at position `n` into a finite initial segment and the weak sequence tail -/ def split_at (s : wseq α) (n : ℕ) : computation (list α × wseq α) := @computation.corec (list α × wseq α) (ℕ × list α × wseq α) (λ ⟨n, l, s⟩, match n, seq.destruct s with | 0, _ := sum.inl (l.reverse, s) | m+1, none := sum.inl (l.reverse, s) | m+1, some (none, s') := sum.inr (n, l, s') | m+1, some (some a, s') := sum.inr (m, a::l, s') end) (n, [], s) /-- Returns `tt` if any element of `s` satisfies `p` -/ def any (s : wseq α) (p : α → bool) : computation bool := computation.corec (λ s : wseq α, match seq.destruct s with | none := sum.inl ff | some (none, s') := sum.inr s' | some (some a, s') := if p a then sum.inl tt else sum.inr s' end) s /-- Returns `tt` if every element of `s` satisfies `p` -/ def all (s : wseq α) (p : α → bool) : computation bool := computation.corec (λ s : wseq α, match seq.destruct s with | none := sum.inl tt | some (none, s') := sum.inr s' | some (some a, s') := if p a then sum.inr s' else sum.inl ff end) s /-- Apply a function to the elements of the sequence to produce a sequence of partial results. (There is no `scanr` because this would require working from the end of the sequence, which may not exist.) -/ def scanl (f : α → β → α) (a : α) (s : wseq β) : wseq α := cons a $ @seq.corec (option α) (α × wseq β) (λ ⟨a, s⟩, match seq.destruct s with | none := none | some (none, s') := some (none, a, s') | some (some b, s') := let a' := f a b in some (some a', a', s') end) (a, s) /-- Get the weak sequence of initial segments of the input sequence -/ def inits (s : wseq α) : wseq (list α) := cons [] $ @seq.corec (option (list α)) (dlist α × wseq α) (λ ⟨l, s⟩, match seq.destruct s with | none := none | some (none, s') := some (none, l, s') | some (some a, s') := let l' := l.concat a in some (some l'.to_list, l', s') end) (dlist.empty, s) /-- Like take, but does not wait for a result. Calculates `n` steps of computation and returns the sequence computed so far -/ def collect (s : wseq α) (n : ℕ) : list α := (seq.take n s).filter_map id /-- Append two weak sequences. As with `seq.append`, this may not use the second sequence if the first one takes forever to compute -/ def append : wseq α → wseq α → wseq α := seq.append /-- Map a function over a weak sequence -/ def map (f : α → β) : wseq α → wseq β := seq.map (option.map f) /-- Flatten a sequence of weak sequences. (Note that this allows empty sequences, unlike `seq.join`.) -/ def join (S : wseq (wseq α)) : wseq α := seq.join ((λ o : option (wseq α), match o with | none := seq1.ret none | some s := (none, s) end) <$> S) /-- Monadic bind operator for weak sequences -/ def bind (s : wseq α) (f : α → wseq β) : wseq β := join (map f s) /-- lift a relation to a relation over weak sequences -/ @[simp] def lift_rel_o (R : α → β → Prop) (C : wseq α → wseq β → Prop) : option (α × wseq α) → option (β × wseq β) → Prop | none none := true | (some (a, s)) (some (b, t)) := R a b ∧ C s t | _ _ := false theorem lift_rel_o.imp {R S : α → β → Prop} {C D : wseq α → wseq β → Prop} (H1 : ∀ a b, R a b → S a b) (H2 : ∀ s t, C s t → D s t) : ∀ {o p}, lift_rel_o R C o p → lift_rel_o S D o p | none none h := trivial | (some (a, s)) (some (b, t)) h := and.imp (H1 _ _) (H2 _ _) h | none (some _) h := false.elim h | (some (_, _)) none h := false.elim h theorem lift_rel_o.imp_right (R : α → β → Prop) {C D : wseq α → wseq β → Prop} (H : ∀ s t, C s t → D s t) {o p} : lift_rel_o R C o p → lift_rel_o R D o p := lift_rel_o.imp (λ _ _, id) H /-- Definitino of bisimilarity for weak sequences-/ @[simp] def bisim_o (R : wseq α → wseq α → Prop) : option (α × wseq α) → option (α × wseq α) → Prop := lift_rel_o (=) R theorem bisim_o.imp {R S : wseq α → wseq α → Prop} (H : ∀ s t, R s t → S s t) {o p} : bisim_o R o p → bisim_o S o p := lift_rel_o.imp_right _ H /-- Two weak sequences are `lift_rel R` related if they are either both empty, or they are both nonempty and the heads are `R` related and the tails are `lift_rel R` related. (This is a coinductive definition.) -/ def lift_rel (R : α → β → Prop) (s : wseq α) (t : wseq β) : Prop := ∃ C : wseq α → wseq β → Prop, C s t ∧ ∀ {s t}, C s t → computation.lift_rel (lift_rel_o R C) (destruct s) (destruct t) /-- If two sequences are equivalent, then they have the same values and the same computational behavior (i.e. if one loops forever then so does the other), although they may differ in the number of `think`s needed to arrive at the answer. -/ def equiv : wseq α → wseq α → Prop := lift_rel (=) theorem lift_rel_destruct {R : α → β → Prop} {s : wseq α} {t : wseq β} : lift_rel R s t → computation.lift_rel (lift_rel_o R (lift_rel R)) (destruct s) (destruct t) | ⟨R, h1, h2⟩ := by refine computation.lift_rel.imp _ _ _ (h2 h1); apply lift_rel_o.imp_right; exact λ s' t' h', ⟨R, h', @h2⟩ theorem lift_rel_destruct_iff {R : α → β → Prop} {s : wseq α} {t : wseq β} : lift_rel R s t ↔ computation.lift_rel (lift_rel_o R (lift_rel R)) (destruct s) (destruct t) := ⟨lift_rel_destruct, λ h, ⟨λ s t, lift_rel R s t ∨ computation.lift_rel (lift_rel_o R (lift_rel R)) (destruct s) (destruct t), or.inr h, λ s t h, begin have h : computation.lift_rel (lift_rel_o R (lift_rel R)) (destruct s) (destruct t), { cases h with h h, exact lift_rel_destruct h, assumption }, apply computation.lift_rel.imp _ _ _ h, intros a b, apply lift_rel_o.imp_right, intros s t, apply or.inl end⟩⟩ infix (name := equiv) ` ~ `:50 := equiv theorem destruct_congr {s t : wseq α} : s ~ t → computation.lift_rel (bisim_o (~)) (destruct s) (destruct t) := lift_rel_destruct theorem destruct_congr_iff {s t : wseq α} : s ~ t ↔ computation.lift_rel (bisim_o (~)) (destruct s) (destruct t) := lift_rel_destruct_iff theorem lift_rel.refl (R : α → α → Prop) (H : reflexive R) : reflexive (lift_rel R) := λ s, begin refine ⟨(=), rfl, λ s t (h : s = t), _⟩, rw ←h, apply computation.lift_rel.refl, intro a, cases a with a, simp, cases a; simp, apply H end theorem lift_rel_o.swap (R : α → β → Prop) (C) : swap (lift_rel_o R C) = lift_rel_o (swap R) (swap C) := by funext x y; cases x with x; [skip, cases x]; { cases y with y; [skip, cases y]; refl } theorem lift_rel.swap_lem {R : α → β → Prop} {s1 s2} (h : lift_rel R s1 s2) : lift_rel (swap R) s2 s1 := begin refine ⟨swap (lift_rel R), h, λ s t (h : lift_rel R t s), _⟩, rw [←lift_rel_o.swap, computation.lift_rel.swap], apply lift_rel_destruct h end theorem lift_rel.swap (R : α → β → Prop) : swap (lift_rel R) = lift_rel (swap R) := funext $ λ x, funext $ λ y, propext ⟨lift_rel.swap_lem, lift_rel.swap_lem⟩ theorem lift_rel.symm (R : α → α → Prop) (H : symmetric R) : symmetric (lift_rel R) := λ s1 s2 (h : swap (lift_rel R) s2 s1), by rwa [lift_rel.swap, show swap R = R, from funext $ λ a, funext $ λ b, propext $ by constructor; apply H] at h theorem lift_rel.trans (R : α → α → Prop) (H : transitive R) : transitive (lift_rel R) := λ s t u h1 h2, begin refine ⟨λ s u, ∃ t, lift_rel R s t ∧ lift_rel R t u, ⟨t, h1, h2⟩, λ s u h, _⟩, rcases h with ⟨t, h1, h2⟩, have h1 := lift_rel_destruct h1, have h2 := lift_rel_destruct h2, refine computation.lift_rel_def.2 ⟨(computation.terminates_of_lift_rel h1).trans (computation.terminates_of_lift_rel h2), λ a c ha hc, _⟩, rcases h1.left ha with ⟨b, hb, t1⟩, have t2 := computation.rel_of_lift_rel h2 hb hc, cases a with a; cases c with c, { trivial }, { cases b, {cases t2}, {cases t1} }, { cases a, cases b with b, {cases t1}, {cases b, cases t2} }, { cases a with a s, cases b with b, {cases t1}, cases b with b t, cases c with c u, cases t1 with ab st, cases t2 with bc tu, exact ⟨H ab bc, t, st, tu⟩ } end theorem lift_rel.equiv (R : α → α → Prop) : equivalence R → equivalence (lift_rel R) | ⟨refl, symm, trans⟩ := ⟨lift_rel.refl R refl, lift_rel.symm R symm, lift_rel.trans R trans⟩ @[refl] theorem equiv.refl : ∀ (s : wseq α), s ~ s := lift_rel.refl (=) eq.refl @[symm] theorem equiv.symm : ∀ {s t : wseq α}, s ~ t → t ~ s := lift_rel.symm (=) (@eq.symm _) @[trans] theorem equiv.equivalence : equivalence (@equiv α) := ⟨@equiv.refl _, @equiv.symm _, @equiv.trans _⟩ open computation local notation `return` := computation.return @[simp] theorem destruct_nil : destruct (nil : wseq α) = return none := computation.destruct_eq_ret rfl @[simp] theorem destruct_cons (a : α) (s) : destruct (cons a s) = return (some (a, s)) := computation.destruct_eq_ret $ by simp [destruct, cons, computation.rmap] @[simp] theorem destruct_think (s : wseq α) : destruct (think s) = (destruct s).think := computation.destruct_eq_think $ by simp [destruct, think, computation.rmap] @[simp] theorem seq_destruct_nil : seq.destruct (nil : wseq α) = none := seq.destruct_nil @[simp] theorem seq_destruct_cons (a : α) (s) : seq.destruct (cons a s) = some (some a, s) := seq.destruct_cons _ _ @[simp] theorem seq_destruct_think (s : wseq α) : seq.destruct (think s) = some (none, s) := seq.destruct_cons _ _ @[simp] theorem head_nil : head (nil : wseq α) = return none := by simp [head]; refl @[simp] theorem head_cons (a : α) (s) : head (cons a s) = return (some a) := by simp [head]; refl @[simp] theorem head_think (s : wseq α) : head (think s) = (head s).think := by simp [head]; refl @[simp] theorem flatten_ret (s : wseq α) : flatten (return s) = s := begin refine seq.eq_of_bisim (λ s1 s2, flatten (return s2) = s1) _ rfl, intros s' s h, rw ←h, simp [flatten], cases seq.destruct s, { simp }, { cases val with o s', simp } end @[simp] theorem flatten_think (c : computation (wseq α)) : flatten c.think = think (flatten c) := seq.destruct_eq_cons $ by simp [flatten, think] @[simp] theorem destruct_flatten (c : computation (wseq α)) : destruct (flatten c) = c >>= destruct := begin refine computation.eq_of_bisim (λ c1 c2, c1 = c2 ∨ ∃ c, c1 = destruct (flatten c) ∧ c2 = computation.bind c destruct) _ (or.inr ⟨c, rfl, rfl⟩), intros c1 c2 h, exact match c1, c2, h with | _, _, (or.inl $ eq.refl c) := by cases c.destruct; simp | _, _, (or.inr ⟨c, rfl, rfl⟩) := begin apply c.rec_on (λ a, _) (λ c', _); repeat {simp}, { cases (destruct a).destruct; simp }, { exact or.inr ⟨c', rfl, rfl⟩ } end end end theorem head_terminates_iff (s : wseq α) : terminates (head s) ↔ terminates (destruct s) := terminates_map_iff _ (destruct s) @[simp] theorem tail_nil : tail (nil : wseq α) = nil := by simp [tail] @[simp] theorem tail_cons (a : α) (s) : tail (cons a s) = s := by simp [tail] @[simp] theorem tail_think (s : wseq α) : tail (think s) = (tail s).think := by simp [tail] @[simp] theorem dropn_nil (n) : drop (nil : wseq α) n = nil := by induction n; simp [*, drop] @[simp] theorem dropn_cons (a : α) (s) (n) : drop (cons a s) (n+1) = drop s n := by induction n; simp [*, drop] @[simp] theorem dropn_think (s : wseq α) (n) : drop (think s) n = (drop s n).think := by induction n; simp [*, drop] theorem dropn_add (s : wseq α) (m) : ∀ n, drop s (m + n) = drop (drop s m) n | 0 := rfl | (n+1) := congr_arg tail (dropn_add n) theorem dropn_tail (s : wseq α) (n) : drop (tail s) n = drop s (n + 1) := by rw add_comm; symmetry; apply dropn_add theorem nth_add (s : wseq α) (m n) : nth s (m + n) = nth (drop s m) n := congr_arg head (dropn_add _ _ _) theorem nth_tail (s : wseq α) (n) : nth (tail s) n = nth s (n + 1) := congr_arg head (dropn_tail _ _) @[simp] theorem join_nil : join nil = (nil : wseq α) := seq.join_nil @[simp] theorem join_think (S : wseq (wseq α)) : join (think S) = think (join S) := by { simp [think, join], unfold functor.map, simp [join, seq1.ret] } @[simp] theorem join_cons (s : wseq α) (S) : join (cons s S) = think (append s (join S)) := by { simp [think, join], unfold functor.map, simp [join, cons, append] } @[simp] theorem nil_append (s : wseq α) : append nil s = s := seq.nil_append _ @[simp] theorem cons_append (a : α) (s t) : append (cons a s) t = cons a (append s t) := seq.cons_append _ _ _ @[simp] theorem think_append (s t : wseq α) : append (think s) t = think (append s t) := seq.cons_append _ _ _ @[simp] theorem append_nil (s : wseq α) : append s nil = s := seq.append_nil _ @[simp] theorem append_assoc (s t u : wseq α) : append (append s t) u = append s (append t u) := seq.append_assoc _ _ _ /-- auxilary defintion of tail over weak sequences-/ @[simp] def tail.aux : option (α × wseq α) → computation (option (α × wseq α)) | none := return none | (some (a, s)) := destruct s theorem destruct_tail (s : wseq α) : destruct (tail s) = destruct s >>= tail.aux := begin simp [tail], rw [← bind_pure_comp_eq_map, is_lawful_monad.bind_assoc], apply congr_arg, ext1 (_|⟨a, s⟩); apply (@pure_bind computation _ _ _ _ _ _).trans _; simp end /-- auxilary defintion of drop over weak sequences-/ @[simp] def drop.aux : ℕ → option (α × wseq α) → computation (option (α × wseq α)) | 0 := return | (n+1) := λ a, tail.aux a >>= drop.aux n theorem drop.aux_none : ∀ n, @drop.aux α n none = return none | 0 := rfl | (n+1) := show computation.bind (return none) (drop.aux n) = return none, by rw [ret_bind, drop.aux_none] theorem destruct_dropn : ∀ (s : wseq α) n, destruct (drop s n) = destruct s >>= drop.aux n | s 0 := (bind_ret' _).symm | s (n+1) := by rw [← dropn_tail, destruct_dropn _ n, destruct_tail, is_lawful_monad.bind_assoc]; refl theorem head_terminates_of_head_tail_terminates (s : wseq α) [T : terminates (head (tail s))] : terminates (head s) := (head_terminates_iff _).2 $ begin rcases (head_terminates_iff _).1 T with ⟨⟨a, h⟩⟩, simp [tail] at h, rcases exists_of_mem_bind h with ⟨s', h1, h2⟩, unfold functor.map at h1, exact let ⟨t, h3, h4⟩ := computation.exists_of_mem_map h1 in computation.terminates_of_mem h3 end theorem destruct_some_of_destruct_tail_some {s : wseq α} {a} (h : some a ∈ destruct (tail s)) : ∃ a', some a' ∈ destruct s := begin unfold tail functor.map at h, simp at h, rcases exists_of_mem_bind h with ⟨t, tm, td⟩, clear h, rcases computation.exists_of_mem_map tm with ⟨t', ht', ht2⟩, clear tm, cases t' with t'; rw ←ht2 at td; simp at td, { have := mem_unique td (ret_mem _), contradiction }, { exact ⟨_, ht'⟩ } end theorem head_some_of_head_tail_some {s : wseq α} {a} (h : some a ∈ head (tail s)) : ∃ a', some a' ∈ head s := begin unfold head at h, rcases computation.exists_of_mem_map h with ⟨o, md, e⟩, clear h, cases o with o; injection e with h', clear e h', cases destruct_some_of_destruct_tail_some md with a am, exact ⟨_, computation.mem_map ((<$>) (@prod.fst α (wseq α))) am⟩ end theorem head_some_of_nth_some {s : wseq α} {a n} (h : some a ∈ nth s n) : ∃ a', some a' ∈ head s := begin revert a, induction n with n IH; intros, exacts [⟨_, h⟩, let ⟨a', h'⟩ := head_some_of_head_tail_some h in IH h'] end instance productive_tail (s : wseq α) [productive s] : productive (tail s) := ⟨λ n, by rw [nth_tail]; apply_instance⟩ instance productive_dropn (s : wseq α) [productive s] (n) : productive (drop s n) := ⟨λ m, by rw [←nth_add]; apply_instance⟩ /-- Given a productive weak sequence, we can collapse all the `think`s to produce a sequence. -/ def to_seq (s : wseq α) [productive s] : seq α := ⟨λ n, (nth s n).get, λ n h, begin cases e : computation.get (nth s (n + 1)), {assumption}, have := mem_of_get_eq _ e, simp [nth] at this h, cases head_some_of_head_tail_some this with a' h', have := mem_unique h' (@mem_of_get_eq _ _ _ _ h), contradiction end⟩ theorem nth_terminates_le {s : wseq α} {m n} (h : m ≤ n) : terminates (nth s n) → terminates (nth s m) := by induction h with m' h IH; [exact id, exact λ T, IH (@head_terminates_of_head_tail_terminates _ _ T)] theorem head_terminates_of_nth_terminates {s : wseq α} {n} : terminates (nth s n) → terminates (head s) := nth_terminates_le (nat.zero_le n) theorem destruct_terminates_of_nth_terminates {s : wseq α} {n} (T : terminates (nth s n)) : terminates (destruct s) := (head_terminates_iff _).1 $ head_terminates_of_nth_terminates T theorem mem_rec_on {C : wseq α → Prop} {a s} (M : a ∈ s) (h1 : ∀ b s', (a = b ∨ C s') → C (cons b s')) (h2 : ∀ s, C s → C (think s)) : C s := begin apply seq.mem_rec_on M, intros o s' h, cases o with b, { apply h2, cases h, {contradiction}, {assumption} }, { apply h1, apply or.imp_left _ h, intro h, injection h } end @[simp] theorem mem_think (s : wseq α) (a) : a ∈ think s ↔ a ∈ s := begin cases s with f al, change some (some a) ∈ some none :: f ↔ some (some a) ∈ f, constructor; intro h, { apply (stream.eq_or_mem_of_mem_cons h).resolve_left, intro, injections }, { apply stream.mem_cons_of_mem _ h } end theorem eq_or_mem_iff_mem {s : wseq α} {a a' s'} : some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := begin generalize e : destruct s = c, intro h, revert s, apply computation.mem_rec_on h _ (λ c IH, _); intro s; apply s.rec_on _ (λ x s, _) (λ s, _); intros m; have := congr_arg computation.destruct m; simp at this; cases this with i1 i2, { rw [i1, i2], cases s' with f al, unfold cons has_mem.mem wseq.mem seq.mem seq.cons, simp, have h_a_eq_a' : a = a' ↔ some (some a) = some (some a'), {simp}, rw [h_a_eq_a'], refine ⟨stream.eq_or_mem_of_mem_cons, λ o, _⟩, { cases o with e m, { rw e, apply stream.mem_cons }, { exact stream.mem_cons_of_mem _ m } } }, { simp, exact IH this } end @[simp] theorem mem_cons_iff (s : wseq α) (b) {a} : a ∈ cons b s ↔ a = b ∨ a ∈ s := eq_or_mem_iff_mem $ by simp [ret_mem] theorem mem_cons_of_mem {s : wseq α} (b) {a} (h : a ∈ s) : a ∈ cons b s := (mem_cons_iff _ _).2 (or.inr h) theorem mem_cons (s : wseq α) (a) : a ∈ cons a s := (mem_cons_iff _ _).2 (or.inl rfl) theorem mem_of_mem_tail {s : wseq α} {a} : a ∈ tail s → a ∈ s := begin intro h, have := h, cases h with n e, revert s, simp [stream.nth], induction n with n IH; intro s; apply s.rec_on _ (λ x s, _) (λ s, _); repeat{simp}; intros m e; injections, { exact or.inr m }, { exact or.inr m }, { apply IH m, rw e, cases tail s, refl } end theorem mem_of_mem_dropn {s : wseq α} {a} : ∀ {n}, a ∈ drop s n → a ∈ s | 0 h := h | (n+1) h := @mem_of_mem_dropn n (mem_of_mem_tail h) theorem nth_mem {s : wseq α} {a n} : some a ∈ nth s n → a ∈ s := begin revert s, induction n with n IH; intros s h, { rcases computation.exists_of_mem_map h with ⟨o, h1, h2⟩, cases o with o; injection h2 with h', cases o with a' s', exact (eq_or_mem_iff_mem h1).2 (or.inl h'.symm) }, { have := @IH (tail s), rw nth_tail at this, exact mem_of_mem_tail (this h) } end theorem exists_nth_of_mem {s : wseq α} {a} (h : a ∈ s) : ∃ n, some a ∈ nth s n := begin apply mem_rec_on h, { intros a' s' h, cases h with h h, { existsi 0, simp [nth], rw h, apply ret_mem }, { cases h with n h, existsi n+1, simp [nth], exact h } }, { intros s' h, cases h with n h, existsi n, simp [nth], apply think_mem h } end theorem exists_dropn_of_mem {s : wseq α} {a} (h : a ∈ s) : ∃ n s', some (a, s') ∈ destruct (drop s n) := let ⟨n, h⟩ := exists_nth_of_mem h in ⟨n, begin rcases (head_terminates_iff _).1 ⟨⟨_, h⟩⟩ with ⟨⟨o, om⟩⟩, have := computation.mem_unique (computation.mem_map _ om) h, cases o with o; injection this with i, cases o with a' s', dsimp at i, rw i at om, exact ⟨_, om⟩ end⟩ theorem lift_rel_dropn_destruct {R : α → β → Prop} {s t} (H : lift_rel R s t) : ∀ n, computation.lift_rel (lift_rel_o R (lift_rel R)) (destruct (drop s n)) (destruct (drop t n)) | 0 := lift_rel_destruct H | (n+1) := begin simp [destruct_tail], apply lift_rel_bind, apply lift_rel_dropn_destruct n, exact λ a b o, match a, b, o with | none, none, _ := by simp | some (a, s), some (b, t), ⟨h1, h2⟩ := by simp [tail.aux]; apply lift_rel_destruct h2 end end theorem exists_of_lift_rel_left {R : α → β → Prop} {s t} (H : lift_rel R s t) {a} (h : a ∈ s) : ∃ {b}, b ∈ t ∧ R a b := let ⟨n, h⟩ := exists_nth_of_mem h, ⟨some (._, s'), sd, rfl⟩ := computation.exists_of_mem_map h, ⟨some (b, t'), td, ⟨ab, _⟩⟩ := (lift_rel_dropn_destruct H n).left sd in ⟨b, nth_mem (computation.mem_map ((<$>) prod.fst.{v v}) td), ab⟩ theorem exists_of_lift_rel_right {R : α → β → Prop} {s t} (H : lift_rel R s t) {b} (h : b ∈ t) : ∃ {a}, a ∈ s ∧ R a b := by rw ←lift_rel.swap at H; exact exists_of_lift_rel_left H h theorem head_terminates_of_mem {s : wseq α} {a} (h : a ∈ s) : terminates (head s) := let ⟨n, h⟩ := exists_nth_of_mem h in head_terminates_of_nth_terminates ⟨⟨_, h⟩⟩ theorem of_mem_append {s₁ s₂ : wseq α} {a : α} : a ∈ append s₁ s₂ → a ∈ s₁ ∨ a ∈ s₂ := seq.of_mem_append theorem mem_append_left {s₁ s₂ : wseq α} {a : α} : a ∈ s₁ → a ∈ append s₁ s₂ := seq.mem_append_left theorem exists_of_mem_map {f} {b : β} : ∀ {s : wseq α}, b ∈ map f s → ∃ a, a ∈ s ∧ f a = b | ⟨g, al⟩ h := let ⟨o, om, oe⟩ := seq.exists_of_mem_map h in by cases o with a; injection oe with h'; exact ⟨a, om, h'⟩ @[simp] theorem lift_rel_nil (R : α → β → Prop) : lift_rel R nil nil := by rw [lift_rel_destruct_iff]; simp @[simp] theorem lift_rel_cons (R : α → β → Prop) (a b s t) : lift_rel R (cons a s) (cons b t) ↔ R a b ∧ lift_rel R s t := by rw [lift_rel_destruct_iff]; simp @[simp] theorem lift_rel_think_left (R : α → β → Prop) (s t) : lift_rel R (think s) t ↔ lift_rel R s t := by rw [lift_rel_destruct_iff, lift_rel_destruct_iff]; simp @[simp] theorem lift_rel_think_right (R : α → β → Prop) (s t) : lift_rel R s (think t) ↔ lift_rel R s t := by rw [lift_rel_destruct_iff, lift_rel_destruct_iff]; simp theorem cons_congr {s t : wseq α} (a : α) (h : s ~ t) : cons a s ~ cons a t := by unfold equiv; simp; exact h theorem think_equiv (s : wseq α) : think s ~ s := by unfold equiv; simp; apply equiv.refl theorem think_congr {s t : wseq α} (h : s ~ t) : think s ~ think t := by unfold equiv; simp; exact h theorem head_congr : ∀ {s t : wseq α}, s ~ t → head s ~ head t := suffices ∀ {s t : wseq α}, s ~ t → ∀ {o}, o ∈ head s → o ∈ head t, from λ s t h o, ⟨this h, this h.symm⟩, begin intros s t h o ho, rcases @computation.exists_of_mem_map _ _ _ _ (destruct s) ho with ⟨ds, dsm, dse⟩, rw ←dse, cases destruct_congr h with l r, rcases l dsm with ⟨dt, dtm, dst⟩, cases ds with a; cases dt with b, { apply computation.mem_map _ dtm }, { cases b, cases dst }, { cases a, cases dst }, { cases a with a s', cases b with b t', rw dst.left, exact @computation.mem_map _ _ (@functor.map _ _ (α × wseq α) _ prod.fst) _ (destruct t) dtm } end theorem flatten_equiv {c : computation (wseq α)} {s} (h : s ∈ c) : flatten c ~ s := begin apply computation.mem_rec_on h, { simp }, { intro s', apply equiv.trans, simp [think_equiv] } end theorem lift_rel_flatten {R : α → β → Prop} {c1 : computation (wseq α)} {c2 : computation (wseq β)} (h : c1.lift_rel (lift_rel R) c2) : lift_rel R (flatten c1) (flatten c2) := let S := λ s t, ∃ c1 c2, s = flatten c1 ∧ t = flatten c2 ∧ computation.lift_rel (lift_rel R) c1 c2 in ⟨S, ⟨c1, c2, rfl, rfl, h⟩, λ s t h, match s, t, h with ._, ._, ⟨c1, c2, rfl, rfl, h⟩ := begin simp, apply lift_rel_bind _ _ h, intros a b ab, apply computation.lift_rel.imp _ _ _ (lift_rel_destruct ab), intros a b, apply lift_rel_o.imp_right, intros s t h, refine ⟨return s, return t, _, _, _⟩; simp [h] end end⟩ theorem flatten_congr {c1 c2 : computation (wseq α)} : computation.lift_rel equiv c1 c2 → flatten c1 ~ flatten c2 := lift_rel_flatten theorem tail_congr {s t : wseq α} (h : s ~ t) : tail s ~ tail t := begin apply flatten_congr, unfold functor.map, rw [←bind_ret, ←bind_ret], apply lift_rel_bind _ _ (destruct_congr h), intros a b h, simp, cases a with a; cases b with b, { trivial }, { cases h }, { cases a, cases h }, { cases a with a s', cases b with b t', exact h.right } end theorem dropn_congr {s t : wseq α} (h : s ~ t) (n) : drop s n ~ drop t n := by induction n; simp [*, tail_congr] theorem nth_congr {s t : wseq α} (h : s ~ t) (n) : nth s n ~ nth t n := head_congr (dropn_congr h _) theorem mem_congr {s t : wseq α} (h : s ~ t) (a) : a ∈ s ↔ a ∈ t := suffices ∀ {s t : wseq α}, s ~ t → a ∈ s → a ∈ t, from ⟨this h, this h.symm⟩, λ s t h as, let ⟨n, hn⟩ := exists_nth_of_mem as in nth_mem ((nth_congr h _ _).1 hn) theorem productive_congr {s t : wseq α} (h : s ~ t) : productive s ↔ productive t := by simp only [productive_iff]; exact forall_congr (λ n, terminates_congr $ nth_congr h _) theorem equiv.ext {s t : wseq α} (h : ∀ n, nth s n ~ nth t n) : s ~ t := ⟨λ s t, ∀ n, nth s n ~ nth t n, h, λ s t h, begin refine lift_rel_def.2 ⟨_, _⟩, { rw [←head_terminates_iff, ←head_terminates_iff], exact terminates_congr (h 0) }, { intros a b ma mb, cases a with a; cases b with b, { trivial }, { injection mem_unique (computation.mem_map _ ma) ((h 0 _).2 (computation.mem_map _ mb)) }, { injection mem_unique (computation.mem_map _ ma) ((h 0 _).2 (computation.mem_map _ mb)) }, { cases a with a s', cases b with b t', injection mem_unique (computation.mem_map _ ma) ((h 0 _).2 (computation.mem_map _ mb)) with ab, refine ⟨ab, λ n, _⟩, refine (nth_congr (flatten_equiv (computation.mem_map _ ma)) n).symm.trans ((_ : nth (tail s) n ~ nth (tail t) n).trans (nth_congr (flatten_equiv (computation.mem_map _ mb)) n)), rw [nth_tail, nth_tail], apply h } } end⟩ theorem length_eq_map (s : wseq α) : length s = computation.map list.length (to_list s) := begin refine computation.eq_of_bisim (λ c1 c2, ∃ (l : list α) (s : wseq α), c1 = computation.corec length._match_2 (l.length, s) ∧ c2 = computation.map list.length (computation.corec to_list._match_2 (l, s))) _ ⟨[], s, rfl, rfl⟩, intros s1 s2 h, rcases h with ⟨l, s, h⟩, rw [h.left, h.right], apply s.rec_on _ (λ a s, _) (λ s, _); repeat {simp [to_list, nil, cons, think, length]}, { refine ⟨a::l, s, _, _⟩; simp }, { refine ⟨l, s, _, _⟩; simp } end @[simp] theorem of_list_nil : of_list [] = (nil : wseq α) := rfl @[simp] theorem of_list_cons (a : α) (l) : of_list (a :: l) = cons a (of_list l) := show seq.map some (seq.of_list (a :: l)) = seq.cons (some a) (seq.map some (seq.of_list l)), by simp @[simp] theorem to_list'_nil (l : list α) : computation.corec to_list._match_2 (l, nil) = return l.reverse := destruct_eq_ret rfl @[simp] theorem to_list'_cons (l : list α) (s : wseq α) (a : α) : computation.corec to_list._match_2 (l, cons a s) = (computation.corec to_list._match_2 (a::l, s)).think := destruct_eq_think $ by simp [to_list, cons] @[simp] theorem to_list'_think (l : list α) (s : wseq α) : computation.corec to_list._match_2 (l, think s) = (computation.corec to_list._match_2 (l, s)).think := destruct_eq_think $ by simp [to_list, think] theorem to_list'_map (l : list α) (s : wseq α) : computation.corec to_list._match_2 (l, s) = ((++) l.reverse) <$> to_list s := begin refine computation.eq_of_bisim (λ c1 c2, ∃ (l' : list α) (s : wseq α), c1 = computation.corec to_list._match_2 (l' ++ l, s) ∧ c2 = computation.map ((++) l.reverse) (computation.corec to_list._match_2 (l', s))) _ ⟨[], s, rfl, rfl⟩, intros s1 s2 h, rcases h with ⟨l', s, h⟩, rw [h.left, h.right], apply s.rec_on _ (λ a s, _) (λ s, _); repeat {simp [to_list, nil, cons, think, length]}, { refine ⟨a::l', s, _, _⟩; simp }, { refine ⟨l', s, _, _⟩; simp } end @[simp] theorem to_list_cons (a : α) (s) : to_list (cons a s) = (list.cons a <$> to_list s).think := destruct_eq_think $ by unfold to_list; simp; rw to_list'_map; simp; refl @[simp] theorem to_list_nil : to_list (nil : wseq α) = return [] := destruct_eq_ret rfl theorem to_list_of_list (l : list α) : l ∈ to_list (of_list l) := by induction l with a l IH; simp [ret_mem]; exact think_mem (computation.mem_map _ IH) @[simp] theorem destruct_of_seq (s : seq α) : destruct (of_seq s) = return (s.head.map $ λ a, (a, of_seq s.tail)) := destruct_eq_ret $ begin simp [of_seq, head, destruct, seq.destruct, seq.head], rw [show seq.nth (some <$> s) 0 = some <$> seq.nth s 0, by apply seq.map_nth], cases seq.nth s 0 with a, { refl }, unfold functor.map, simp [destruct] end @[simp] theorem head_of_seq (s : seq α) : head (of_seq s) = return s.head := by simp [head]; cases seq.head s; refl @[simp] theorem tail_of_seq (s : seq α) : tail (of_seq s) = of_seq s.tail := begin simp [tail], apply s.rec_on _ (λ x s, _); simp [of_seq], {refl}, rw [seq.head_cons, seq.tail_cons], refl end @[simp] theorem dropn_of_seq (s : seq α) : ∀ n, drop (of_seq s) n = of_seq (s.drop n) | 0 := rfl | (n+1) := by dsimp [drop]; rw [dropn_of_seq, tail_of_seq] theorem nth_of_seq (s : seq α) (n) : nth (of_seq s) n = return (seq.nth s n) := by dsimp [nth]; rw [dropn_of_seq, head_of_seq, seq.head_dropn] instance productive_of_seq (s : seq α) : productive (of_seq s) := ⟨λ n, by rw nth_of_seq; apply_instance⟩ theorem to_seq_of_seq (s : seq α) : to_seq (of_seq s) = s := begin apply subtype.eq, funext n, dsimp [to_seq], apply get_eq_of_mem, rw nth_of_seq, apply ret_mem end /-- The monadic `return a` is a singleton list containing `a`. -/ def ret (a : α) : wseq α := of_list [a] @[simp] theorem map_nil (f : α → β) : map f nil = nil := rfl @[simp] theorem map_cons (f : α → β) (a s) : map f (cons a s) = cons (f a) (map f s) := seq.map_cons _ _ _ @[simp] theorem map_think (f : α → β) (s) : map f (think s) = think (map f s) := seq.map_cons _ _ _ @[simp] theorem map_id (s : wseq α) : map id s = s := by simp [map] @[simp] theorem map_ret (f : α → β) (a) : map f (ret a) = ret (f a) := by simp [ret] @[simp] theorem map_append (f : α → β) (s t) : map f (append s t) = append (map f s) (map f t) := seq.map_append _ _ _ theorem map_comp (f : α → β) (g : β → γ) (s : wseq α) : map (g ∘ f) s = map g (map f s) := begin dsimp [map], rw ←seq.map_comp, apply congr_fun, apply congr_arg, ext ⟨⟩; refl end theorem mem_map (f : α → β) {a : α} {s : wseq α} : a ∈ s → f a ∈ map f s := seq.mem_map (option.map f) -- The converse is not true without additional assumptions theorem exists_of_mem_join {a : α} : ∀ {S : wseq (wseq α)}, a ∈ join S → ∃ s, s ∈ S ∧ a ∈ s := suffices ∀ ss : wseq α, a ∈ ss → ∀ s S, append s (join S) = ss → a ∈ append s (join S) → a ∈ s ∨ ∃ s, s ∈ S ∧ a ∈ s, from λ S h, (this _ h nil S (by simp) (by simp [h])).resolve_left (not_mem_nil _), begin intros ss h, apply mem_rec_on h (λ b ss o, _) (λ ss IH, _); intros s S, { refine s.rec_on (S.rec_on _ (λ s S, _) (λ S, _)) (λ b' s, _) (λ s, _); intros ej m; simp at ej; have := congr_arg seq.destruct ej; simp at this; try {cases this}; try {contradiction}, substs b' ss, simp at m ⊢, cases o with e IH, { simp [e] }, cases m with e m, { simp [e] }, exact or.imp_left or.inr (IH _ _ rfl m) }, { refine s.rec_on (S.rec_on _ (λ s S, _) (λ S, _)) (λ b' s, _) (λ s, _); intros ej m; simp at ej; have := congr_arg seq.destruct ej; simp at this; try { try {have := this.1}, contradiction }; subst ss, { apply or.inr, simp at m ⊢, cases IH s S rfl m with as ex, { exact ⟨s, or.inl rfl, as⟩ }, { rcases ex with ⟨s', sS, as⟩, exact ⟨s', or.inr sS, as⟩ } }, { apply or.inr, simp at m, rcases (IH nil S (by simp) (by simp [m])).resolve_left (not_mem_nil _) with ⟨s, sS, as⟩, exact ⟨s, by simp [sS], as⟩ }, { simp at m IH ⊢, apply IH _ _ rfl m } } end theorem exists_of_mem_bind {s : wseq α} {f : α → wseq β} {b} (h : b ∈ bind s f) : ∃ a ∈ s, b ∈ f a := let ⟨t, tm, bt⟩ := exists_of_mem_join h, ⟨a, as, e⟩ := exists_of_mem_map tm in ⟨a, as, by rwa e⟩ theorem destruct_map (f : α → β) (s : wseq α) : destruct (map f s) = computation.map (option.map (prod.map f (map f))) (destruct s) := begin apply computation.eq_of_bisim (λ c1 c2, ∃ s, c1 = destruct (map f s) ∧ c2 = computation.map (option.map (prod.map f (map f))) (destruct s)), { intros c1 c2 h, cases h with s h, rw [h.left, h.right], apply s.rec_on _ (λ a s, _) (λ s, _); simp, exact ⟨s, rfl, rfl⟩ }, { exact ⟨s, rfl, rfl⟩ } end theorem lift_rel_map {δ} (R : α → β → Prop) (S : γ → δ → Prop) {s1 : wseq α} {s2 : wseq β} {f1 : α → γ} {f2 : β → δ} (h1 : lift_rel R s1 s2) (h2 : ∀ {a b}, R a b → S (f1 a) (f2 b)) : lift_rel S (map f1 s1) (map f2 s2) := ⟨λ s1 s2, ∃ s t, s1 = map f1 s ∧ s2 = map f2 t ∧ lift_rel R s t, ⟨s1, s2, rfl, rfl, h1⟩, λ s1 s2 h, match s1, s2, h with ._, ._, ⟨s, t, rfl, rfl, h⟩ := begin simp [destruct_map], apply computation.lift_rel_map _ _ (lift_rel_destruct h), intros o p h, cases o with a; cases p with b; simp, { cases b; cases h }, { cases a; cases h }, { cases a with a s; cases b with b t, cases h with r h, exact ⟨h2 r, s, rfl, t, rfl, h⟩ } end end⟩ theorem map_congr (f : α → β) {s t : wseq α} (h : s ~ t) : map f s ~ map f t := lift_rel_map _ _ h (λ _ _, congr_arg _) /-- auxilary defintion of `destruct_append` over weak sequences-/ @[simp] def destruct_append.aux (t : wseq α) : option (α × wseq α) → computation (option (α × wseq α)) | none := destruct t | (some (a, s)) := return (some (a, append s t)) theorem destruct_append (s t : wseq α) : destruct (append s t) = (destruct s).bind (destruct_append.aux t) := begin apply computation.eq_of_bisim (λ c1 c2, ∃ s t, c1 = destruct (append s t) ∧ c2 = (destruct s).bind (destruct_append.aux t)) _ ⟨s, t, rfl, rfl⟩, intros c1 c2 h, rcases h with ⟨s, t, h⟩, rw [h.left, h.right], apply s.rec_on _ (λ a s, _) (λ s, _); simp, { apply t.rec_on _ (λ b t, _) (λ t, _); simp, { refine ⟨nil, t, _, _⟩; simp } }, { exact ⟨s, t, rfl, rfl⟩ } end /-- auxilary defintion of `destruct_join` over weak sequences-/ @[simp] def destruct_join.aux : option (wseq α × wseq (wseq α)) → computation (option (α × wseq α)) | none := return none | (some (s, S)) := (destruct (append s (join S))).think theorem destruct_join (S : wseq (wseq α)) : destruct (join S) = (destruct S).bind destruct_join.aux := begin apply computation.eq_of_bisim (λ c1 c2, c1 = c2 ∨ ∃ S, c1 = destruct (join S) ∧ c2 = (destruct S).bind destruct_join.aux) _ (or.inr ⟨S, rfl, rfl⟩), intros c1 c2 h, exact match c1, c2, h with | _, _, (or.inl $ eq.refl c) := by cases c.destruct; simp | _, _, or.inr ⟨S, rfl, rfl⟩ := begin apply S.rec_on _ (λ s S, _) (λ S, _); simp, { refine or.inr ⟨S, rfl, rfl⟩ } end end end theorem lift_rel_append (R : α → β → Prop) {s1 s2 : wseq α} {t1 t2 : wseq β} (h1 : lift_rel R s1 t1) (h2 : lift_rel R s2 t2) : lift_rel R (append s1 s2) (append t1 t2) := ⟨λ s t, lift_rel R s t ∨ ∃ s1 t1, s = append s1 s2 ∧ t = append t1 t2 ∧ lift_rel R s1 t1, or.inr ⟨s1, t1, rfl, rfl, h1⟩, λ s t h, match s, t, h with | s, t, or.inl h := begin apply computation.lift_rel.imp _ _ _ (lift_rel_destruct h), intros a b, apply lift_rel_o.imp_right, intros s t, apply or.inl end | ._, ._, or.inr ⟨s1, t1, rfl, rfl, h⟩ := begin simp [destruct_append], apply computation.lift_rel_bind _ _ (lift_rel_destruct h), intros o p h, cases o with a; cases p with b, { simp, apply computation.lift_rel.imp _ _ _ (lift_rel_destruct h2), intros a b, apply lift_rel_o.imp_right, intros s t, apply or.inl }, { cases b; cases h }, { cases a; cases h }, { cases a with a s; cases b with b t, cases h with r h, simp, exact ⟨r, or.inr ⟨s, rfl, t, rfl, h⟩⟩ } end end⟩ theorem lift_rel_join.lem (R : α → β → Prop) {S T} {U : wseq α → wseq β → Prop} (ST : lift_rel (lift_rel R) S T) (HU : ∀ s1 s2, (∃ s t S T, s1 = append s (join S) ∧ s2 = append t (join T) ∧ lift_rel R s t ∧ lift_rel (lift_rel R) S T) → U s1 s2) {a} (ma : a ∈ destruct (join S)) : ∃ {b}, b ∈ destruct (join T) ∧ lift_rel_o R U a b := begin cases exists_results_of_mem ma with n h, clear ma, revert a S T, apply nat.strong_induction_on n _, intros n IH a S T ST ra, simp [destruct_join] at ra, exact let ⟨o, m, k, rs1, rs2, en⟩ := of_results_bind ra, ⟨p, mT, rop⟩ := computation.exists_of_lift_rel_left (lift_rel_destruct ST) rs1.mem in by exact match o, p, rop, rs1, rs2, mT with | none, none, _, rs1, rs2, mT := by simp only [destruct_join]; exact ⟨none, mem_bind mT (ret_mem _), by rw eq_of_ret_mem rs2.mem; trivial⟩ | some (s, S'), some (t, T'), ⟨st, ST'⟩, rs1, rs2, mT := by simp [destruct_append] at rs2; exact let ⟨k1, rs3, ek⟩ := of_results_think rs2, ⟨o', m1, n1, rs4, rs5, ek1⟩ := of_results_bind rs3, ⟨p', mt, rop'⟩ := computation.exists_of_lift_rel_left (lift_rel_destruct st) rs4.mem in by exact match o', p', rop', rs4, rs5, mt with | none, none, _, rs4, rs5', mt := have n1 < n, begin rw [en, ek, ek1], apply lt_of_lt_of_le _ (nat.le_add_right _ _), apply nat.lt_succ_of_le (nat.le_add_right _ _) end, let ⟨ob, mb, rob⟩ := IH _ this ST' rs5' in by refine ⟨ob, _, rob⟩; { simp [destruct_join], apply mem_bind mT, simp [destruct_append], apply think_mem, apply mem_bind mt, exact mb } | some (a, s'), some (b, t'), ⟨ab, st'⟩, rs4, rs5, mt := begin simp at rs5, refine ⟨some (b, append t' (join T')), _, _⟩, { simp [destruct_join], apply mem_bind mT, simp [destruct_append], apply think_mem, apply mem_bind mt, apply ret_mem }, rw eq_of_ret_mem rs5.mem, exact ⟨ab, HU _ _ ⟨s', t', S', T', rfl, rfl, st', ST'⟩⟩ end end end end theorem lift_rel_join (R : α → β → Prop) {S : wseq (wseq α)} {T : wseq (wseq β)} (h : lift_rel (lift_rel R) S T) : lift_rel R (join S) (join T) := ⟨λ s1 s2, ∃ s t S T, s1 = append s (join S) ∧ s2 = append t (join T) ∧ lift_rel R s t ∧ lift_rel (lift_rel R) S T, ⟨nil, nil, S, T, by simp, by simp, by simp, h⟩, λ s1 s2 ⟨s, t, S, T, h1, h2, st, ST⟩, begin clear _fun_match _x, rw [h1, h2], rw [destruct_append, destruct_append], apply computation.lift_rel_bind _ _ (lift_rel_destruct st), exact λ o p h, match o, p, h with | some (a, s), some (b, t), ⟨h1, h2⟩ := by simp; exact ⟨h1, s, t, S, rfl, T, rfl, h2, ST⟩ | none, none, _ := begin dsimp [destruct_append.aux, computation.lift_rel], constructor, { intro, apply lift_rel_join.lem _ ST (λ _ _, id) }, { intros b mb, rw [←lift_rel_o.swap], apply lift_rel_join.lem (swap R), { rw [←lift_rel.swap R, ←lift_rel.swap], apply ST }, { rw [←lift_rel.swap R, ←lift_rel.swap (lift_rel R)], exact λ s1 s2 ⟨s, t, S, T, h1, h2, st, ST⟩, ⟨t, s, T, S, h2, h1, st, ST⟩ }, { exact mb } } end end end⟩ theorem join_congr {S T : wseq (wseq α)} (h : lift_rel equiv S T) : join S ~ join T := lift_rel_join _ h theorem lift_rel_bind {δ} (R : α → β → Prop) (S : γ → δ → Prop) {s1 : wseq α} {s2 : wseq β} {f1 : α → wseq γ} {f2 : β → wseq δ} (h1 : lift_rel R s1 s2) (h2 : ∀ {a b}, R a b → lift_rel S (f1 a) (f2 b)) : lift_rel S (bind s1 f1) (bind s2 f2) := lift_rel_join _ (lift_rel_map _ _ h1 @h2) theorem bind_congr {s1 s2 : wseq α} {f1 f2 : α → wseq β} (h1 : s1 ~ s2) (h2 : ∀ a, f1 a ~ f2 a) : bind s1 f1 ~ bind s2 f2 := lift_rel_bind _ _ h1 (λ a b h, by rw h; apply h2) @[simp] theorem join_ret (s : wseq α) : join (ret s) ~ s := by simp [ret]; apply think_equiv @[simp] theorem join_map_ret (s : wseq α) : join (map ret s) ~ s := begin refine ⟨λ s1 s2, join (map ret s2) = s1, rfl, _⟩, intros s' s h, rw ←h, apply lift_rel_rec (λ c1 c2, ∃ s, c1 = destruct (join (map ret s)) ∧ c2 = destruct s), { exact λ c1 c2 h, match c1, c2, h with | ._, ._, ⟨s, rfl, rfl⟩ := begin clear h _match, have : ∀ s, ∃ s' : wseq α, (map ret s).join.destruct = (map ret s').join.destruct ∧ destruct s = s'.destruct, from λ s, ⟨s, rfl, rfl⟩, apply s.rec_on _ (λ a s, _) (λ s, _); simp [ret, ret_mem, this, option.exists] end end }, { exact ⟨s, rfl, rfl⟩ } end @[simp] theorem join_append (S T : wseq (wseq α)) : join (append S T) ~ append (join S) (join T) := begin refine ⟨λ s1 s2, ∃ s S T, s1 = append s (join (append S T)) ∧ s2 = append s (append (join S) (join T)), ⟨nil, S, T, by simp, by simp⟩, _⟩, intros s1 s2 h, apply lift_rel_rec (λ c1 c2, ∃ (s : wseq α) S T, c1 = destruct (append s (join (append S T))) ∧ c2 = destruct (append s (append (join S) (join T)))) _ _ _ (let ⟨s, S, T, h1, h2⟩ := h in ⟨s, S, T, congr_arg destruct h1, congr_arg destruct h2⟩), intros c1 c2 h, exact match c1, c2, h with ._, ._, ⟨s, S, T, rfl, rfl⟩ := begin clear _match h h, apply wseq.rec_on s _ (λ a s, _) (λ s, _); simp, { apply wseq.rec_on S _ (λ s S, _) (λ S, _); simp, { apply wseq.rec_on T _ (λ s T, _) (λ T, _); simp, { refine ⟨s, nil, T, _, _⟩; simp }, { refine ⟨nil, nil, T, _, _⟩; simp } }, { exact ⟨s, S, T, rfl, rfl⟩ }, { refine ⟨nil, S, T, _, _⟩; simp } }, { exact ⟨s, S, T, rfl, rfl⟩ }, { exact ⟨s, S, T, rfl, rfl⟩ } end end end @[simp] theorem bind_ret (f : α → β) (s) : bind s (ret ∘ f) ~ map f s := begin dsimp [bind], change (λ x, ret (f x)) with (ret ∘ f), rw [map_comp], apply join_map_ret end @[simp] theorem ret_bind (a : α) (f : α → wseq β) : bind (ret a) f ~ f a := by simp [bind] @[simp] theorem map_join (f : α → β) (S) : map f (join S) = join (map (map f) S) := begin apply seq.eq_of_bisim (λ s1 s2, ∃ s S, s1 = append s (map f (join S)) ∧ s2 = append s (join (map (map f) S))), { intros s1 s2 h, exact match s1, s2, h with ._, ._, ⟨s, S, rfl, rfl⟩ := begin apply wseq.rec_on s _ (λ a s, _) (λ s, _); simp, { apply wseq.rec_on S _ (λ s S, _) (λ S, _); simp, { exact ⟨map f s, S, rfl, rfl⟩ }, { refine ⟨nil, S, _, _⟩; simp } }, { exact ⟨_, _, rfl, rfl⟩ }, { exact ⟨_, _, rfl, rfl⟩ } end end }, { refine ⟨nil, S, _, _⟩; simp } end @[simp] theorem join_join (SS : wseq (wseq (wseq α))) : join (join SS) ~ join (map join SS) := begin refine ⟨λ s1 s2, ∃ s S SS, s1 = append s (join (append S (join SS))) ∧ s2 = append s (append (join S) (join (map join SS))), ⟨nil, nil, SS, by simp, by simp⟩, _⟩, intros s1 s2 h, apply lift_rel_rec (λ c1 c2, ∃ s S SS, c1 = destruct (append s (join (append S (join SS)))) ∧ c2 = destruct (append s (append (join S) (join (map join SS))))) _ (destruct s1) (destruct s2) (let ⟨s, S, SS, h1, h2⟩ := h in ⟨s, S, SS, by simp [h1], by simp [h2]⟩), intros c1 c2 h, exact match c1, c2, h with ._, ._, ⟨s, S, SS, rfl, rfl⟩ := begin clear _match h h, apply wseq.rec_on s _ (λ a s, _) (λ s, _); simp, { apply wseq.rec_on S _ (λ s S, _) (λ S, _); simp, { apply wseq.rec_on SS _ (λ S SS, _) (λ SS, _); simp, { refine ⟨nil, S, SS, _, _⟩; simp }, { refine ⟨nil, nil, SS, _, _⟩; simp } }, { exact ⟨s, S, SS, rfl, rfl⟩ }, { refine ⟨nil, S, SS, _, _⟩; simp } }, { exact ⟨s, S, SS, rfl, rfl⟩ }, { exact ⟨s, S, SS, rfl, rfl⟩ } end end end @[simp] theorem bind_assoc (s : wseq α) (f : α → wseq β) (g : β → wseq γ) : bind (bind s f) g ~ bind s (λ (x : α), bind (f x) g) := begin simp [bind], rw [← map_comp f (map g), map_comp (map g ∘ f) join], apply join_join end instance : monad wseq := { map := @map, pure := @ret, bind := @bind } /- Unfortunately, wseq is not a lawful monad, because it does not satisfy the monad laws exactly, only up to sequence equivalence. Furthermore, even quotienting by the equivalence is not sufficient, because the join operation involves lists of quotient elements, with a lifted equivalence relation, and pure quotients cannot handle this type of construction. instance : is_lawful_monad wseq := { id_map := @map_id, bind_pure_comp_eq_map := @bind_ret, pure_bind := @ret_bind, bind_assoc := @bind_assoc } -/ end wseq end stream
module FTCQueue -- Based on http://okmij.org/ftp/Haskell/AlgorithmsH1.html#FTCQueue %access public export data FTCQueue : (r : Type -> Type -> Type) -> Type -> Type -> Type where Leaf : r a b -> FTCQueue r a b Node : FTCQueue r a x -> FTCQueue r x b -> FTCQueue r a b tsingleton : r a b -> FTCQueue r a b tsingleton r = Leaf r infixl 9 |> (|>) : FTCQueue r a x -> r x b -> FTCQueue r a b t |> r = Node t (Leaf r) infixl 9 >< (><) : FTCQueue r a x -> FTCQueue r x b -> FTCQueue r a b t1 >< t2 = Node t1 t2 infixl 9 :| data ViewL : (r : Type -> Type -> Type) -> Type -> Type -> Type where TOne : r a b -> ViewL r a b (:|) : r a x -> FTCQueue r x b -> ViewL r a b tviewl : FTCQueue r a b -> ViewL r a b tviewl (Leaf r) = TOne r tviewl (Node t1 t2) = go t1 t2 where go : FTCQueue r a x -> FTCQueue r x b -> ViewL r a b go (Leaf r) tr = r :| tr go (Node tl1 tl2) tr = go tl1 (Node tl2 tr)
lemma residue_div: assumes "open s" "z \<in> s" and f_holo: "f holomorphic_on s - {z}" shows "residue (\<lambda>z. (f z) / c) z= residue f z / c "
Proteins : Biogenesis to Degradation – The Virtual Library of Biochemistry and Cell Biology
# Copyright (c) 2018-2021, Carnegie Mellon University # See LICENSE for details Declare(TTensorI_OL); Declare(TTensorI_OL_Vectorize_AVecLast); #Class(RewriteBarrier,RewritableObject); #Class(RewriteBarrier,DFT); #RewriteBarrier.numops:=self>>1; DropVectorTag:=function(nt) return nt.withoutTag(AVecReg); #D return SetTag(nt,Filtered(GetTags(nt),t->ObjId(t)<>AVecReg)); end; DropParTag:=function(nt) return nt.withoutTag(AParSMP); #D return SetTag(nt,Filtered(GetTags(nt),t->ObjId(t)<>AParSMP)); end; Devectorize:=function(l,vlen) return List(l,e-> Cond( ObjId(e)=TArray and e.t=TUnknown, TArray(e.t,e.size*vlen), ObjId(e)=TArray and ObjId(e.t)=TVect, TArray(e.t.t,e.size*e.t.size), ObjId(e)=TVect, TArray(e.t,e.size), e) ); end; Class(VTensor_OL, Tensor, rec( new := (self, L) >> SPL(WithBases(self, rec( _children := [L[1]], vlen := L[2]))), print := (self,i,is) >> Print(self.name, "(", self.child(1).print(i+is,is), ", ", self.vlen,")"), sums := self >> Inherit(self, rec(_children := [self.child(1).sums()])), isPermutation := False, rng := meth(self) #FULL HACK return Devectorize(self.child(1).rng(),self.vlen); end, dmn := meth(self) #FULL HACK return Devectorize(self.child(1).dmn(),self.vlen); end, dims := meth(self) if (IsBound(self.rng)and IsBound(self.dmn)) then return [StripList(List(self.rng(),l->l.size)), StripList(List(self.dmn(),l->l.size))]; fi; end, )); #VTensor.dmn:= meth(self) #FULL HACK # local x; # x:=self.child(1).dmn()[1]; # if ObjId(x)=TArray and x.t=TUnknown then # return [TArray(TUnknown,x.size*self.vlen)]; # else # return Devectorize(self.child(1).dmn()); # fi; #end; #VTensor.rng:= meth(self) #FULL HACK # local x; # x:=self.child(1).rng()[1]; # if ObjId(x)=TArray and x.t=TUnknown then # return [TArray(TUnknown,x.size*self.vlen)]; # else # return Devectorize(self.child(1).rng()); # fi; #end; BlockVPerm.dmn := meth(self) return [TArray(self.child(1).dmn()[1].t,self.child(1).dmn()[1].size*self.n)]; end; BlockVPerm.rng := meth(self) return [TArray(self.child(1).rng()[1].t,self.child(1).rng()[1].size*self.n)]; end; Class(ScatQuestionMark, Scat, rec()); Class(ICScatAcc,Scat,rec(codeletName:="ICSA")); Class(VScatQuestionMark, VScat, rec()); Class(VScat_svQuestionMark, VScat_sv, rec()); Class(ScatInit, BaseMat, rec( new := meth(self, f,con,c) local res; res := SPL(WithBases(self, rec(func:=f,cond:=con, _children:=c))); return res; end, rng:=self>>self._children.rng(), dmn:=self>>self._children.dmn(), print := meth(self,i,is) Print(self.name, "(", self.func, ", ",self.cond,", "); Print("\n", Blanks(i+is)); SPLOps.Print(self._children, i + is, is); Print("\n", Blanks(i),")"); return; end, rChildren := self >> [self._children,self.func], rSetChild := meth ( self, n, newChild ) if n= 1 then self._children :=newChild; elif n=2 then self.func := newChild; else Error("<n> must be 1"); fi; end )); Class(ScatInitProbe,ScatInit,rec()); Class(ScatInitFixed,ScatInit,rec()); Class(KroneckerSymbol, BaseMat, rec( abbrevs := [ arg -> [Flat(arg)] ], new := meth(self, l) local res; res := SPL(WithBases(self, rec(element:=l))); return res; end, isExp:=true, dims:=self>>[1,1] #avoid recursive definition for the old-school Tensor )); ## Base Vector Class(BV, BaseMat, rec( new := (self, i) >> #Checked(IsVar(i),SPL(WithBases(self, rec(element:=i)))) SPL(WithBases(self, rec(element:=i))), dims:=self>>self.element.dimensions #[0,0] #avoid recursive definition for the old-school Tensor )); ## Multiplication operator ## Multiplication(1,n) is I(n) ## Multiplication(2,n) is a point-wise multiplication of two vectors of size n Class(Multiplication, BaseMat, rec( abbrevs := [ arg -> [Flat(arg)] ], new := meth(self, l) local res; if l[1]=1 then return Prm(fId(l[2])); fi; res := SPL(WithBases(self, rec(element:=l,TType:=Replicate(l[1],TUnknown)))); return res; end, isPermutation := self >> false, # dmn:=self>>Replicate(self.element[1],TArray(self.TType,self.element[2])), #HACK # dmn:=meth(self) local a; a:=Replicate(self.element[1],TArray(self.TType,self.element[2]));a[1]:=TArray(TReal,1);return a; end, dmn:=self >>List(self.TType,x->TArray(x,self.element[2])), rng:=self>>let(a:=Try(First(self.TType,x->ObjId(x)=TVect)),t:=Cond(a[1],a[2],self.TType[1]),[TArray(t,self.element[2])]), sums:= self>>self, numops:=self>>self.element[2]*(self.element[1]-1), transpose := self >>self, print := meth(self,i,is) Print(self.name, "(", self.element[1], ", ",self.element[2],")"); self.printA(); return; end )); Class(ICMultiplication,Multiplication, rec( )); _mk_advdim_r := (e) -> List(e, x -> When(IsList(x), _mk_advdim_r(x), [x])); _mk_advdim := (d) -> _mk_advdim_r(When(IsList(d), d, [d])); Class(Glue, BaseMat, rec( abbrevs := [(n,size) ->[n,size]], new := meth(self,n,size) local res; res := SPL(WithBases(self, rec(element:=[n,size],dimensions:=[size*n,Replicate(n,size)],TType:=Replicate(n,TUnknown)))); return res; end, isPermutation := self >> false, dmn:=self >>List([1..(self.element[1])],x->TArray(self.TType[x],self.element[2])), rng:=self>>[TArray(self.TType[1],self.element[1]*self.element[2])], sums:= self>>self, transpose:=self>>Copy(self), numops:=self>>self.element[2]*(self.element[1]-1), print := meth(self,i,is) Print(self.name, "(", self.element[1], ", ",self.element[2],")"); self.printA(); return; end, rChildren := self >> self.element, rSetChild := meth( self, n, newChild ) self.element[n] := Checked(n=1 or n=2, newChild); end, advdims := self >> let( d := self.dims(), [ _mk_advdim(d[1]), _mk_advdim(d[2]) ]), normalizedArithCost := (self) >> 0, isReal := self >> true, # makes no sense )); Class(Split, BaseMat, rec( abbrevs := [(size,n) ->[size,n]], new := meth(self,size,n) local res; res := SPL(WithBases(self, rec(element:=[size,n],dimensions:=[Replicate(n,size / n),size],TType:=[TUnknown]))); return res; end, isPermutation := self >> false, rng:=self >>List([1..self.element[2]],x->TArray(self.TType[1],self.element[1] / self.element[2])), dmn:=self>>[TArray(self.TType[1],self.element[1])], sums:= self>>self, transpose:= self>>Copy(self), numops:=self>>(self.element[1]), print := meth(self,i,is) Print(self.name, "(", self.element[1], ", ",self.element[2],")"); self.printA(); return; end, rChildren := self >> self.element, rSetChild := meth( self, n, newChild ) self.element[n] := Checked(n=1 or n=2, newChild); end, advdims := self >> let( d := self.dims(), [ _mk_advdim(d[1]), _mk_advdim(d[2]) ]), normalizedArithCost := (self) >> 0, isReal := self >> true, # makes no sense )); ## NoOp, used with in COND_OL() Class(NoOp, BaseMat, rec( abbrevs := [ arg -> [Flat(arg)] ], new := meth(self, l) local res; if (Length(l) = 1) then return SPL(WithBases(self, rec(element:=l, TType:=Replicate(1, TUnknown)))); fi; end, isPermutation := self >> false, dmn:=self >> [TArray(self.TType[1], self.element[1])], rng:=self >> [TArray(self.TType[1], self.element[1])], sums:= self>>self, numops:=self>> 0, print := meth(self,i,is) Print(self.name, "(", self.element[1], ")"); self.printA(); return; end )); ## Constant Class(Const, BaseMat, rec( abbrevs := [ arg -> [Flat(arg)] ], new := meth(self, l) local res; if (Length(l) = 1) then return SPL(WithBases(self, rec(element:=l, TType:=Replicate(1, TUnknown)))); fi; # Here end, isPermutation := self >> false, dmn:=self >> [], # [TArray(self.TType[1], 0)], rng:=self >> [TArray(self.TType[1], 1)], sums:= self>>self, numops:=self>> 0, print := meth(self,i,is) Print(self.name, "(", self.element[1], ")"); self.printA(); return; end )); Class(Or, BaseMat, rec( abbrevs := [ arg -> [Flat(arg)] ], new := meth(self, l) local res; if (Length(l) = 1) then return SPL(WithBases(self, rec(element:=l, TType:=Replicate(l[1], TUnknown)))); fi; # Here end, isPermutation := self >> false, dmn:=self >> List(self.TType, x->TArray(x,1)), rng:=self >> [ TArray(self.TType[1], 1)], sums:= self>>self, numops:=self>> 0, print := meth(self,i,is) Print(self.name, "(", self.element[1], ")"); self.printA(); return; end )); Class(And, BaseMat, rec( abbrevs := [ arg -> [Flat(arg)] ], new := meth(self, l) local res; if (Length(l) = 1) then return SPL(WithBases(self, rec(element:=l, TType:=Replicate(l[1], TUnknown)))); fi; # Here end, isPermutation := self >> false, dmn:=self >> List(self.TType, x->TArray(x,1)), rng:=self >> [ TArray(self.TType[1], 1)], sums:= self>>self, numops:=self>> 0, print := meth(self,i,is) Print(self.name, "(", self.element[1], ")"); self.printA(); return; end )); Class(NotEqual, BaseMat, rec( abbrevs := [ arg -> [Flat(arg)] ], new := meth(self, l) local res; if (Length(l) = 1) then return SPL(WithBases(self, rec(element:=l, TType:=Replicate(l[1], TUnknown)))); fi; # Here end, isPermutation := self >> false, dmn:=self >> List(self.TType, x->TArray(x,1)), rng:=self >> [ TArray(self.TType[1], 1)], sums:= self>>self, numops:=self>> 0, print := meth(self,i,is) Print(self.name, "(", self.element[1], ")"); self.printA(); return; end )); Class(Equal, BaseMat, rec( abbrevs := [ arg -> [Flat(arg)] ], new := meth(self, l) local res; if (Length(l) = 1) then return SPL(WithBases(self, rec(element:=l, TType:=Replicate(l[1], TUnknown)))); fi; # Here end, isPermutation := self >> false, dmn:=self >> List(self.TType, x->TArray(x,1)), rng:=self >> [ TArray(self.TType[1], 1)], sums:= self>>self, numops:=self>> 0, print := meth(self,i,is) Print(self.name, "(", self.element[1], ")"); self.printA(); return; end )); Class(ExclusiveOr, BaseMat, rec( abbrevs := [ arg -> [Flat(arg)] ], new := meth(self, l) local res; if (Length(l) = 1) then return SPL(WithBases(self, rec(element:=l, TType:=Replicate(l[1], TUnknown)))); fi; # Here end, isPermutation := self >> false, dmn:=self >> List(self.TType, x->TArray(x,1)), rng:=self >> [ TArray(self.TType[1], 1)], sums:= self>>self, numops:=self>> 0, print := meth(self,i,is) Print(self.name, "(", self.element[1], ")"); self.printA(); return; end )); ## Minimums ## Minimums(n) -> Input is n-way vector Class(Minimums, BaseMat, rec( abbrevs := [ arg -> [Flat(arg)] ], new := meth(self, l) local res; if (Length(l) = 1) then return SPL(WithBases(self, rec(element:=l, TType:=Replicate(l[1], TUnknown)))); fi; # Here end, isPermutation := self >> false, dmn:=self >> List(self.TType, x->TArray(x,1)), rng:=self >> [ TArray(self.TType[1], 1)], sums:= self>>self, numops:=self>> 0, print := meth(self,i,is) Print(self.name, "(", self.element[1], ")"); self.printA(); return; end )); ## Maximums ## Maximums(n) -> Input is n-way vector Class(Maximums, BaseMat, rec( abbrevs := [ arg -> [Flat(arg)] ], new := meth(self, l) local res; if (Length(l) = 1) then return SPL(WithBases(self, rec(element:=l, TType:=Replicate(l[1], TUnknown)))); fi; # Here end, isPermutation := self >> false, dmn:=self >> List(self.TType, x->TArray(x,1)), rng:=self >> [ TArray(self.TType[1], 1) ], sums:= self>>self, numops:=self>> 0, print := meth(self,i,is) Print(self.name, "(", self.element[1], ")"); self.printA(); return; end )); #Addition Class(Addition, BaseMat, rec( abbrevs := [ arg -> [Flat(arg)] ], new := meth(self, l) local res; if l[1]=1 then return Prm(fId(l[2])); fi; res := SPL(WithBases(self, rec(element:=l,TType:=Replicate(l[1],TUnknown)))); return res.setDims(); end, isPermutation := self >> false, dmn:=self >> List( [1..self.element[1]], i -> TArray(TUnknown, self.element[2])), rng:=self >> [TArray(TUnknown, self.element[2])], sums:= self>>self, numops:=self>>self.element[2]*(self.element[1]-1), print := meth(self,i,is) Print(self.name, "(", self.element[1], ", ",self.element[2],")"); self.printA(); return; end, transpose := self >> InertTranspose(self), area := self >> self.element[2]*(self.element[1]-1), )); Class(Subtraction, BaseMat, rec( abbrevs := [ arg -> [Flat(arg)] ], new := meth(self, l) local res; if l[1]=1 then return Prm(fId(l[2])); fi; res := SPL(WithBases(self, rec(element:=l,TType:=Replicate(l[1],TUnknown)))); return res; end, isPermutation := self >> false, dmn:=self >>List(self.TType,x->TArray(x,self.element[2])), rng:=self>>let(a:=Try(First(self.TType,x->ObjId(x)=TVect)),t:=Cond(a[1],a[2],self.TType[1]),[TArray(t,self.element[2])]), sums:= self>>self, numops:=self>>self.element[2]*(self.element[1]-1), print := meth(self,i,is) Print(self.name, "(", self.element[1], ", ",self.element[2],")"); self.printA(); return; end )); # Declare(Cross); # Class(Cross, BaseOperation, rec( # abbrevs := [ arg -> [Flat(arg)] ], # new := meth(self, L) # if Length(L)=1 then return L[1]; fi; # return SPL(WithBases(self, rec(_children:=L))); # end, # codeletName:="C", # isPermutation := self >> false, # dmn:=self>>let(li:=[],Flat(List(self._children, x-> x.dmn()))), # rng:=self>>let(li:=[],Flat(List(self._children, x-> x.rng()))), # sums:= meth(self) # local i; # for i in [1..Length(self._children)] do # self._children[i]:=self._children[i].sums(); # od; # return self; # end, # hasLeftGath:=meth(self) # local i; # for i in self._children do # # if (ObjId(i)=Compose and ObjId(i.rChildren()[1])=Gath) or # # (ObjId(i)=Gath) then # # return true; # if (ObjId(i)=Compose and IsBound(i.rChildren()[1].func) and i.rChildren()[1].func.free()<>Set([])) or (IsBound(i.func) and (not ObjId(i)=VGath_dup) and i.func.free()<>Set([])) and not(ObjId(i)=ISum) then # return true; # fi; # od; # return false; # end, # hasRightScat:=meth(self) # local i; # for i in self._children do # # if (ObjId(i)=Compose and ObjId(Last(i.rChildren()))=Scat) or # # (ObjId(i)=Scat) then # # return true; # # fi; # if (ObjId(i)=Compose and ((IsBound(Last(i.rChildren()).func) and Last(i.rChildren()).func.free()=Set([])) or (ObjId(Last(i.rChildren()))=ISum) or (ObjId(Last(i.rChildren()))=VGath_dup and Length(Last(i.rChildren()).func.free())=1))) or (IsBound(i.func) and i.func.free()=Set([])) or (ObjId(i)=VGath_dup and Length(i.func.free())=1) or ObjId(i)=ISum then # return true; # fi; # od; # return false; # end, # splitCross:=meth(self) # local l,r; # l:=Copy(self); # r:=[]; # for i in [1..Length(l._children)] do # # if (ObjId(l._children[i])=Compose and ObjId(Last(l._children[i].rChildren()))=Scat) then # if (ObjId(l._children[i])=Compose and ((IsBound(Last(l._children[i].rChildren()).func) and Last(l._children[i].rChildren()).func.free()=Set([])) or (ObjId(Last(l._children[i].rChildren()))=ISum) or (ObjId(Last(l._children[i].rChildren()))=VGath_dup and Length(Last(l._children[i].rChildren()).func.free())=1))) or (ObjId(l._children[i])=ISum) then # Add(r,Last(l._children[i].rChildren())); # l._children[i]._children:=DropLast(l._children[i]._children,1); # # elif (ObjId(l._children[i])=Scat) then # elif (IsBound(l._children[i].func) and l._children[i].func.free()=Set([])) or (ObjId(i)=VGath_dup and Length(i.func.free())=1) then # Add(r,l._children[i]); # l._children[i]:=Prm(fId(l._children[i].dims()[1])); # else # Add(r,Prm(fId(l._children[i].dims()[2]))); # fi; # od; # return [l,Cross(r)]; # end # ) # ); Class(CrossBlockTop,Cross); Identities:=function(l) return Cross(List(l,x->Prm(fId(x.size)))); end; BB.numops:= self>>self.child(1).numops(); NoPull.numops:= self>>self.child(1).numops(); NoPullRight.numops:= self>>self.child(1).numops(); NoPullLeft.numops:= self>>self.child(1).numops(); PushR.numops:= self>>self.child(1).numops(); ISum.numops:=self>>self.child(1).numops()*self.domain; SUM.numops:=self>>Sum(List(self._children,c->c.numops())); Cross.numops:=self>>Sum(List(self._children,c->c.numops())); Compose.numops:=self>>Sum(List(self._children,c->c.numops())); Scat.numops:=self>>self.dims()[2]; Gath.numops:=self>>self.dims()[1]; VGath.numops:=self>>self.dims()[1]; VGath_dup.numops:=self>>self.dims()[1]; VReplicate.numops:=self>>self.v; VHAdd.numops:=self>>self.v*self.v; VPerm.numops:=self>>self.dimensions[1]; Tensor.numops:=self>>self.dimensions[1]; ScatAcc.numops:=self>>self.dimensions[2]*2; #an add and a store VScatAcc.numops:=self>>self.dimensions[2]*2; #an add and a store VScat.numops:=self>>self.dimensions[2]; fBase.numops:=self>>0; fTensor.numops:=self>>0; fId.numops:=self>>0; ScatInit.numops:=self>>self._children.numops(); Prm.numops:=self>>0; I.numops:=self>>0; VTensor_OL.numops:=self>>self._children[1].numops()*self.vlen; Class(AOne,AGenericTag); Class(AMul,AGenericTag, rec( __call__ := meth ( arg ) local result, self, params; self := arg[1]; params := arg{[ 2 .. Length(arg) ]}; result := WithBases(self, rec( params := params, operations := PrintOps)); return result; end, print := self >> Print(self.__name__, "(", PrintCS(self.params), ")") )); Class(VOLWrap, VWrapBase, rec( __call__ := (self,isa) >> Checked(IsSIMD_ISA(isa), WithBases(self, rec(operations:=PrintOps, isa:=isa))), wrap := (self,r,t) >> let(isa := self.isa, v := isa.v, #This is OBVIOUSLY a hack. only deals with some kind of vectorization nontransforms.ol.TTensorI_OL_Vectorize_AVecLast(TTensorI_OL(t, [ AOne, AVec ],[ [ 0, 2 ] ], [ 1, v ], [ AVecReg(isa) ]), r)), twrap := (self, t) >> let(isa := self.isa, v := isa.v, #This is OBVIOUSLY a hack. only deals with some kind of vectorization TTensorI_OL(t, [ AOne, AVec ],[ [ 0, 2 ] ], [ 1, v ], [ AVecReg(isa) ]) ), print := self >> Print(self.name, "(", self.isa, ")") )); Class(TTensorI_OL, Tagged_tSPL, rec( abbrevs := [ (nt,g,s,v) -> [nt,List([1..Length(g)],i->When(v[i]=1,AOne,g[i])),s,v] ], dmn := self >> let( nt := self.params[1], sizes := self.params[4], List([1..Length(sizes)], i-> TArray(nt.dmn()[i].t,sizes[i] * nt.dmn()[i].size) )), rng := self >> let( nt := self.params[1], s := self.params[3], v := self.params[4], List([1..Length(s)], i-> TArray(nt.rng()[i].t, Product(List(s[i], a -> When(a=0, nt.rng()[i].size, v[a] ) ))) ) ), isReal := self >> self.params[1].isReal(), doNotMeasure:=true, doNotSaveInHashtable:=true, decomposePerformance:=true, transpose := self >> Copy(self), #D tagpos :=5, )); #Changed by Marek, looks OK NewRulesFor(TTensorI_OL, rec( TTensorI_OL_Base :=rec( applicable := (self,t) >> not(t.hasTag(AParSMP)) and t.getTags() = t.params[1].getTags(), freedoms := nt -> let( g := nt.params[2], nbvars := Length(Filtered(g,x->x=APar or x=AVec)), [Arrangements([1..nbvars],nbvars)] ), child := (nt,freedoms) -> [nt.params[1],InfoNt(freedoms)], recompose := (nt,cnt,cperf) -> cperf[1]*Product(List(Filtered(Zip2(nt.params[2],nt.params[4]),l->l[1] in [APar,AVec]),x->x[2])), apply := function(nt,c,cnt) local g,s,v,perm,ind1,ind,ind2,gathers,scatters,result,z; g := nt.params[2]; s := nt.params[3]; v := nt.params[4]; perm := cnt[2].params[1][1]; ind1 := List([1..Length(g)], i -> Cond(g[i]=APar or g[i]=AVec, fBase(Ind(v[i])), g[i]=AOne, fId(1), ObjId(g[i])=AMul, g[i], Error("PV not known!") ) ); ind := List(ind1, x -> When(ObjId(x)=AMul,ind1[x.params[1]],x)); gathers := Cross(List([1..Length(g)], i -> let( kernelsize := fId(cnt[1].dmn()[i].size), When(g[i]=APar or (ObjId(g[i])=AMul and g[i].params[2]=APar), Gath(fTensor(ind[i],kernelsize)), Gath(fTensor(kernelsize,ind[i])) ) ))); scatters := Cross(List([1..Length(s)], i -> ScatQuestionMark( fTensor( List(s[i], y -> When(y=0, fId(cnt[1].rng()[i].size), ind[y] ) ) )) )); result := scatters*c[1]*gathers; ind2:=[]; for i in [1..Length(g)] do if g[i]=APar or g[i]=AVec then Add(ind2,ind[i]); fi; od; for i in [1..Length(ind2)] do result:=ISum(ind2[perm[i]].params[2], ind2[perm[i]].params[1], result); od; return result; end ), #D applicable :=(self,t) >> Length(Filtered(GetTags(t),x->ObjId(x)=AParSMP))=0 and GetTags(t)=GetTags(t.params[1]) #D, #D freedoms := nt -> let(g:=nt.params[2], #D nbvars:=Length(Filtered(g,x->x=APar or x=AVec)), #D [Arrangements([1..nbvars],nbvars)]), #D child := (nt,freedoms) -> [nt.params[1],InfoNt(freedoms)], #D recompose := (nt,cnt,cperf) -> cperf[1]*Product(List(Filtered(Zip2(nt.params[2],nt.params[4]),l->l[1] in [APar,AVec]),x->x[2])), #D apply := function(nt,c,cnt) #D local g,s,v,perm,ind1,ind,ind2,gathers,scatters,result,z; #D g:=nt.params[2]; #D s:=nt.params[3]; #D v:=nt.params[4]; #D perm:=cnt[2].params[1][1]; #D ind1:=List([1..Length(g)], #D i->Cond(g[i]=APar or g[i]=AVec,fBase(Ind(v[i])), #D g[i]=AOne,fId(1), #D ObjId(g[i])=AMul,g[i], #D Error("PV not known!"))); #D ind:=List(ind1,x->When(ObjId(x)=AMul,ind1[x.params[1]],x)); #D gathers:= Cross(List([1..Length(g)], #D i->let(kernelsize:=fId(cnt[1].dmn()[i].size), #D When(g[i]=APar or (ObjId(g[i])=AMul and g[i].params[2]=APar), #D Gath(fTensor(ind[i],kernelsize)), #D Gath(fTensor(kernelsize,ind[i])))))); #D scatters:=Cross(List([1..Length(s)], #D i->ScatQuestionMark(fTensor( #D List(s[i],y-> #D When(y=0,fId(cnt[1].rng()[i].size), #D ind[y])))))); #D result:=scatters*c[1]*gathers; #D ind2:=[]; #D for i in [1..Length(g)] do #D if g[i]=APar or g[i]=AVec then #D Add(ind2,ind[i]); #D fi; #D od; #D for i in [1..Length(ind2)] do #D result:=ISum(ind2[perm[i]].params[2],ind2[perm[i]].params[1],result); #D od; #D #D return result; #D end #D ), #Changed by Marek, looks OK TTensorI_OL_Parrallelize_AParFirst := rec( applicable :=(self,t) >> t.isTag(1, AParSMP) and 0 <> t.params[3][1][1] and APar = t.params[2][t.params[3][1][1]] and t.firstTag().params[1] = t.params[4][t.params[3][1][1]] and 1 = t.params[3][1][1], #t.params[3][1][1]=1 is a trick to prevent // the 2nd input because TensorGeneral breaks at the moment freedoms := nt -> [[1]], child := function (nt,freedoms) local PV,sizes; sizes := Copy(nt.params[4]); sizes[nt.params[3][1][1]] := 1; if Length(Filtered(sizes, t -> t<>1)) > 0 then PV:=Copy(nt.params[2]); PV[nt.params[3][1][1]] := AOne; return [TTensorI_OL( DropParTag(nt.params[1]), PV, nt.params[3], sizes, Drop(nt.params[5],1) )]; else return [ DropParTag(Copy(nt.params[1])) ]; fi; end, apply := function(nt,c,cnt) local myCross,a,b,index; index := Ind(nt.firstTag().params[1]); a := List(c[1].dims()[2], x -> fId(x)); a[nt.params[3][1][1]] := fTensor(fBase(index), a[nt.params[3][1][1]]); b:=List(a, x -> Gath(x)); myCross:=Cross(b); # return SMPSum(GetFirstTag(nt).params[1],index, GetFirstTag(nt).params[1],ScatQuestionMark(fTensor(fBase(index), fId(c[1].dims()[1]))) *c[1]* Cross(Gath(fTensor(fBase(index), fId(c[1].dims()[2][1]))),Gath(fId(c[1].dims()[2][2])))); return SMPSum( nt.firstTag().params[1], index, nt.firstTag().params[1], ScatQuestionMark(fTensor( fBase(index), fId(c[1].dims()[1]) )) * c[1] * myCross ); end ), #D applicable :=(self,t) >> FirstTagEq(t, AParSMP) and t.params[3][1][1]<>0 and #D t.params[2][t.params[3][1][1]]=APar and #D t.params[4][t.params[3][1][1]]=GetFirstTag(t).params[1] and #D t.params[3][1][1]=1, #t.params[3][1][1]=1 is a trick to prevent // the 2nd input because TensorGeneral breaks at the moment #D freedoms := nt -> [[1]], #D child := function (nt,freedoms) #D local PV,sizes; #D sizes:=Copy(nt.params[4]); #D sizes[nt.params[3][1][1]]:=1; #D if Length(Filtered(sizes, t->t<>1))>0 then #D PV:=Copy(nt.params[2]); #D PV[nt.params[3][1][1]]:=AOne; #D return [TTensorI_OL(DropParTag(nt.params[1]), #D PV,nt.params[3],sizes,Drop(nt.params[5],1))]; #D else #D return [DropParTag(Copy(nt.params[1]))]; #D fi; #D end, #D apply := function(nt,c,cnt) #D local myCross,a,b,index; #D index:=Ind(GetFirstTag(nt).params[1]); #D a:=List(c[1].dims()[2],x->fId(x)); #D a[nt.params[3][1][1]]:=fTensor(fBase(index),a[nt.params[3][1][1]]); #D b:=List(a,x->Gath(x)); #D myCross:=Cross(b); #D# return SMPSum(GetFirstTag(nt).params[1],index, GetFirstTag(nt).params[1],ScatQuestionMark(fTensor(fBase(index), fId(c[1].dims()[1]))) *c[1]* Cross(Gath(fTensor(fBase(index), fId(c[1].dims()[2][1]))),Gath(fId(c[1].dims()[2][2])))); #D return SMPSum(GetFirstTag(nt).params[1],index, GetFirstTag(nt).params[1],ScatQuestionMark(fTensor(fBase(index), fId(c[1].dims()[1]))) *c[1]* myCross); #D end), #That code vectorizes the last guy if it is a AVec of the vector size #Hack, only works with one output #Changed by Marek, looks OK TTensorI_OL_Vectorize_AVecLast :=rec( applicable := (self,t) >> t.isTag(1, AVecReg) and Last(t.params[3][1])<>0 and AVec = t.params[2][Last(t.params[3][1])] and t.params[4][Last(t.params[3][1])] = t.firstTag().v, freedoms := nt -> [[1]], child := function(nt, freedoms) local PV, sizes; sizes := Copy(nt.params[4]); sizes[Last(nt.params[3][1])] := 1; if Length(Filtered(sizes, t->t<>1))>0 then PV:=Copy(nt.params[2]); PV[Last(nt.params[3][1])]:=AOne; return [TTensorI_OL( DropVectorTag(nt.params[1]).setWrap(VOLWrap(nt.firstTag().isa)), PV, nt.params[3], sizes, Drop(nt.params[5],1) )]; else return [ DropVectorTag(Copy(nt.params[1])).setWrap(VOLWrap(nt.firstTag().isa)) ]; fi; end, apply := function(nt,c,cnt) local myCross, myScat, mydims, v; v := nt.firstTag().v; #little hack for KernelDup if ObjId(nt.params[1]).name <> "KernelMMMDuped" then myCross := Cross(List(nt.dims()[2], t -> VGath_dup(fId(t), v) )); myCross._children[Last(nt.params[3][1])] := VPrm_x_I( fId( nt.dims()[2][Last(nt.params[3][1])] / v ), nt.firstTag().v ); else mydims := nt.dims()[2]; mydims[1] := mydims[1] * v; myCross := Cross(List(mydims, t -> VPrm_x_I( fId(t/v), v ) )); fi; myScat := VScat(fId( nt.dims()[1]/v ), v ); return myScat * VTensor_OL(c[1], v) * myCross; end ), #D applicable :=(self,t) >> FirstTagEq(t, AVecReg) and Last(t.params[3][1])<>0 and t.params[2][Last(t.params[3][1])]=AVec and t.params[4][Last(t.params[3][1])]=GetFirstTag(t).v, #D freedoms := nt -> [[1]], #D child := function (nt,freedoms) #D local PV,sizes; #D sizes:=Copy(nt.params[4]); #D sizes[Last(nt.params[3][1])]:=1; #D if Length(Filtered(sizes, t->t<>1))>0 then #D PV:=Copy(nt.params[2]); #D PV[Last(nt.params[3][1])]:=AOne; #D return [TTensorI_OL(DropVectorTag(nt.params[1]).setWrap(VOLWrap(GetFirstTag(nt).isa)), #D PV,nt.params[3],sizes,Drop(nt.params[5],1))]; #D else #D return [DropVectorTag(Copy(nt.params[1])).setWrap(VOLWrap(GetFirstTag(nt).isa))]; #D fi; #D end, #D apply := function(nt,c,cnt) #D local myCross,myScat,mydims; #D#little hack for KernelDup #D if (ObjId(nt.params[1]).name<>"KernelMMMDuped") then #D myCross:=Cross(List(nt.dims()[2],t->VGath_dup(fId(t),GetFirstTag(nt).v))); #D myCross._children[Last(nt.params[3][1])]:= #D VPrm_x_I(fId(nt.dims()[2][Last(nt.params[3][1])]/GetFirstTag(nt).v),GetFirstTag(nt).v); #D else #D mydims:=nt.dims()[2]; #D mydims[1]:=mydims[1]*GetFirstTag(nt).v; #D myCross:=Cross(List(mydims,t->VPrm_x_I(fId(t/GetFirstTag(nt).v),GetFirstTag(nt).v))); #D fi; #D myScat:=VScat(fId(nt.dims()[1]/GetFirstTag(nt).v),GetFirstTag(nt).v); #D return myScat*VTensor_OL(c[1],GetFirstTag(nt).v)*myCross; #D end), #Changed by Marek, looks OK TTensorI_OL_Vectorize_AParFirst :=rec( switch:=false, applicable := (self,t) >> t.isTag(1, AVecReg) and 0 <> First(t.params[3][1], x -> true) and APar = t.params[2][First(t.params[3][1],x -> true)] and t.firstTag().v = t.params[4][First(t.params[3][1], x -> true)], freedoms := nt -> [[1]], child := function (nt,freedoms) local PV,outorder,theguy; PV := Copy(nt.params[2]); PV[First(nt.params[3][1],x->true)] := AVec; theguy := Copy(First(nt.params[3][1], x->true)); outorder := Drop(Copy(nt.params[3][1]),1); Add(outorder,theguy); return [ TTensorI_OL( nt.params[1], PV, [outorder], nt.params[4], nt.params[5]), TL(nt.rng()[1].size, nt.firstTag().v, 1, 1, nt.params[5]), TL( nt.dmn()[First(nt.params[3][1], x -> true)].size, nt.dmn()[First(nt.params[3][1], x -> true)].size / nt.firstTag().v, 1, 1, nt.params[5] ) ]; end, apply := function(nt,c,cnt) local i; i := Identities(nt.dmn()); i._children[First(nt.params[3][1], x -> true)] := c[3]; return c[2] * c[1] * i; end ), #D applicable :=(self,t) >> FirstTagEq(t, AVecReg) and First(t.params[3][1],x->true)<>0 and t.params[2][First(t.params[3][1],x->true)]=APar and t.params[4][First(t.params[3][1],x->true)]=GetFirstTag(t).v, #D freedoms := nt -> [[1]], #D child := function (nt,freedoms) #D local PV,outorder,theguy; #D PV:=Copy(nt.params[2]); #D PV[First(nt.params[3][1],x->true)]:=AVec; #D theguy:=Copy(First(nt.params[3][1],x->true)); #D outorder:=Drop(Copy(nt.params[3][1]),1); #D Add(outorder,theguy); #D return [TTensorI_OL(nt.params[1],PV,[outorder],nt.params[4],nt.params[5]),TL(nt.rng()[1].size,GetFirstTag(nt).v,1,1,nt.params[5]),TL(nt.dmn()[First(nt.params[3][1],x->true)].size,nt.dmn()[First(nt.params[3][1],x->true)].size/GetFirstTag(nt).v,1,1,nt.params[5])]; #D end, #D apply := function(nt,c,cnt) #D local i; #D i:=Identities(nt.dmn()); #D i._children[First(nt.params[3][1],x->true)]:=c[3]; #D return c[2]*c[1]*i; #D end), ));
/- 5. Prove as many of the identities listed in Section 4.4 as you can. -/ open classical variables (α : Type) (p q : α → Prop) variable a : α variable r : Prop example : (∃ x : α, r) → r := assume h : ∃ x : α, r, exists.elim h ( assume xx : α, id ) --short version example : (∃ x : α, r) → r := λ ⟨xx, hr⟩, hr example : r → (∃ x : α, r) := assume hr : r, exists.intro a hr -- short version example : r → (∃ x : α, r) := λ hr, ⟨a, hr⟩ example : (∃ x, p x ∧ r) ↔ (∃ x, p x) ∧ r := iff.intro ( assume h : ∃ x, p x ∧ r, exists.elim h ( assume xx : α, assume h1 : p xx ∧ r, and.intro ( show ∃ x, p x, from exists.intro xx h1.left ) ( show r, from h1.right ) ) ) ( assume h : (∃ x, p x) ∧ r, have h1 : ∃ x, p x, from h.left, have h2 : r, from h.right, exists.elim h1 ( assume xx : α, assume hpxx : p xx, show ∃ x, p x ∧ r, from exists.intro xx (and.intro hpxx h2) ) ) -- short version example : (∃ x, p x ∧ r) ↔ (∃ x, p x) ∧ r := ⟨λ ⟨xx, hl, hr⟩, ⟨⟨xx, hl⟩, hr⟩, λ ⟨⟨xx, hpxx⟩, hr⟩, ⟨xx, hpxx, hr⟩⟩ example : (∃ x, p x ∨ q x) ↔ (∃ x, p x) ∨ (∃ x, q x) := iff.intro ( assume h : ∃ x, p x ∨ q x, exists.elim h ( assume xx : α, assume h1 : p xx ∨ q xx, or.elim h1 ( assume h2 : p xx, show (∃ x, p x) ∨ (∃ x, q x), from or.inl (exists.intro xx h2) ) ( assume h2 : q xx, show (∃ x, p x) ∨ (∃ x, q x), from or.inr (exists.intro xx h2) ) ) ) ( assume h : (∃ x, p x) ∨ (∃ x, q x), or.elim h ( assume h1 : ∃ x, p x, exists.elim h1 ( assume xx : α, assume h2 : p xx, show ∃ x, p x ∨ q x, from exists.intro xx (or.inl h2) ) ) ( assume h1 : ∃ x, q x, exists.elim h1 ( assume xx : α, assume h2 : q xx, show ∃ x, p x ∨ q x, from exists.intro xx (or.inr h2) ) ) ) -- short version example : (∃ x, p x ∨ q x) ↔ (∃ x, p x) ∨ (∃ x, q x) := iff.intro ( λ ⟨xx, h1⟩, h1.elim (λ hpxx, or.inl ⟨xx, hpxx⟩) (λ hqxx, or.inr ⟨xx, hqxx⟩) ) ( λ h, h.elim (λ ⟨xx, hpxx⟩, ⟨xx, or.inl hpxx⟩) (λ ⟨xx, hqxx⟩, ⟨xx, or.inr hqxx⟩) ) example : (∀ x, p x) ↔ ¬ (∃ x, ¬ p x) := iff.intro ( assume h : ∀ x, p x, show ¬ (∃ x, ¬ p x), from assume ⟨xx, hnpxx⟩, hnpxx (h xx) ) ( assume h : ¬ (∃ x, ¬ p x), assume xx : α, by_contradiction ( assume h1 : ¬ p xx, h (exists.intro xx h1) ) ) -- short version example : (∀ x, p x) ↔ ¬ (∃ x, ¬ p x) := iff.intro ( λ h, λ ⟨xx, hnpxx⟩, hnpxx (h xx) ) ( λ h, λ xx, by_contradiction (λ h1, h (exists.intro xx h1)) ) example : (∃ x, p x) ↔ ¬ (∀ x, ¬ p x) := iff.intro ( assume h : ∃ x, p x, exists.elim h ( assume x1 : α, assume hpx1 : p x1, show ¬ (∀ x, ¬ p x), from assume h1 : ∀ x, ¬ p x, absurd hpx1 (h1 x1) ) ) ( assume h : ¬ (∀ x, ¬ p x), by_contradiction ( assume h1 : ¬ ∃ x, p x, have h2 : ∀ x, ¬ p x, from assume x1, assume h3 : p x1, have h4 : ∃ x, p x, from ⟨x1, h3⟩, show false, from h1 h4, show false, from h h2 ) ) -- short version example : (∃ x, p x) ↔ ¬ (∀ x, ¬ p x) := iff.intro ( λ ⟨x1, hpx1⟩, λ h1, absurd hpx1 (h1 x1) ) ( λ h, by_contradiction (λ h1, h (λ x1, λ h2, h1 ⟨x1, h2⟩)) ) example : (¬ ∃ x, p x) ↔ (∀ x, ¬ p x) := iff.intro ( assume h : ¬ ∃ x, p x, assume x1 : α, assume hpx1 : p x1, have h1 : ∃ x, p x, from exists.intro x1 hpx1, show false, from h h1 ) ( assume h : ∀ x, ¬ p x, assume h1 : ∃ x, p x, exists.elim h1 ( assume x1 : α, assume hpx1 : p x1, show false, from (h x1) hpx1 ) ) -- short version example : (¬ ∃ x, p x) ↔ (∀ x, ¬ p x) := iff.intro (λ h, λ x1, λ hpx1, h (exists.intro x1 hpx1)) (λ h, (λ ⟨x1, hpx1⟩, (h x1) hpx1)) example : (¬ ∀ x, p x) ↔ (∃ x, ¬ p x) := iff.intro ( assume h : ¬ ∀ x, p x, by_contradiction ( assume h1 : ¬ (∃ x, ¬ p x), have h2 : ∀ x, p x, from assume x1 : α, by_contradiction ( assume h3 : ¬ p x1, h1 (exists.intro x1 h3) ), h h2 ) ) ( assume ⟨x1, hnpx1⟩, assume h1 : ∀ x, p x, absurd (h1 x1) hnpx1 ) example : (∀ x, p x → r) ↔ (∃ x, p x) → r := iff.intro ( assume h : ∀ x, p x → r, assume ⟨(x1 : α), (hpx1 : p x1)⟩, (h x1) hpx1 ) ( assume h : (∃ x, p x) → r, assume x1 : α, assume hpx1 : p x1, h (exists.intro x1 hpx1) ) example : (∃ x, p x → r) ↔ (∀ x, p x) → r := iff.intro ( assume ⟨(x1 : α), (h1 : p x1 → r)⟩, assume h2 : ∀ x, p x, h1 (h2 x1) ) ( assume h : (∀ x, p x) → r, show ∃ x, p x → r, from by_cases ( assume h1 : ∀ x, p x, ⟨a, λ h', h h1⟩ ) ( assume h1 : ¬ ∀ x, p x, by_contradiction ( assume h2 : ¬ ∃ x, p x → r, have h3 : ∀ x, p x, from assume x, by_contradiction ( assume hnp : ¬ p x, have h4 : ∃ x, p x → r, from ⟨x, (assume hp, absurd hp hnp)⟩, show false, from h2 h4 ), show false, from h1 h3 ) ) ) example : (∃ x, r → p x) ↔ (r → ∃ x, p x) := iff.intro ( assume ⟨(x1 : α), (h1 : r → p x1)⟩, assume hr : r, exists.intro x1 (h1 hr) ) ( assume h : r → ∃ x, p x, by_contradiction ( assume h1 : ¬ ∃ x, r → p x, have h2 : ∀ x, ¬ (r → p x), from assume x1 : α, assume h3 : r → p x1, show false, from h1 ⟨x1, h3⟩, have h3 : ∀ x, r ∧ ¬ p x, from assume x1 : α, (em r).elim ( assume hr : r, (em (p x1)).elim (assume hpx1, absurd (λ hp', hpx1) (h2 x1)) (assume hnpx1, ⟨hr, hnpx1⟩) ) ( assume hnr, false.elim ((h2 x1) (λ hp, absurd hp hnr)) ), have h4 : ∀ x, ¬ p x, from assume x1 : α, (h3 x1).right, have hr : r, from (h3 a).left, match h hr with ⟨(x1 : α), (hpx1 : p x1)⟩ := have hnpx1 : ¬ p x1, from h4 x1, hnpx1 hpx1 end ) )
theory flash61Rev imports flashPub begin section{*Main defintions*} lemma NI_FAckVsInv61: (*Rule0VsPInv1*) assumes a1:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_FAck ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have "?P1 s" apply(cut_tac a1 , auto) done then show "?P1 s\<or> ?P2 s\<or> ?P3 s" by blast qed lemma NI_InvVsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Inv iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 a2 , auto) lemma NI_InvAck_1VsInv61: (*Rule2VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iRule2 \<le> N" and a3:"iInv1 \<le> N" and a4:"iRule1~=iRule2 " shows "invHoldForRule' s (inv61 iInv1 ) (NI_InvAck_1 iRule1 iRule2 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have "?P2 s" by(cut_tac a1 a2 a3 a4, auto) then show "?P1 s\<or>?P2 s\<or>?P3 s" by auto qed lemma NI_InvAck_1_HomeVsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_InvAck_1_Home iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 a2 , auto) lemma NI_InvAck_2VsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_InvAck_2 N iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 a2 , auto) lemma NI_Local_GetX_GetXVsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_GetX_GetX iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P1 s" apply(cut_tac a1 a2 b1 , auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_GetX_Nak1VsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_GetX_Nak1 iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P1 s" apply(cut_tac a1 a2 b1 , auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_GetX_Nak2VsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_GetX_Nak2 iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P1 s" apply(cut_tac a1 a2 b1 , auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_GetX_Nak3VsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_GetX_Nak3 iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P1 s" apply(cut_tac a1 a2 b1 , auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_GetX_PutX1VsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_GetX_PutX1 N iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P3 s" apply( cut_tac a1 a2 b1 , simp) apply(rule_tac x=" (neg ( andForm ( eqn ( IVar ( Global ''ShWbMsg_Cmd'') ) ( Const SHWB_ShWb )) ( eqn ( IVar ( Global ''Dir_Pending'') ) ( Const false )) ) ) " in exI,auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_GetX_PutX2VsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_GetX_PutX2 N iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P3 s" apply( cut_tac a1 a2 b1 , simp) apply(rule_tac x=" (neg ( andForm ( eqn ( IVar ( Global ''ShWbMsg_Cmd'') ) ( Const SHWB_ShWb )) ( eqn ( IVar ( Global ''Dir_Pending'') ) ( Const false )) ) ) " in exI,auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_GetX_PutX3VsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_GetX_PutX3 N iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P3 s" apply( cut_tac a1 a2 b1 , simp) apply(rule_tac x=" (neg ( andForm ( eqn ( IVar ( Global ''ShWbMsg_Cmd'') ) ( Const SHWB_ShWb )) ( eqn ( IVar ( Global ''Dir_Pending'') ) ( Const false )) ) ) " in exI,auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_GetX_PutX4VsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_GetX_PutX4 N iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P3 s" apply( cut_tac a1 a2 b1 , simp) apply(rule_tac x=" (neg ( andForm ( eqn ( IVar ( Global ''ShWbMsg_Cmd'') ) ( Const SHWB_ShWb )) ( eqn ( IVar ( Global ''Dir_Pending'') ) ( Const false )) ) ) " in exI,auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_GetX_PutX5VsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_GetX_PutX5 N iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P3 s" apply( cut_tac a1 a2 b1 , simp) apply(rule_tac x=" (neg ( andForm ( eqn ( IVar ( Global ''ShWbMsg_Cmd'') ) ( Const SHWB_ShWb )) ( eqn ( IVar ( Global ''Dir_Pending'') ) ( Const false )) ) ) " in exI,auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_GetX_PutX6VsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_GetX_PutX6 N iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P3 s" apply( cut_tac a1 a2 b1 , simp) apply(rule_tac x=" (neg ( andForm ( eqn ( IVar ( Global ''ShWbMsg_Cmd'') ) ( Const SHWB_ShWb )) ( eqn ( IVar ( Global ''Dir_Pending'') ) ( Const false )) ) ) " in exI,auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_GetX_PutX7VsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_GetX_PutX7 N iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P3 s" apply( cut_tac a1 a2 b1 , simp) apply(rule_tac x=" (neg ( andForm ( eqn ( IVar ( Global ''ShWbMsg_Cmd'') ) ( Const SHWB_ShWb )) ( eqn ( IVar ( Global ''Dir_Pending'') ) ( Const false )) ) ) " in exI,auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_GetX_PutX8VsInv61: (*Rule2VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iRule2 \<le> N" and a3:"iInv1 \<le> N" and a4:"iRule1~=iRule2 " shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_GetX_PutX8 N iRule1 iRule2 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1\<and>(iRule2~=iInv1 )) \<or>((iRule1~=iInv1 )\<and>iRule2=iInv1) \<or>((iRule1~=iInv1 )\<and>(iRule2~=iInv1 )) " by( cut_tac a1 a2 a3 a4 , auto) moreover {assume b1:"(iRule1=iInv1\<and>(iRule2~=iInv1 ))" have "?P3 s" apply( cut_tac a1 a2 a3 a4 b1 , simp) apply(rule_tac x=" (neg ( andForm ( eqn ( IVar ( Global ''ShWbMsg_Cmd'') ) ( Const SHWB_ShWb )) ( eqn ( IVar ( Global ''Dir_Pending'') ) ( Const false )) ) ) " in exI,auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 )\<and>iRule2=iInv1)" have "?P2 s" apply(cut_tac a1 a2 a3 a4 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 )\<and>(iRule2~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 a3 a4 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_GetX_PutX8_homeVsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_GetX_PutX8_home N iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P3 s" apply( cut_tac a1 a2 b1 , simp) apply(rule_tac x=" (neg ( andForm ( eqn ( IVar ( Global ''ShWbMsg_Cmd'') ) ( Const SHWB_ShWb )) ( eqn ( IVar ( Global ''Dir_Pending'') ) ( Const false )) ) ) " in exI,auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_GetX_PutX9VsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_GetX_PutX9 N iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P3 s" apply( cut_tac a1 a2 b1 , simp) apply(rule_tac x=" (neg ( andForm ( eqn ( IVar ( Global ''ShWbMsg_Cmd'') ) ( Const SHWB_ShWb )) ( eqn ( IVar ( Global ''Dir_Pending'') ) ( Const false )) ) ) " in exI,auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_GetX_PutX10VsInv61: (*Rule2VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iRule2 \<le> N" and a3:"iInv1 \<le> N" and a4:"iRule1~=iRule2 " shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_GetX_PutX10 N iRule1 iRule2 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1\<and>(iRule2~=iInv1 )) \<or>((iRule1~=iInv1 )\<and>iRule2=iInv1) \<or>((iRule1~=iInv1 )\<and>(iRule2~=iInv1 )) " by( cut_tac a1 a2 a3 a4 , auto) moreover {assume b1:"(iRule1=iInv1\<and>(iRule2~=iInv1 ))" have "?P3 s" apply( cut_tac a1 a2 a3 a4 b1 , simp) apply(rule_tac x=" (neg ( andForm ( eqn ( IVar ( Global ''ShWbMsg_Cmd'') ) ( Const SHWB_ShWb )) ( eqn ( IVar ( Global ''Dir_Pending'') ) ( Const false )) ) ) " in exI,auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 )\<and>iRule2=iInv1)" have "?P2 s" apply(cut_tac a1 a2 a3 a4 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 )\<and>(iRule2~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 a3 a4 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_GetX_PutX10_homeVsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_GetX_PutX10_home N iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P3 s" apply( cut_tac a1 a2 b1 , simp) apply(rule_tac x=" (neg ( andForm ( eqn ( IVar ( Global ''ShWbMsg_Cmd'') ) ( Const SHWB_ShWb )) ( eqn ( IVar ( Global ''Dir_Pending'') ) ( Const false )) ) ) " in exI,auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_GetX_PutX11VsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_GetX_PutX11 N iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P3 s" apply( cut_tac a1 a2 b1 , simp) apply(rule_tac x=" (neg ( andForm ( eqn ( IVar ( Global ''ShWbMsg_Cmd'') ) ( Const SHWB_ShWb )) ( eqn ( IVar ( Global ''Dir_Pending'') ) ( Const false )) ) ) " in exI,auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_Get_GetVsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_Get_Get iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 a2 , auto) lemma NI_Local_Get_Nak1VsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_Get_Nak1 iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P1 s" apply(cut_tac a1 a2 b1 , auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_Get_Nak2VsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_Get_Nak2 iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P1 s" apply(cut_tac a1 a2 b1 , auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_Get_Nak3VsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_Get_Nak3 iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P1 s" apply(cut_tac a1 a2 b1 , auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_Get_Put1VsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_Get_Put1 N iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P1 s" apply(cut_tac a1 a2 b1 , auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_Get_Put2VsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_Get_Put2 iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P1 s" apply(cut_tac a1 a2 b1 , auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_Get_Put3VsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_Get_Put3 iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P1 s" apply(cut_tac a1 a2 b1 , auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Local_PutVsInv61: (*Rule0VsPInv1*) assumes a1:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_Put ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 , auto) lemma NI_Local_PutXAcksDoneVsInv61: (*Rule0VsPInv1*) assumes a1:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Local_PutXAcksDone ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 , auto) lemma NI_NakVsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Nak iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P1 s" apply(cut_tac a1 a2 b1 , auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Nak_ClearVsInv61: (*Rule0VsPInv1*) assumes a1:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Nak_Clear ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 , auto) lemma NI_Nak_HomeVsInv61: (*Rule0VsPInv1*) assumes a1:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Nak_Home ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 , auto) lemma NI_Remote_GetX_NakVsInv61: (*Rule2VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iRule2 \<le> N" and a3:"iInv1 \<le> N" and a4:"iRule1~=iRule2 " shows "invHoldForRule' s (inv61 iInv1 ) (NI_Remote_GetX_Nak iRule1 iRule2 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1\<and>(iRule2~=iInv1 )) \<or>((iRule1~=iInv1 )\<and>iRule2=iInv1) \<or>((iRule1~=iInv1 )\<and>(iRule2~=iInv1 )) " by( cut_tac a1 a2 a3 a4 , auto) moreover {assume b1:"(iRule1=iInv1\<and>(iRule2~=iInv1 ))" have "?P1 s" apply(cut_tac a1 a2 a3 a4 b1 , auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 )\<and>iRule2=iInv1)" have "?P2 s" apply(cut_tac a1 a2 a3 a4 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 )\<and>(iRule2~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 a3 a4 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Remote_GetX_Nak_HomeVsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Remote_GetX_Nak_Home iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 a2 , auto) lemma NI_Remote_GetX_PutXVsInv61: (*Rule2VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iRule2 \<le> N" and a3:"iInv1 \<le> N" and a4:"iRule1~=iRule2 " shows "invHoldForRule' s (inv61 iInv1 ) (NI_Remote_GetX_PutX iRule1 iRule2 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1\<and>(iRule2~=iInv1 )) \<or>((iRule1~=iInv1 )\<and>iRule2=iInv1) \<or>((iRule1~=iInv1 )\<and>(iRule2~=iInv1 )) " by( cut_tac a1 a2 a3 a4 , auto) moreover {assume b1:"(iRule1=iInv1\<and>(iRule2~=iInv1 ))" have "?P1 s" apply(cut_tac a1 a2 a3 a4 b1 , auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 )\<and>iRule2=iInv1)" have "?P1 s" apply(cut_tac a1 a2 a3 a4 b1 , auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 )\<and>(iRule2~=iInv1 ))" have "?P1 s" apply(cut_tac a1 a2 a3 a4 b1 , auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Remote_GetX_PutX_HomeVsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Remote_GetX_PutX_Home iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 a2 , auto) lemma NI_Remote_Get_Nak1VsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Remote_Get_Nak1 iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 a2 , auto) lemma NI_Remote_Get_Nak2VsInv61: (*Rule2VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iRule2 \<le> N" and a3:"iInv1 \<le> N" and a4:"iRule1~=iRule2 " shows "invHoldForRule' s (inv61 iInv1 ) (NI_Remote_Get_Nak2 iRule1 iRule2 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1\<and>(iRule2~=iInv1 )) \<or>((iRule1~=iInv1 )\<and>iRule2=iInv1) \<or>((iRule1~=iInv1 )\<and>(iRule2~=iInv1 )) " by( cut_tac a1 a2 a3 a4 , auto) moreover {assume b1:"(iRule1=iInv1\<and>(iRule2~=iInv1 ))" have "?P1 s" apply(cut_tac a1 a2 a3 a4 b1 , auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 )\<and>iRule2=iInv1)" have "?P2 s" apply(cut_tac a1 a2 a3 a4 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 )\<and>(iRule2~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 a3 a4 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Remote_Get_Put1VsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Remote_Get_Put1 iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 a2 , auto) lemma NI_Remote_Get_Put2VsInv61: (*Rule2VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iRule2 \<le> N" and a3:"iInv1 \<le> N" and a4:"iRule1~=iRule2 " shows "invHoldForRule' s (inv61 iInv1 ) (NI_Remote_Get_Put2 iRule1 iRule2 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1\<and>(iRule2~=iInv1 )) \<or>((iRule1~=iInv1 )\<and>iRule2=iInv1) \<or>((iRule1~=iInv1 )\<and>(iRule2~=iInv1 )) " by( cut_tac a1 a2 a3 a4 , auto) moreover {assume b1:"(iRule1=iInv1\<and>(iRule2~=iInv1 ))" have "?P1 s" apply(cut_tac a1 a2 a3 a4 b1 , auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 )\<and>iRule2=iInv1)" have "?P3 s" apply( cut_tac a1 a2 a3 a4 b1 , simp) apply(rule_tac x=" (neg ( andForm ( eqn ( IVar ( Para ''UniMsg_Cmd'' iInv1) ) ( Const UNI_PutX )) ( eqn ( IVar ( Para ''CacheState'' iInv1) ) ( Const CACHE_E )) ) ) " in exI,auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 )\<and>(iRule2~=iInv1 ))" have "?P3 s" apply( cut_tac a1 a2 a3 a4 b1 , simp) apply(rule_tac x=" (neg ( andForm ( eqn ( IVar ( Para ''CacheState'' iRule2) ) ( Const CACHE_E )) ( eqn ( IVar ( Para ''UniMsg_Cmd'' iInv1) ) ( Const UNI_PutX )) ) ) " in exI,auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Remote_PutVsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Remote_Put iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P1 s" apply(cut_tac a1 a2 b1 , auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_Remote_PutXVsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Remote_PutX iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P1 s" apply(cut_tac a1 a2 b1 , auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma NI_ReplaceVsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Replace iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 a2 , auto) lemma NI_ReplaceHomeVsInv61: (*Rule0VsPInv1*) assumes a1:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_ReplaceHome ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 , auto) lemma NI_ReplaceHomeShrVldVsInv61: (*Rule0VsPInv1*) assumes a1:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_ReplaceHomeShrVld ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 , auto) lemma NI_ReplaceShrVldVsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_ReplaceShrVld iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 a2 , auto) lemma NI_ShWbVsInv61: (*Rule0VsPInv1*) assumes a1:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_ShWb N ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have "?P1 s" apply(cut_tac a1 , auto) done then show "?P1 s\<or> ?P2 s\<or> ?P3 s" by blast qed lemma NI_WbVsInv61: (*Rule0VsPInv1*) assumes a1:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (NI_Wb ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 , auto) lemma PI_Local_GetX_GetX1VsInv61: (*Rule0VsPInv1*) assumes a1:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (PI_Local_GetX_GetX1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 , auto) lemma PI_Local_GetX_GetX2VsInv61: (*Rule0VsPInv1*) assumes a1:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (PI_Local_GetX_GetX2 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 , auto) lemma PI_Local_GetX_PutX1VsInv61: (*Rule0VsPInv1*) assumes a1:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (PI_Local_GetX_PutX1 N ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 , auto) lemma PI_Local_GetX_PutX2VsInv61: (*Rule0VsPInv1*) assumes a1:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (PI_Local_GetX_PutX2 N ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 , auto) lemma PI_Local_GetX_PutX3VsInv61: (*Rule0VsPInv1*) assumes a1:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (PI_Local_GetX_PutX3 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 , auto) lemma PI_Local_GetX_PutX4VsInv61: (*Rule0VsPInv1*) assumes a1:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (PI_Local_GetX_PutX4 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 , auto) lemma PI_Local_Get_GetVsInv61: (*Rule0VsPInv1*) assumes a1:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (PI_Local_Get_Get ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 , auto) lemma PI_Local_Get_PutVsInv61: (*Rule0VsPInv1*) assumes a1:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (PI_Local_Get_Put ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 , auto) lemma PI_Local_PutXVsInv61: (*Rule0VsPInv1*) assumes a1:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (PI_Local_PutX ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 , auto) lemma PI_Local_ReplaceVsInv61: (*Rule0VsPInv1*) assumes a1:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (PI_Local_Replace ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 , auto) lemma PI_Remote_GetVsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (PI_Remote_Get iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P1 s" apply(cut_tac a1 a2 b1 , auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma PI_Remote_GetXVsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (PI_Remote_GetX iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") proof - have allCases:"(iRule1=iInv1) \<or>((iRule1~=iInv1 )) " by( cut_tac a1 a2 , auto) moreover {assume b1:"(iRule1=iInv1)" have "?P1 s" apply(cut_tac a1 a2 b1 , auto) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } moreover {assume b1:"((iRule1~=iInv1 ))" have "?P2 s" apply(cut_tac a1 a2 b1 , auto intro!:forallVars1 simp add :invHoldForRule2'_def varsOfVar_def) done then have "?P1 s\<or> ?P2 s \<or> ?P3 s" by blast } ultimately show "?P1 s\<or> ?P2 s\<or> ?P3 s" by metis qed lemma PI_Remote_PutXVsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (PI_Remote_PutX iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 a2 , auto) lemma PI_Remote_ReplaceVsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (PI_Remote_Replace iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 a2 , auto) lemma StoreVsInv61: (*Rule1VsPInv1*) assumes a1:"iRule1 \<le> N" and a2:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (Store iRule1 ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 a2 , auto) lemma StoreHomeVsInv61: (*Rule0VsPInv1*) assumes a1:"iInv1 \<le> N" shows "invHoldForRule' s (inv61 iInv1 ) (StoreHome ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by (cut_tac a1 , auto) end
If $f$ is a Bochner integrable function on a measurable space $M$, then $f$ is also Bochner integrable on the restriction of $M$ to any measurable subset $\Omega$.
(* Title: HOL/Probability/Binary_Product_Measure.thy Author: Johannes Hölzl, TU München *) section {*Binary product measures*} theory Binary_Product_Measure imports Nonnegative_Lebesgue_Integration begin lemma Pair_vimage_times[simp]: "Pair x -` (A \<times> B) = (if x \<in> A then B else {})" by auto lemma rev_Pair_vimage_times[simp]: "(\<lambda>x. (x, y)) -` (A \<times> B) = (if y \<in> B then A else {})" by auto subsection "Binary products" definition pair_measure (infixr "\<Otimes>\<^sub>M" 80) where "A \<Otimes>\<^sub>M B = measure_of (space A \<times> space B) {a \<times> b | a b. a \<in> sets A \<and> b \<in> sets B} (\<lambda>X. \<integral>\<^sup>+x. (\<integral>\<^sup>+y. indicator X (x,y) \<partial>B) \<partial>A)" lemma pair_measure_closed: "{a \<times> b | a b. a \<in> sets A \<and> b \<in> sets B} \<subseteq> Pow (space A \<times> space B)" using sets.space_closed[of A] sets.space_closed[of B] by auto lemma space_pair_measure: "space (A \<Otimes>\<^sub>M B) = space A \<times> space B" unfolding pair_measure_def using pair_measure_closed[of A B] by (rule space_measure_of) lemma SIGMA_Collect_eq: "(SIGMA x:space M. {y\<in>space N. P x y}) = {x\<in>space (M \<Otimes>\<^sub>M N). P (fst x) (snd x)}" by (auto simp: space_pair_measure) lemma sets_pair_measure: "sets (A \<Otimes>\<^sub>M B) = sigma_sets (space A \<times> space B) {a \<times> b | a b. a \<in> sets A \<and> b \<in> sets B}" unfolding pair_measure_def using pair_measure_closed[of A B] by (rule sets_measure_of) lemma sets_pair_in_sets: assumes N: "space A \<times> space B = space N" assumes "\<And>a b. a \<in> sets A \<Longrightarrow> b \<in> sets B \<Longrightarrow> a \<times> b \<in> sets N" shows "sets (A \<Otimes>\<^sub>M B) \<subseteq> sets N" using assms by (auto intro!: sets.sigma_sets_subset simp: sets_pair_measure N) lemma sets_pair_measure_cong[measurable_cong, cong]: "sets M1 = sets M1' \<Longrightarrow> sets M2 = sets M2' \<Longrightarrow> sets (M1 \<Otimes>\<^sub>M M2) = sets (M1' \<Otimes>\<^sub>M M2')" unfolding sets_pair_measure by (simp cong: sets_eq_imp_space_eq) lemma pair_measureI[intro, simp, measurable]: "x \<in> sets A \<Longrightarrow> y \<in> sets B \<Longrightarrow> x \<times> y \<in> sets (A \<Otimes>\<^sub>M B)" by (auto simp: sets_pair_measure) lemma sets_Pair: "{x} \<in> sets M1 \<Longrightarrow> {y} \<in> sets M2 \<Longrightarrow> {(x, y)} \<in> sets (M1 \<Otimes>\<^sub>M M2)" using pair_measureI[of "{x}" M1 "{y}" M2] by simp lemma measurable_pair_measureI: assumes 1: "f \<in> space M \<rightarrow> space M1 \<times> space M2" assumes 2: "\<And>A B. A \<in> sets M1 \<Longrightarrow> B \<in> sets M2 \<Longrightarrow> f -` (A \<times> B) \<inter> space M \<in> sets M" shows "f \<in> measurable M (M1 \<Otimes>\<^sub>M M2)" unfolding pair_measure_def using 1 2 by (intro measurable_measure_of) (auto dest: sets.sets_into_space) lemma measurable_split_replace[measurable (raw)]: "(\<lambda>x. f x (fst (g x)) (snd (g x))) \<in> measurable M N \<Longrightarrow> (\<lambda>x. split (f x) (g x)) \<in> measurable M N" unfolding split_beta' . lemma measurable_Pair[measurable (raw)]: assumes f: "f \<in> measurable M M1" and g: "g \<in> measurable M M2" shows "(\<lambda>x. (f x, g x)) \<in> measurable M (M1 \<Otimes>\<^sub>M M2)" proof (rule measurable_pair_measureI) show "(\<lambda>x. (f x, g x)) \<in> space M \<rightarrow> space M1 \<times> space M2" using f g by (auto simp: measurable_def) fix A B assume *: "A \<in> sets M1" "B \<in> sets M2" have "(\<lambda>x. (f x, g x)) -` (A \<times> B) \<inter> space M = (f -` A \<inter> space M) \<inter> (g -` B \<inter> space M)" by auto also have "\<dots> \<in> sets M" by (rule sets.Int) (auto intro!: measurable_sets * f g) finally show "(\<lambda>x. (f x, g x)) -` (A \<times> B) \<inter> space M \<in> sets M" . qed lemma measurable_Pair_compose_split[measurable_dest]: assumes f: "split f \<in> measurable (M1 \<Otimes>\<^sub>M M2) N" assumes g: "g \<in> measurable M M1" and h: "h \<in> measurable M M2" shows "(\<lambda>x. f (g x) (h x)) \<in> measurable M N" using measurable_compose[OF measurable_Pair f, OF g h] by simp lemma measurable_pair: assumes "(fst \<circ> f) \<in> measurable M M1" "(snd \<circ> f) \<in> measurable M M2" shows "f \<in> measurable M (M1 \<Otimes>\<^sub>M M2)" using measurable_Pair[OF assms] by simp lemma measurable_fst[intro!, simp, measurable]: "fst \<in> measurable (M1 \<Otimes>\<^sub>M M2) M1" by (auto simp: fst_vimage_eq_Times space_pair_measure sets.sets_into_space times_Int_times measurable_def) lemma measurable_snd[intro!, simp, measurable]: "snd \<in> measurable (M1 \<Otimes>\<^sub>M M2) M2" by (auto simp: snd_vimage_eq_Times space_pair_measure sets.sets_into_space times_Int_times measurable_def) lemma assumes f[measurable]: "f \<in> measurable M (N \<Otimes>\<^sub>M P)" shows measurable_fst': "(\<lambda>x. fst (f x)) \<in> measurable M N" and measurable_snd': "(\<lambda>x. snd (f x)) \<in> measurable M P" by simp_all lemma assumes f[measurable]: "f \<in> measurable M N" shows measurable_fst'': "(\<lambda>x. f (fst x)) \<in> measurable (M \<Otimes>\<^sub>M P) N" and measurable_snd'': "(\<lambda>x. f (snd x)) \<in> measurable (P \<Otimes>\<^sub>M M) N" by simp_all lemma sets_pair_eq_sets_fst_snd: "sets (A \<Otimes>\<^sub>M B) = sets (Sup_sigma {vimage_algebra (space A \<times> space B) fst A, vimage_algebra (space A \<times> space B) snd B})" (is "?P = sets (Sup_sigma {?fst, ?snd})") proof - { fix a b assume ab: "a \<in> sets A" "b \<in> sets B" then have "a \<times> b = (fst -` a \<inter> (space A \<times> space B)) \<inter> (snd -` b \<inter> (space A \<times> space B))" by (auto dest: sets.sets_into_space) also have "\<dots> \<in> sets (Sup_sigma {?fst, ?snd})" using ab by (auto intro: in_Sup_sigma in_vimage_algebra) finally have "a \<times> b \<in> sets (Sup_sigma {?fst, ?snd})" . } moreover have "sets ?fst \<subseteq> sets (A \<Otimes>\<^sub>M B)" by (rule sets_image_in_sets) (auto simp: space_pair_measure[symmetric]) moreover have "sets ?snd \<subseteq> sets (A \<Otimes>\<^sub>M B)" by (rule sets_image_in_sets) (auto simp: space_pair_measure) ultimately show ?thesis by (intro antisym[of "sets A" for A] sets_Sup_in_sets sets_pair_in_sets ) (auto simp add: space_Sup_sigma space_pair_measure) qed lemma measurable_pair_iff: "f \<in> measurable M (M1 \<Otimes>\<^sub>M M2) \<longleftrightarrow> (fst \<circ> f) \<in> measurable M M1 \<and> (snd \<circ> f) \<in> measurable M M2" by (auto intro: measurable_pair[of f M M1 M2]) lemma measurable_split_conv: "(\<lambda>(x, y). f x y) \<in> measurable A B \<longleftrightarrow> (\<lambda>x. f (fst x) (snd x)) \<in> measurable A B" by (intro arg_cong2[where f="op \<in>"]) auto lemma measurable_pair_swap': "(\<lambda>(x,y). (y, x)) \<in> measurable (M1 \<Otimes>\<^sub>M M2) (M2 \<Otimes>\<^sub>M M1)" by (auto intro!: measurable_Pair simp: measurable_split_conv) lemma measurable_pair_swap: assumes f: "f \<in> measurable (M1 \<Otimes>\<^sub>M M2) M" shows "(\<lambda>(x,y). f (y, x)) \<in> measurable (M2 \<Otimes>\<^sub>M M1) M" using measurable_comp[OF measurable_Pair f] by (auto simp: measurable_split_conv comp_def) lemma measurable_pair_swap_iff: "f \<in> measurable (M2 \<Otimes>\<^sub>M M1) M \<longleftrightarrow> (\<lambda>(x,y). f (y,x)) \<in> measurable (M1 \<Otimes>\<^sub>M M2) M" by (auto dest: measurable_pair_swap) lemma measurable_Pair1': "x \<in> space M1 \<Longrightarrow> Pair x \<in> measurable M2 (M1 \<Otimes>\<^sub>M M2)" by simp lemma sets_Pair1[measurable (raw)]: assumes A: "A \<in> sets (M1 \<Otimes>\<^sub>M M2)" shows "Pair x -` A \<in> sets M2" proof - have "Pair x -` A = (if x \<in> space M1 then Pair x -` A \<inter> space M2 else {})" using A[THEN sets.sets_into_space] by (auto simp: space_pair_measure) also have "\<dots> \<in> sets M2" using A by (auto simp add: measurable_Pair1' intro!: measurable_sets split: split_if_asm) finally show ?thesis . qed lemma measurable_Pair2': "y \<in> space M2 \<Longrightarrow> (\<lambda>x. (x, y)) \<in> measurable M1 (M1 \<Otimes>\<^sub>M M2)" by (auto intro!: measurable_Pair) lemma sets_Pair2: assumes A: "A \<in> sets (M1 \<Otimes>\<^sub>M M2)" shows "(\<lambda>x. (x, y)) -` A \<in> sets M1" proof - have "(\<lambda>x. (x, y)) -` A = (if y \<in> space M2 then (\<lambda>x. (x, y)) -` A \<inter> space M1 else {})" using A[THEN sets.sets_into_space] by (auto simp: space_pair_measure) also have "\<dots> \<in> sets M1" using A by (auto simp add: measurable_Pair2' intro!: measurable_sets split: split_if_asm) finally show ?thesis . qed lemma measurable_Pair2: assumes f: "f \<in> measurable (M1 \<Otimes>\<^sub>M M2) M" and x: "x \<in> space M1" shows "(\<lambda>y. f (x, y)) \<in> measurable M2 M" using measurable_comp[OF measurable_Pair1' f, OF x] by (simp add: comp_def) lemma measurable_Pair1: assumes f: "f \<in> measurable (M1 \<Otimes>\<^sub>M M2) M" and y: "y \<in> space M2" shows "(\<lambda>x. f (x, y)) \<in> measurable M1 M" using measurable_comp[OF measurable_Pair2' f, OF y] by (simp add: comp_def) lemma Int_stable_pair_measure_generator: "Int_stable {a \<times> b | a b. a \<in> sets A \<and> b \<in> sets B}" unfolding Int_stable_def by safe (auto simp add: times_Int_times) lemma disjoint_family_vimageI: "disjoint_family F \<Longrightarrow> disjoint_family (\<lambda>i. f -` F i)" by (auto simp: disjoint_family_on_def) lemma (in finite_measure) finite_measure_cut_measurable: assumes [measurable]: "Q \<in> sets (N \<Otimes>\<^sub>M M)" shows "(\<lambda>x. emeasure M (Pair x -` Q)) \<in> borel_measurable N" (is "?s Q \<in> _") using Int_stable_pair_measure_generator pair_measure_closed assms unfolding sets_pair_measure proof (induct rule: sigma_sets_induct_disjoint) case (compl A) with sets.sets_into_space have "\<And>x. emeasure M (Pair x -` ((space N \<times> space M) - A)) = (if x \<in> space N then emeasure M (space M) - ?s A x else 0)" unfolding sets_pair_measure[symmetric] by (auto intro!: emeasure_compl simp: vimage_Diff sets_Pair1) with compl sets.top show ?case by (auto intro!: measurable_If simp: space_pair_measure) next case (union F) then have "\<And>x. emeasure M (Pair x -` (\<Union>i. F i)) = (\<Sum>i. ?s (F i) x)" by (simp add: suminf_emeasure disjoint_family_vimageI subset_eq vimage_UN sets_pair_measure[symmetric]) with union show ?case unfolding sets_pair_measure[symmetric] by simp qed (auto simp add: if_distrib Int_def[symmetric] intro!: measurable_If) lemma (in sigma_finite_measure) measurable_emeasure_Pair: assumes Q: "Q \<in> sets (N \<Otimes>\<^sub>M M)" shows "(\<lambda>x. emeasure M (Pair x -` Q)) \<in> borel_measurable N" (is "?s Q \<in> _") proof - from sigma_finite_disjoint guess F . note F = this then have F_sets: "\<And>i. F i \<in> sets M" by auto let ?C = "\<lambda>x i. F i \<inter> Pair x -` Q" { fix i have [simp]: "space N \<times> F i \<inter> space N \<times> space M = space N \<times> F i" using F sets.sets_into_space by auto let ?R = "density M (indicator (F i))" have "finite_measure ?R" using F by (intro finite_measureI) (auto simp: emeasure_restricted subset_eq) then have "(\<lambda>x. emeasure ?R (Pair x -` (space N \<times> space ?R \<inter> Q))) \<in> borel_measurable N" by (rule finite_measure.finite_measure_cut_measurable) (auto intro: Q) moreover have "\<And>x. emeasure ?R (Pair x -` (space N \<times> space ?R \<inter> Q)) = emeasure M (F i \<inter> Pair x -` (space N \<times> space ?R \<inter> Q))" using Q F_sets by (intro emeasure_restricted) (auto intro: sets_Pair1) moreover have "\<And>x. F i \<inter> Pair x -` (space N \<times> space ?R \<inter> Q) = ?C x i" using sets.sets_into_space[OF Q] by (auto simp: space_pair_measure) ultimately have "(\<lambda>x. emeasure M (?C x i)) \<in> borel_measurable N" by simp } moreover { fix x have "(\<Sum>i. emeasure M (?C x i)) = emeasure M (\<Union>i. ?C x i)" proof (intro suminf_emeasure) show "range (?C x) \<subseteq> sets M" using F `Q \<in> sets (N \<Otimes>\<^sub>M M)` by (auto intro!: sets_Pair1) have "disjoint_family F" using F by auto show "disjoint_family (?C x)" by (rule disjoint_family_on_bisimulation[OF `disjoint_family F`]) auto qed also have "(\<Union>i. ?C x i) = Pair x -` Q" using F sets.sets_into_space[OF `Q \<in> sets (N \<Otimes>\<^sub>M M)`] by (auto simp: space_pair_measure) finally have "emeasure M (Pair x -` Q) = (\<Sum>i. emeasure M (?C x i))" by simp } ultimately show ?thesis using `Q \<in> sets (N \<Otimes>\<^sub>M M)` F_sets by auto qed lemma (in sigma_finite_measure) measurable_emeasure[measurable (raw)]: assumes space: "\<And>x. x \<in> space N \<Longrightarrow> A x \<subseteq> space M" assumes A: "{x\<in>space (N \<Otimes>\<^sub>M M). snd x \<in> A (fst x)} \<in> sets (N \<Otimes>\<^sub>M M)" shows "(\<lambda>x. emeasure M (A x)) \<in> borel_measurable N" proof - from space have "\<And>x. x \<in> space N \<Longrightarrow> Pair x -` {x \<in> space (N \<Otimes>\<^sub>M M). snd x \<in> A (fst x)} = A x" by (auto simp: space_pair_measure) with measurable_emeasure_Pair[OF A] show ?thesis by (auto cong: measurable_cong) qed lemma (in sigma_finite_measure) emeasure_pair_measure: assumes "X \<in> sets (N \<Otimes>\<^sub>M M)" shows "emeasure (N \<Otimes>\<^sub>M M) X = (\<integral>\<^sup>+ x. \<integral>\<^sup>+ y. indicator X (x, y) \<partial>M \<partial>N)" (is "_ = ?\<mu> X") proof (rule emeasure_measure_of[OF pair_measure_def]) show "positive (sets (N \<Otimes>\<^sub>M M)) ?\<mu>" by (auto simp: positive_def nn_integral_nonneg) have eq[simp]: "\<And>A x y. indicator A (x, y) = indicator (Pair x -` A) y" by (auto simp: indicator_def) show "countably_additive (sets (N \<Otimes>\<^sub>M M)) ?\<mu>" proof (rule countably_additiveI) fix F :: "nat \<Rightarrow> ('b \<times> 'a) set" assume F: "range F \<subseteq> sets (N \<Otimes>\<^sub>M M)" "disjoint_family F" from F have *: "\<And>i. F i \<in> sets (N \<Otimes>\<^sub>M M)" "(\<Union>i. F i) \<in> sets (N \<Otimes>\<^sub>M M)" by auto moreover from F have "\<And>i. (\<lambda>x. emeasure M (Pair x -` F i)) \<in> borel_measurable N" by (intro measurable_emeasure_Pair) auto moreover have "\<And>x. disjoint_family (\<lambda>i. Pair x -` F i)" by (intro disjoint_family_on_bisimulation[OF F(2)]) auto moreover have "\<And>x. range (\<lambda>i. Pair x -` F i) \<subseteq> sets M" using F by (auto simp: sets_Pair1) ultimately show "(\<Sum>n. ?\<mu> (F n)) = ?\<mu> (\<Union>i. F i)" by (auto simp add: vimage_UN nn_integral_suminf[symmetric] suminf_emeasure subset_eq emeasure_nonneg sets_Pair1 intro!: nn_integral_cong nn_integral_indicator[symmetric]) qed show "{a \<times> b |a b. a \<in> sets N \<and> b \<in> sets M} \<subseteq> Pow (space N \<times> space M)" using sets.space_closed[of N] sets.space_closed[of M] by auto qed fact lemma (in sigma_finite_measure) emeasure_pair_measure_alt: assumes X: "X \<in> sets (N \<Otimes>\<^sub>M M)" shows "emeasure (N \<Otimes>\<^sub>M M) X = (\<integral>\<^sup>+x. emeasure M (Pair x -` X) \<partial>N)" proof - have [simp]: "\<And>x y. indicator X (x, y) = indicator (Pair x -` X) y" by (auto simp: indicator_def) show ?thesis using X by (auto intro!: nn_integral_cong simp: emeasure_pair_measure sets_Pair1) qed lemma (in sigma_finite_measure) emeasure_pair_measure_Times: assumes A: "A \<in> sets N" and B: "B \<in> sets M" shows "emeasure (N \<Otimes>\<^sub>M M) (A \<times> B) = emeasure N A * emeasure M B" proof - have "emeasure (N \<Otimes>\<^sub>M M) (A \<times> B) = (\<integral>\<^sup>+x. emeasure M B * indicator A x \<partial>N)" using A B by (auto intro!: nn_integral_cong simp: emeasure_pair_measure_alt) also have "\<dots> = emeasure M B * emeasure N A" using A by (simp add: emeasure_nonneg nn_integral_cmult_indicator) finally show ?thesis by (simp add: ac_simps) qed subsection {* Binary products of $\sigma$-finite emeasure spaces *} locale pair_sigma_finite = M1: sigma_finite_measure M1 + M2: sigma_finite_measure M2 for M1 :: "'a measure" and M2 :: "'b measure" lemma (in pair_sigma_finite) measurable_emeasure_Pair1: "Q \<in> sets (M1 \<Otimes>\<^sub>M M2) \<Longrightarrow> (\<lambda>x. emeasure M2 (Pair x -` Q)) \<in> borel_measurable M1" using M2.measurable_emeasure_Pair . lemma (in pair_sigma_finite) measurable_emeasure_Pair2: assumes Q: "Q \<in> sets (M1 \<Otimes>\<^sub>M M2)" shows "(\<lambda>y. emeasure M1 ((\<lambda>x. (x, y)) -` Q)) \<in> borel_measurable M2" proof - have "(\<lambda>(x, y). (y, x)) -` Q \<inter> space (M2 \<Otimes>\<^sub>M M1) \<in> sets (M2 \<Otimes>\<^sub>M M1)" using Q measurable_pair_swap' by (auto intro: measurable_sets) note M1.measurable_emeasure_Pair[OF this] moreover have "\<And>y. Pair y -` ((\<lambda>(x, y). (y, x)) -` Q \<inter> space (M2 \<Otimes>\<^sub>M M1)) = (\<lambda>x. (x, y)) -` Q" using Q[THEN sets.sets_into_space] by (auto simp: space_pair_measure) ultimately show ?thesis by simp qed lemma (in pair_sigma_finite) sigma_finite_up_in_pair_measure_generator: defines "E \<equiv> {A \<times> B | A B. A \<in> sets M1 \<and> B \<in> sets M2}" shows "\<exists>F::nat \<Rightarrow> ('a \<times> 'b) set. range F \<subseteq> E \<and> incseq F \<and> (\<Union>i. F i) = space M1 \<times> space M2 \<and> (\<forall>i. emeasure (M1 \<Otimes>\<^sub>M M2) (F i) \<noteq> \<infinity>)" proof - from M1.sigma_finite_incseq guess F1 . note F1 = this from M2.sigma_finite_incseq guess F2 . note F2 = this from F1 F2 have space: "space M1 = (\<Union>i. F1 i)" "space M2 = (\<Union>i. F2 i)" by auto let ?F = "\<lambda>i. F1 i \<times> F2 i" show ?thesis proof (intro exI[of _ ?F] conjI allI) show "range ?F \<subseteq> E" using F1 F2 by (auto simp: E_def) (metis range_subsetD) next have "space M1 \<times> space M2 \<subseteq> (\<Union>i. ?F i)" proof (intro subsetI) fix x assume "x \<in> space M1 \<times> space M2" then obtain i j where "fst x \<in> F1 i" "snd x \<in> F2 j" by (auto simp: space) then have "fst x \<in> F1 (max i j)" "snd x \<in> F2 (max j i)" using `incseq F1` `incseq F2` unfolding incseq_def by (force split: split_max)+ then have "(fst x, snd x) \<in> F1 (max i j) \<times> F2 (max i j)" by (intro SigmaI) (auto simp add: max.commute) then show "x \<in> (\<Union>i. ?F i)" by auto qed then show "(\<Union>i. ?F i) = space M1 \<times> space M2" using space by (auto simp: space) next fix i show "incseq (\<lambda>i. F1 i \<times> F2 i)" using `incseq F1` `incseq F2` unfolding incseq_Suc_iff by auto next fix i from F1 F2 have "F1 i \<in> sets M1" "F2 i \<in> sets M2" by auto with F1 F2 emeasure_nonneg[of M1 "F1 i"] emeasure_nonneg[of M2 "F2 i"] show "emeasure (M1 \<Otimes>\<^sub>M M2) (F1 i \<times> F2 i) \<noteq> \<infinity>" by (auto simp add: emeasure_pair_measure_Times) qed qed sublocale pair_sigma_finite \<subseteq> P: sigma_finite_measure "M1 \<Otimes>\<^sub>M M2" proof from M1.sigma_finite_countable guess F1 .. moreover from M2.sigma_finite_countable guess F2 .. ultimately show "\<exists>A. countable A \<and> A \<subseteq> sets (M1 \<Otimes>\<^sub>M M2) \<and> \<Union>A = space (M1 \<Otimes>\<^sub>M M2) \<and> (\<forall>a\<in>A. emeasure (M1 \<Otimes>\<^sub>M M2) a \<noteq> \<infinity>)" by (intro exI[of _ "(\<lambda>(a, b). a \<times> b) ` (F1 \<times> F2)"] conjI) (auto simp: M2.emeasure_pair_measure_Times space_pair_measure set_eq_iff subset_eq dest: sets.sets_into_space) qed lemma sigma_finite_pair_measure: assumes A: "sigma_finite_measure A" and B: "sigma_finite_measure B" shows "sigma_finite_measure (A \<Otimes>\<^sub>M B)" proof - interpret A: sigma_finite_measure A by fact interpret B: sigma_finite_measure B by fact interpret AB: pair_sigma_finite A B .. show ?thesis .. qed lemma sets_pair_swap: assumes "A \<in> sets (M1 \<Otimes>\<^sub>M M2)" shows "(\<lambda>(x, y). (y, x)) -` A \<inter> space (M2 \<Otimes>\<^sub>M M1) \<in> sets (M2 \<Otimes>\<^sub>M M1)" using measurable_pair_swap' assms by (rule measurable_sets) lemma (in pair_sigma_finite) distr_pair_swap: "M1 \<Otimes>\<^sub>M M2 = distr (M2 \<Otimes>\<^sub>M M1) (M1 \<Otimes>\<^sub>M M2) (\<lambda>(x, y). (y, x))" (is "?P = ?D") proof - from sigma_finite_up_in_pair_measure_generator guess F :: "nat \<Rightarrow> ('a \<times> 'b) set" .. note F = this let ?E = "{a \<times> b |a b. a \<in> sets M1 \<and> b \<in> sets M2}" show ?thesis proof (rule measure_eqI_generator_eq[OF Int_stable_pair_measure_generator[of M1 M2]]) show "?E \<subseteq> Pow (space ?P)" using sets.space_closed[of M1] sets.space_closed[of M2] by (auto simp: space_pair_measure) show "sets ?P = sigma_sets (space ?P) ?E" by (simp add: sets_pair_measure space_pair_measure) then show "sets ?D = sigma_sets (space ?P) ?E" by simp next show "range F \<subseteq> ?E" "(\<Union>i. F i) = space ?P" "\<And>i. emeasure ?P (F i) \<noteq> \<infinity>" using F by (auto simp: space_pair_measure) next fix X assume "X \<in> ?E" then obtain A B where X[simp]: "X = A \<times> B" and A: "A \<in> sets M1" and B: "B \<in> sets M2" by auto have "(\<lambda>(y, x). (x, y)) -` X \<inter> space (M2 \<Otimes>\<^sub>M M1) = B \<times> A" using sets.sets_into_space[OF A] sets.sets_into_space[OF B] by (auto simp: space_pair_measure) with A B show "emeasure (M1 \<Otimes>\<^sub>M M2) X = emeasure ?D X" by (simp add: M2.emeasure_pair_measure_Times M1.emeasure_pair_measure_Times emeasure_distr measurable_pair_swap' ac_simps) qed qed lemma (in pair_sigma_finite) emeasure_pair_measure_alt2: assumes A: "A \<in> sets (M1 \<Otimes>\<^sub>M M2)" shows "emeasure (M1 \<Otimes>\<^sub>M M2) A = (\<integral>\<^sup>+y. emeasure M1 ((\<lambda>x. (x, y)) -` A) \<partial>M2)" (is "_ = ?\<nu> A") proof - have [simp]: "\<And>y. (Pair y -` ((\<lambda>(x, y). (y, x)) -` A \<inter> space (M2 \<Otimes>\<^sub>M M1))) = (\<lambda>x. (x, y)) -` A" using sets.sets_into_space[OF A] by (auto simp: space_pair_measure) show ?thesis using A by (subst distr_pair_swap) (simp_all del: vimage_Int add: measurable_sets[OF measurable_pair_swap'] M1.emeasure_pair_measure_alt emeasure_distr[OF measurable_pair_swap' A]) qed lemma (in pair_sigma_finite) AE_pair: assumes "AE x in (M1 \<Otimes>\<^sub>M M2). Q x" shows "AE x in M1. (AE y in M2. Q (x, y))" proof - obtain N where N: "N \<in> sets (M1 \<Otimes>\<^sub>M M2)" "emeasure (M1 \<Otimes>\<^sub>M M2) N = 0" "{x\<in>space (M1 \<Otimes>\<^sub>M M2). \<not> Q x} \<subseteq> N" using assms unfolding eventually_ae_filter by auto show ?thesis proof (rule AE_I) from N measurable_emeasure_Pair1[OF `N \<in> sets (M1 \<Otimes>\<^sub>M M2)`] show "emeasure M1 {x\<in>space M1. emeasure M2 (Pair x -` N) \<noteq> 0} = 0" by (auto simp: M2.emeasure_pair_measure_alt nn_integral_0_iff emeasure_nonneg) show "{x \<in> space M1. emeasure M2 (Pair x -` N) \<noteq> 0} \<in> sets M1" by (intro borel_measurable_ereal_neq_const measurable_emeasure_Pair1 N) { fix x assume "x \<in> space M1" "emeasure M2 (Pair x -` N) = 0" have "AE y in M2. Q (x, y)" proof (rule AE_I) show "emeasure M2 (Pair x -` N) = 0" by fact show "Pair x -` N \<in> sets M2" using N(1) by (rule sets_Pair1) show "{y \<in> space M2. \<not> Q (x, y)} \<subseteq> Pair x -` N" using N `x \<in> space M1` unfolding space_pair_measure by auto qed } then show "{x \<in> space M1. \<not> (AE y in M2. Q (x, y))} \<subseteq> {x \<in> space M1. emeasure M2 (Pair x -` N) \<noteq> 0}" by auto qed qed lemma (in pair_sigma_finite) AE_pair_measure: assumes "{x\<in>space (M1 \<Otimes>\<^sub>M M2). P x} \<in> sets (M1 \<Otimes>\<^sub>M M2)" assumes ae: "AE x in M1. AE y in M2. P (x, y)" shows "AE x in M1 \<Otimes>\<^sub>M M2. P x" proof (subst AE_iff_measurable[OF _ refl]) show "{x\<in>space (M1 \<Otimes>\<^sub>M M2). \<not> P x} \<in> sets (M1 \<Otimes>\<^sub>M M2)" by (rule sets.sets_Collect) fact then have "emeasure (M1 \<Otimes>\<^sub>M M2) {x \<in> space (M1 \<Otimes>\<^sub>M M2). \<not> P x} = (\<integral>\<^sup>+ x. \<integral>\<^sup>+ y. indicator {x \<in> space (M1 \<Otimes>\<^sub>M M2). \<not> P x} (x, y) \<partial>M2 \<partial>M1)" by (simp add: M2.emeasure_pair_measure) also have "\<dots> = (\<integral>\<^sup>+ x. \<integral>\<^sup>+ y. 0 \<partial>M2 \<partial>M1)" using ae apply (safe intro!: nn_integral_cong_AE) apply (intro AE_I2) apply (safe intro!: nn_integral_cong_AE) apply auto done finally show "emeasure (M1 \<Otimes>\<^sub>M M2) {x \<in> space (M1 \<Otimes>\<^sub>M M2). \<not> P x} = 0" by simp qed lemma (in pair_sigma_finite) AE_pair_iff: "{x\<in>space (M1 \<Otimes>\<^sub>M M2). P (fst x) (snd x)} \<in> sets (M1 \<Otimes>\<^sub>M M2) \<Longrightarrow> (AE x in M1. AE y in M2. P x y) \<longleftrightarrow> (AE x in (M1 \<Otimes>\<^sub>M M2). P (fst x) (snd x))" using AE_pair[of "\<lambda>x. P (fst x) (snd x)"] AE_pair_measure[of "\<lambda>x. P (fst x) (snd x)"] by auto lemma (in pair_sigma_finite) AE_commute: assumes P: "{x\<in>space (M1 \<Otimes>\<^sub>M M2). P (fst x) (snd x)} \<in> sets (M1 \<Otimes>\<^sub>M M2)" shows "(AE x in M1. AE y in M2. P x y) \<longleftrightarrow> (AE y in M2. AE x in M1. P x y)" proof - interpret Q: pair_sigma_finite M2 M1 .. have [simp]: "\<And>x. (fst (case x of (x, y) \<Rightarrow> (y, x))) = snd x" "\<And>x. (snd (case x of (x, y) \<Rightarrow> (y, x))) = fst x" by auto have "{x \<in> space (M2 \<Otimes>\<^sub>M M1). P (snd x) (fst x)} = (\<lambda>(x, y). (y, x)) -` {x \<in> space (M1 \<Otimes>\<^sub>M M2). P (fst x) (snd x)} \<inter> space (M2 \<Otimes>\<^sub>M M1)" by (auto simp: space_pair_measure) also have "\<dots> \<in> sets (M2 \<Otimes>\<^sub>M M1)" by (intro sets_pair_swap P) finally show ?thesis apply (subst AE_pair_iff[OF P]) apply (subst distr_pair_swap) apply (subst AE_distr_iff[OF measurable_pair_swap' P]) apply (subst Q.AE_pair_iff) apply simp_all done qed subsection "Fubinis theorem" lemma measurable_compose_Pair1: "x \<in> space M1 \<Longrightarrow> g \<in> measurable (M1 \<Otimes>\<^sub>M M2) L \<Longrightarrow> (\<lambda>y. g (x, y)) \<in> measurable M2 L" by simp lemma (in sigma_finite_measure) borel_measurable_nn_integral_fst': assumes f: "f \<in> borel_measurable (M1 \<Otimes>\<^sub>M M)" "\<And>x. 0 \<le> f x" shows "(\<lambda>x. \<integral>\<^sup>+ y. f (x, y) \<partial>M) \<in> borel_measurable M1" using f proof induct case (cong u v) then have "\<And>w x. w \<in> space M1 \<Longrightarrow> x \<in> space M \<Longrightarrow> u (w, x) = v (w, x)" by (auto simp: space_pair_measure) show ?case apply (subst measurable_cong) apply (rule nn_integral_cong) apply fact+ done next case (set Q) have [simp]: "\<And>x y. indicator Q (x, y) = indicator (Pair x -` Q) y" by (auto simp: indicator_def) have "\<And>x. x \<in> space M1 \<Longrightarrow> emeasure M (Pair x -` Q) = \<integral>\<^sup>+ y. indicator Q (x, y) \<partial>M" by (simp add: sets_Pair1[OF set]) from this measurable_emeasure_Pair[OF set] show ?case by (rule measurable_cong[THEN iffD1]) qed (simp_all add: nn_integral_add nn_integral_cmult measurable_compose_Pair1 nn_integral_monotone_convergence_SUP incseq_def le_fun_def cong: measurable_cong) lemma (in sigma_finite_measure) nn_integral_fst': assumes f: "f \<in> borel_measurable (M1 \<Otimes>\<^sub>M M)" "\<And>x. 0 \<le> f x" shows "(\<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x, y) \<partial>M \<partial>M1) = integral\<^sup>N (M1 \<Otimes>\<^sub>M M) f" (is "?I f = _") using f proof induct case (cong u v) then have "?I u = ?I v" by (intro nn_integral_cong) (auto simp: space_pair_measure) with cong show ?case by (simp cong: nn_integral_cong) qed (simp_all add: emeasure_pair_measure nn_integral_cmult nn_integral_add nn_integral_monotone_convergence_SUP measurable_compose_Pair1 nn_integral_nonneg borel_measurable_nn_integral_fst' nn_integral_mono incseq_def le_fun_def cong: nn_integral_cong) lemma (in sigma_finite_measure) nn_integral_fst: assumes f: "f \<in> borel_measurable (M1 \<Otimes>\<^sub>M M)" shows "(\<integral>\<^sup>+ x. (\<integral>\<^sup>+ y. f (x, y) \<partial>M) \<partial>M1) = integral\<^sup>N (M1 \<Otimes>\<^sub>M M) f" using f borel_measurable_nn_integral_fst'[of "\<lambda>x. max 0 (f x)"] nn_integral_fst'[of "\<lambda>x. max 0 (f x)"] unfolding nn_integral_max_0 by auto lemma (in sigma_finite_measure) borel_measurable_nn_integral[measurable (raw)]: "split f \<in> borel_measurable (N \<Otimes>\<^sub>M M) \<Longrightarrow> (\<lambda>x. \<integral>\<^sup>+ y. f x y \<partial>M) \<in> borel_measurable N" using borel_measurable_nn_integral_fst'[of "\<lambda>x. max 0 (split f x)" N] by (simp add: nn_integral_max_0) lemma (in pair_sigma_finite) nn_integral_snd: assumes f: "f \<in> borel_measurable (M1 \<Otimes>\<^sub>M M2)" shows "(\<integral>\<^sup>+ y. (\<integral>\<^sup>+ x. f (x, y) \<partial>M1) \<partial>M2) = integral\<^sup>N (M1 \<Otimes>\<^sub>M M2) f" proof - note measurable_pair_swap[OF f] from M1.nn_integral_fst[OF this] have "(\<integral>\<^sup>+ y. (\<integral>\<^sup>+ x. f (x, y) \<partial>M1) \<partial>M2) = (\<integral>\<^sup>+ (x, y). f (y, x) \<partial>(M2 \<Otimes>\<^sub>M M1))" by simp also have "(\<integral>\<^sup>+ (x, y). f (y, x) \<partial>(M2 \<Otimes>\<^sub>M M1)) = integral\<^sup>N (M1 \<Otimes>\<^sub>M M2) f" by (subst distr_pair_swap) (auto simp: nn_integral_distr[OF measurable_pair_swap' f] intro!: nn_integral_cong) finally show ?thesis . qed lemma (in pair_sigma_finite) Fubini: assumes f: "f \<in> borel_measurable (M1 \<Otimes>\<^sub>M M2)" shows "(\<integral>\<^sup>+ y. (\<integral>\<^sup>+ x. f (x, y) \<partial>M1) \<partial>M2) = (\<integral>\<^sup>+ x. (\<integral>\<^sup>+ y. f (x, y) \<partial>M2) \<partial>M1)" unfolding nn_integral_snd[OF assms] M2.nn_integral_fst[OF assms] .. lemma (in pair_sigma_finite) Fubini': assumes f: "split f \<in> borel_measurable (M1 \<Otimes>\<^sub>M M2)" shows "(\<integral>\<^sup>+ y. (\<integral>\<^sup>+ x. f x y \<partial>M1) \<partial>M2) = (\<integral>\<^sup>+ x. (\<integral>\<^sup>+ y. f x y \<partial>M2) \<partial>M1)" using Fubini[OF f] by simp subsection {* Products on counting spaces, densities and distributions *} lemma sigma_prod: assumes X_cover: "\<exists>E\<subseteq>A. countable E \<and> X = \<Union>E" and A: "A \<subseteq> Pow X" assumes Y_cover: "\<exists>E\<subseteq>B. countable E \<and> Y = \<Union>E" and B: "B \<subseteq> Pow Y" shows "sigma X A \<Otimes>\<^sub>M sigma Y B = sigma (X \<times> Y) {a \<times> b | a b. a \<in> A \<and> b \<in> B}" (is "?P = ?S") proof (rule measure_eqI) have [simp]: "snd \<in> X \<times> Y \<rightarrow> Y" "fst \<in> X \<times> Y \<rightarrow> X" by auto let ?XY = "{{fst -` a \<inter> X \<times> Y | a. a \<in> A}, {snd -` b \<inter> X \<times> Y | b. b \<in> B}}" have "sets ?P = sets (\<Squnion>\<^sub>\<sigma> xy\<in>?XY. sigma (X \<times> Y) xy)" by (simp add: vimage_algebra_sigma sets_pair_eq_sets_fst_snd A B) also have "\<dots> = sets (sigma (X \<times> Y) (\<Union>?XY))" by (intro Sup_sigma_sigma arg_cong[where f=sets]) auto also have "\<dots> = sets ?S" proof (intro arg_cong[where f=sets] sigma_eqI sigma_sets_eqI) show "\<Union>?XY \<subseteq> Pow (X \<times> Y)" "{a \<times> b |a b. a \<in> A \<and> b \<in> B} \<subseteq> Pow (X \<times> Y)" using A B by auto next interpret XY: sigma_algebra "X \<times> Y" "sigma_sets (X \<times> Y) {a \<times> b |a b. a \<in> A \<and> b \<in> B}" using A B by (intro sigma_algebra_sigma_sets) auto fix Z assume "Z \<in> \<Union>?XY" then show "Z \<in> sigma_sets (X \<times> Y) {a \<times> b |a b. a \<in> A \<and> b \<in> B}" proof safe fix a assume "a \<in> A" from Y_cover obtain E where E: "E \<subseteq> B" "countable E" and "Y = \<Union>E" by auto with `a \<in> A` A have eq: "fst -` a \<inter> X \<times> Y = (\<Union>e\<in>E. a \<times> e)" by auto show "fst -` a \<inter> X \<times> Y \<in> sigma_sets (X \<times> Y) {a \<times> b |a b. a \<in> A \<and> b \<in> B}" using `a \<in> A` E unfolding eq by (auto intro!: XY.countable_UN') next fix b assume "b \<in> B" from X_cover obtain E where E: "E \<subseteq> A" "countable E" and "X = \<Union>E" by auto with `b \<in> B` B have eq: "snd -` b \<inter> X \<times> Y = (\<Union>e\<in>E. e \<times> b)" by auto show "snd -` b \<inter> X \<times> Y \<in> sigma_sets (X \<times> Y) {a \<times> b |a b. a \<in> A \<and> b \<in> B}" using `b \<in> B` E unfolding eq by (auto intro!: XY.countable_UN') qed next fix Z assume "Z \<in> {a \<times> b |a b. a \<in> A \<and> b \<in> B}" then obtain a b where "Z = a \<times> b" and ab: "a \<in> A" "b \<in> B" by auto then have Z: "Z = (fst -` a \<inter> X \<times> Y) \<inter> (snd -` b \<inter> X \<times> Y)" using A B by auto interpret XY: sigma_algebra "X \<times> Y" "sigma_sets (X \<times> Y) (\<Union>?XY)" by (intro sigma_algebra_sigma_sets) auto show "Z \<in> sigma_sets (X \<times> Y) (\<Union>?XY)" unfolding Z by (rule XY.Int) (blast intro: ab)+ qed finally show "sets ?P = sets ?S" . next interpret finite_measure "sigma X A" for X A proof qed (simp add: emeasure_sigma) fix A assume "A \<in> sets ?P" then show "emeasure ?P A = emeasure ?S A" by (simp add: emeasure_pair_measure_alt emeasure_sigma) qed lemma sigma_sets_pair_measure_generator_finite: assumes "finite A" and "finite B" shows "sigma_sets (A \<times> B) { a \<times> b | a b. a \<subseteq> A \<and> b \<subseteq> B} = Pow (A \<times> B)" (is "sigma_sets ?prod ?sets = _") proof safe have fin: "finite (A \<times> B)" using assms by (rule finite_cartesian_product) fix x assume subset: "x \<subseteq> A \<times> B" hence "finite x" using fin by (rule finite_subset) from this subset show "x \<in> sigma_sets ?prod ?sets" proof (induct x) case empty show ?case by (rule sigma_sets.Empty) next case (insert a x) hence "{a} \<in> sigma_sets ?prod ?sets" by auto moreover have "x \<in> sigma_sets ?prod ?sets" using insert by auto ultimately show ?case unfolding insert_is_Un[of a x] by (rule sigma_sets_Un) qed next fix x a b assume "x \<in> sigma_sets ?prod ?sets" and "(a, b) \<in> x" from sigma_sets_into_sp[OF _ this(1)] this(2) show "a \<in> A" and "b \<in> B" by auto qed lemma borel_prod: "(borel \<Otimes>\<^sub>M borel) = (borel :: ('a::second_countable_topology \<times> 'b::second_countable_topology) measure)" (is "?P = ?B") proof - have "?B = sigma UNIV {A \<times> B | A B. open A \<and> open B}" by (rule second_countable_borel_measurable[OF open_prod_generated]) also have "\<dots> = ?P" unfolding borel_def by (subst sigma_prod) (auto intro!: exI[of _ "{UNIV}"]) finally show ?thesis .. qed lemma pair_measure_count_space: assumes A: "finite A" and B: "finite B" shows "count_space A \<Otimes>\<^sub>M count_space B = count_space (A \<times> B)" (is "?P = ?C") proof (rule measure_eqI) interpret A: finite_measure "count_space A" by (rule finite_measure_count_space) fact interpret B: finite_measure "count_space B" by (rule finite_measure_count_space) fact interpret P: pair_sigma_finite "count_space A" "count_space B" by default show eq: "sets ?P = sets ?C" by (simp add: sets_pair_measure sigma_sets_pair_measure_generator_finite A B) fix X assume X: "X \<in> sets ?P" with eq have X_subset: "X \<subseteq> A \<times> B" by simp with A B have fin_Pair: "\<And>x. finite (Pair x -` X)" by (intro finite_subset[OF _ B]) auto have fin_X: "finite X" using X_subset by (rule finite_subset) (auto simp: A B) show "emeasure ?P X = emeasure ?C X" apply (subst B.emeasure_pair_measure_alt[OF X]) apply (subst emeasure_count_space) using X_subset apply auto [] apply (simp add: fin_Pair emeasure_count_space X_subset fin_X) apply (subst nn_integral_count_space) using A apply simp apply (simp del: real_of_nat_setsum add: real_of_nat_setsum[symmetric]) apply (subst card_gt_0_iff) apply (simp add: fin_Pair) apply (subst card_SigmaI[symmetric]) using A apply simp using fin_Pair apply simp using X_subset apply (auto intro!: arg_cong[where f=card]) done qed lemma pair_measure_density: assumes f: "f \<in> borel_measurable M1" "AE x in M1. 0 \<le> f x" assumes g: "g \<in> borel_measurable M2" "AE x in M2. 0 \<le> g x" assumes "sigma_finite_measure M2" "sigma_finite_measure (density M2 g)" shows "density M1 f \<Otimes>\<^sub>M density M2 g = density (M1 \<Otimes>\<^sub>M M2) (\<lambda>(x,y). f x * g y)" (is "?L = ?R") proof (rule measure_eqI) interpret M2: sigma_finite_measure M2 by fact interpret D2: sigma_finite_measure "density M2 g" by fact fix A assume A: "A \<in> sets ?L" with f g have "(\<integral>\<^sup>+ x. f x * \<integral>\<^sup>+ y. g y * indicator A (x, y) \<partial>M2 \<partial>M1) = (\<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f x * g y * indicator A (x, y) \<partial>M2 \<partial>M1)" by (intro nn_integral_cong_AE) (auto simp add: nn_integral_cmult[symmetric] ac_simps) with A f g show "emeasure ?L A = emeasure ?R A" by (simp add: D2.emeasure_pair_measure emeasure_density nn_integral_density M2.nn_integral_fst[symmetric] cong: nn_integral_cong) qed simp lemma sigma_finite_measure_distr: assumes "sigma_finite_measure (distr M N f)" and f: "f \<in> measurable M N" shows "sigma_finite_measure M" proof - interpret sigma_finite_measure "distr M N f" by fact from sigma_finite_countable guess A .. note A = this show ?thesis proof show "\<exists>A. countable A \<and> A \<subseteq> sets M \<and> \<Union>A = space M \<and> (\<forall>a\<in>A. emeasure M a \<noteq> \<infinity>)" using A f by (intro exI[of _ "(\<lambda>a. f -` a \<inter> space M) ` A"]) (auto simp: emeasure_distr set_eq_iff subset_eq intro: measurable_space) qed qed lemma pair_measure_distr: assumes f: "f \<in> measurable M S" and g: "g \<in> measurable N T" assumes "sigma_finite_measure (distr N T g)" shows "distr M S f \<Otimes>\<^sub>M distr N T g = distr (M \<Otimes>\<^sub>M N) (S \<Otimes>\<^sub>M T) (\<lambda>(x, y). (f x, g y))" (is "?P = ?D") proof (rule measure_eqI) interpret T: sigma_finite_measure "distr N T g" by fact interpret N: sigma_finite_measure N by (rule sigma_finite_measure_distr) fact+ fix A assume A: "A \<in> sets ?P" with f g show "emeasure ?P A = emeasure ?D A" by (auto simp add: N.emeasure_pair_measure_alt space_pair_measure emeasure_distr T.emeasure_pair_measure_alt nn_integral_distr intro!: nn_integral_cong arg_cong[where f="emeasure N"]) qed simp lemma pair_measure_eqI: assumes "sigma_finite_measure M1" "sigma_finite_measure M2" assumes sets: "sets (M1 \<Otimes>\<^sub>M M2) = sets M" assumes emeasure: "\<And>A B. A \<in> sets M1 \<Longrightarrow> B \<in> sets M2 \<Longrightarrow> emeasure M1 A * emeasure M2 B = emeasure M (A \<times> B)" shows "M1 \<Otimes>\<^sub>M M2 = M" proof - interpret M1: sigma_finite_measure M1 by fact interpret M2: sigma_finite_measure M2 by fact interpret pair_sigma_finite M1 M2 by default from sigma_finite_up_in_pair_measure_generator guess F :: "nat \<Rightarrow> ('a \<times> 'b) set" .. note F = this let ?E = "{a \<times> b |a b. a \<in> sets M1 \<and> b \<in> sets M2}" let ?P = "M1 \<Otimes>\<^sub>M M2" show ?thesis proof (rule measure_eqI_generator_eq[OF Int_stable_pair_measure_generator[of M1 M2]]) show "?E \<subseteq> Pow (space ?P)" using sets.space_closed[of M1] sets.space_closed[of M2] by (auto simp: space_pair_measure) show "sets ?P = sigma_sets (space ?P) ?E" by (simp add: sets_pair_measure space_pair_measure) then show "sets M = sigma_sets (space ?P) ?E" using sets[symmetric] by simp next show "range F \<subseteq> ?E" "(\<Union>i. F i) = space ?P" "\<And>i. emeasure ?P (F i) \<noteq> \<infinity>" using F by (auto simp: space_pair_measure) next fix X assume "X \<in> ?E" then obtain A B where X[simp]: "X = A \<times> B" and A: "A \<in> sets M1" and B: "B \<in> sets M2" by auto then have "emeasure ?P X = emeasure M1 A * emeasure M2 B" by (simp add: M2.emeasure_pair_measure_Times) also have "\<dots> = emeasure M (A \<times> B)" using A B emeasure by auto finally show "emeasure ?P X = emeasure M X" by simp qed qed lemma sets_pair_countable: assumes "countable S1" "countable S2" assumes M: "sets M = Pow S1" and N: "sets N = Pow S2" shows "sets (M \<Otimes>\<^sub>M N) = Pow (S1 \<times> S2)" proof auto fix x a b assume x: "x \<in> sets (M \<Otimes>\<^sub>M N)" "(a, b) \<in> x" from sets.sets_into_space[OF x(1)] x(2) sets_eq_imp_space_eq[of N "count_space S2"] sets_eq_imp_space_eq[of M "count_space S1"] M N show "a \<in> S1" "b \<in> S2" by (auto simp: space_pair_measure) next fix X assume X: "X \<subseteq> S1 \<times> S2" then have "countable X" by (metis countable_subset `countable S1` `countable S2` countable_SIGMA) have "X = (\<Union>(a, b)\<in>X. {a} \<times> {b})" by auto also have "\<dots> \<in> sets (M \<Otimes>\<^sub>M N)" using X by (safe intro!: sets.countable_UN' `countable X` subsetI pair_measureI) (auto simp: M N) finally show "X \<in> sets (M \<Otimes>\<^sub>M N)" . qed lemma pair_measure_countable: assumes "countable S1" "countable S2" shows "count_space S1 \<Otimes>\<^sub>M count_space S2 = count_space (S1 \<times> S2)" proof (rule pair_measure_eqI) show "sigma_finite_measure (count_space S1)" "sigma_finite_measure (count_space S2)" using assms by (auto intro!: sigma_finite_measure_count_space_countable) show "sets (count_space S1 \<Otimes>\<^sub>M count_space S2) = sets (count_space (S1 \<times> S2))" by (subst sets_pair_countable[OF assms]) auto next fix A B assume "A \<in> sets (count_space S1)" "B \<in> sets (count_space S2)" then show "emeasure (count_space S1) A * emeasure (count_space S2) B = emeasure (count_space (S1 \<times> S2)) (A \<times> B)" by (subst (1 2 3) emeasure_count_space) (auto simp: finite_cartesian_product_iff) qed subsection {* Product of Borel spaces *} lemma borel_Times: fixes A :: "'a::topological_space set" and B :: "'b::topological_space set" assumes A: "A \<in> sets borel" and B: "B \<in> sets borel" shows "A \<times> B \<in> sets borel" proof - have "A \<times> B = (A\<times>UNIV) \<inter> (UNIV \<times> B)" by auto moreover { have "A \<in> sigma_sets UNIV {S. open S}" using A by (simp add: sets_borel) then have "A\<times>UNIV \<in> sets borel" proof (induct A) case (Basic S) then show ?case by (auto intro!: borel_open open_Times) next case (Compl A) moreover have *: "(UNIV - A) \<times> UNIV = UNIV - (A \<times> UNIV)" by auto ultimately show ?case unfolding * by auto next case (Union A) moreover have *: "(UNION UNIV A) \<times> UNIV = UNION UNIV (\<lambda>i. A i \<times> UNIV)" by auto ultimately show ?case unfolding * by auto qed simp } moreover { have "B \<in> sigma_sets UNIV {S. open S}" using B by (simp add: sets_borel) then have "UNIV\<times>B \<in> sets borel" proof (induct B) case (Basic S) then show ?case by (auto intro!: borel_open open_Times) next case (Compl B) moreover have *: "UNIV \<times> (UNIV - B) = UNIV - (UNIV \<times> B)" by auto ultimately show ?case unfolding * by auto next case (Union B) moreover have *: "UNIV \<times> (UNION UNIV B) = UNION UNIV (\<lambda>i. UNIV \<times> B i)" by auto ultimately show ?case unfolding * by auto qed simp } ultimately show ?thesis by auto qed lemma finite_measure_pair_measure: assumes "finite_measure M" "finite_measure N" shows "finite_measure (N \<Otimes>\<^sub>M M)" proof (rule finite_measureI) interpret M: finite_measure M by fact interpret N: finite_measure N by fact show "emeasure (N \<Otimes>\<^sub>M M) (space (N \<Otimes>\<^sub>M M)) \<noteq> \<infinity>" by (auto simp: space_pair_measure M.emeasure_pair_measure_Times) qed end
lemma continuous_attains_sup: fixes f :: "'a::topological_space \<Rightarrow> 'b::linorder_topology" shows "compact s \<Longrightarrow> s \<noteq> {} \<Longrightarrow> continuous_on s f \<Longrightarrow> (\<exists>x\<in>s. \<forall>y\<in>s. f y \<le> f x)"
[STATEMENT] lemma coin_set_sym: "fst`(\<CC> g h) = snd `(\<CC> h g)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. fst ` \<CC> g h = snd ` \<CC> h g [PROOF STEP] unfolding coincidence_set_def [PROOF STATE] proof (prove) goal (1 subgoal): 1. fst ` {(r, s). g r = h s} = snd ` {(r, s). h r = g s} [PROOF STEP] by (rule, rule, auto simp add: image_iff, metis)
------------------------------------------------------------------------ -- The Agda standard library -- -- The free monad construction on indexed containers ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe --guardedness #-} module Data.Container.Indexed.FreeMonad where open import Level open import Function hiding (const) open import Category.Monad.Predicate open import Data.Container.Indexed open import Data.Container.Indexed.Combinator hiding (id; _∘_) open import Data.Empty open import Data.Sum using (inj₁; inj₂) open import Data.Product open import Data.W.Indexed open import Relation.Unary open import Relation.Unary.PredicateTransformer open import Relation.Binary.PropositionalEquality ------------------------------------------------------------------------ infixl 9 _⋆C_ infix 9 _⋆_ _⋆C_ : ∀ {i o c r} {I : Set i} {O : Set o} → Container I O c r → Pred O c → Container I O _ _ C ⋆C X = const X ⊎ C _⋆_ : ∀ {ℓ} {O : Set ℓ} → Container O O ℓ ℓ → Pt O ℓ C ⋆ X = μ (C ⋆C X) pattern returnP x = (inj₁ x , _) pattern doP c k = (inj₂ c , k) inn : ∀ {ℓ} {O : Set ℓ} {C : Container O O ℓ ℓ} {X} → ⟦ C ⟧ (C ⋆ X) ⊆ C ⋆ X inn (c , k) = sup (doP c k) rawPMonad : ∀ {ℓ} {O : Set ℓ} {C : Container O O ℓ ℓ} → RawPMonad {ℓ = ℓ} (_⋆_ C) rawPMonad {C = C} = record { return? = return ; _=<?_ = _=<<_ } where return : ∀ {X} → X ⊆ C ⋆ X return x = sup (inj₁ x , ⊥-elim ∘ lower) _=<<_ : ∀ {X Y} → X ⊆ C ⋆ Y → C ⋆ X ⊆ C ⋆ Y f =<< sup (returnP x) = f x f =<< sup (doP c k) = inn (c , λ r → f =<< k r) leaf : ∀ {ℓ} {O : Set ℓ} {C : Container O O ℓ ℓ} {X : Pred O ℓ} → ⟦ C ⟧ X ⊆ C ⋆ X leaf (c , k) = inn (c , return? ∘ k) where open RawPMonad rawPMonad generic : ∀ {ℓ} {O : Set ℓ} {C : Container O O ℓ ℓ} {o} (c : Command C o) → o ∈ C ⋆ (⋃[ r ∶ Response C c ] { next C c r }) generic c = inn (c , λ r → return? (r , refl)) where open RawPMonad rawPMonad
[STATEMENT] lemma dlist_eq_iff: "dxs = dys \<longleftrightarrow> list_of_dlist dxs = list_of_dlist dys" [PROOF STATE] proof (prove) goal (1 subgoal): 1. (dxs = dys) = (list_of_dlist dxs = list_of_dlist dys) [PROOF STEP] by (simp add: list_of_dlist_inject)
\subsection{Box and whisker plots}
#include <stdio.h> #include <malloc.h> #include <stdlib.h> #include <stdbool.h> #include <gsl/gsl_math.h> #include <gsl/gsl_eigen.h> #include <gsl/gsl_linalg.h> #include <gsl/gsl_matrix.h> #include <gsl/gsl_blas.h> #include <functions.h> #define FOR(i,n) for(i=0;i<n;i++) typedef double DD, LD; typedef long LL; void quicksort_mds(double* x, long first, long last) { long pivot, j, i; double temp; if (first<last) { pivot = first; i = first; j = last; while (i<j) { while (x[i]<=x[pivot] && i<last) i++; while (x[j]>x[pivot]) j--; if (i<j) { temp = x[i]; x[i] = x[j]; x[j] = temp; } } temp = x[pivot]; x[pivot] = x[j]; x[j] = temp; quicksort(x, first, j - 1); quicksort(x, j + 1, last); } } void find_eigen(double **mat, int n, double*** res_vec, double** res_val) { int i, j; double *data = (double*)calloc(((long)(n*n)), sizeof(double)); double *eig_values = (double*)calloc(n, sizeof(double)); double** eig_vec = (double**)calloc(n, sizeof(double*)); for (i = 0; i<n; i++)eig_vec[i] = (double*)calloc(n, sizeof(double)); for (i = 0; i<n; i++) { for (j = 0; j<n; j++) { data[i*n + j] = mat[i][j]; } } gsl_matrix_view m= gsl_matrix_view_array(data, n, n); gsl_vector *eval = gsl_vector_alloc(n); gsl_matrix *evec = gsl_matrix_alloc(n, n); gsl_eigen_symmv_workspace * w =gsl_eigen_symmv_alloc(n); gsl_eigen_symmv(&m.matrix, eval, evec, w); gsl_eigen_symmv_free(w); gsl_eigen_symmv_sort(eval, evec,GSL_EIGEN_SORT_VAL_ASC); for (i = 0; i<n; i++) { eig_values[i] = gsl_vector_get(eval, i); for (j = 0; j<n; j++) { eig_vec[i][j] = gsl_matrix_get(evec, i, j); } } *res_val = eig_values; *res_vec = eig_vec; gsl_vector_free(eval); gsl_matrix_free(evec); free(data); } DD** Multiply_Matrices_mds(DD **Mat1, DD **Mat2, LL M, LL Q, LL P) { LL i, c, d, k; DD Sum = 0; DD** Temp = (DD**)calloc(M, sizeof(DD*)); FOR(i, M)Temp[i] = (DD*)calloc(Q, sizeof(DD)); FOR(c, M) { FOR(d, Q) { FOR(k, P) { Sum += (Mat1[c][k] * Mat2[k][d]); } Temp[c][d] = Sum; Sum = 0; } } return Temp; } double ** H_mat(long n) { long i, j; DD** k = (DD**)calloc(n, sizeof(DD*)); FOR(i, n) { k[i] = (DD*)calloc(n, sizeof(DD)); } FOR(i, n){ FOR(j, n){ k[i][j] = (i == j) ? (1.00 - 1.00 / n) : (-1.00 / n); } } return k; } typedef struct{ MAT Y; DD* eigen; LL number; } Output_mds; Output_mds MDS(DD** D,long rows,long columns, DD delta) { // ************** function to calculate Classical Multidimensional Scaling ************* long i, j, n; DD **H, **new_D, **K, **new_k; new_D = (DD**)calloc(rows, sizeof(DD*)); n = max(rows, columns); FOR(i, rows) { new_D[i] = (DD*)calloc(columns, sizeof(DD)); } if (delta >= 0) { H = H_mat(n); new_k = (DD**)calloc(n, sizeof(DD*)); FOR(i, rows) { new_k[i] = (DD*)calloc(n, sizeof(DD)); } FOR(i, rows) { FOR(j, columns) new_D[i][j] = -0.5*D[i][j]; } K = Multiply_Matrices_mds(Multiply_Matrices_mds(H, new_D, n, columns, n), H, columns, n, n); FOR(i,rows)free(new_D[i]);free(new_D); FOR(i,n)free(H[i]);free(H); DD* idx = (DD*)calloc(n, sizeof(DD)); DD ** temp, *val; FOR(i, n) { idx[i] = n - i; FOR(j, rows) new_k[i][j] = (K[i][j] + K[j][i]) / 2; } find_eigen(new_k, n, &temp, &val); find_eigen(new_k, n, &temp, &val); j = n - 1; for (i = 0; i < n / 2; i++) { DD temporary = val[i]; val[i] = val[j]; val[j] = temporary; j--; } LL* keep; DD max_val = val[0]; LL magn_keep = 0; FOR(i, n){ if (val[i] > max_val)max_val = val[i]; } max_val = max_val*exp(-10); FOR(i, n){ if (val[i] > max_val)magn_keep++; } keep = (LL*)calloc(magn_keep, sizeof(LL)); magn_keep = 0; FOR(i, n){ if (val[i] > max_val){ keep[magn_keep++] = i; } } DD** V = (DD**)calloc(n, sizeof(DD*)); DD** mult_V = (DD**)calloc(magn_keep, sizeof(DD*)); FOR(i, n)V[i] = (DD*)calloc(magn_keep, sizeof(DD)); FOR(i, magn_keep) { mult_V[i] = (DD*)calloc(magn_keep, sizeof(DD)); FOR(j, n) { if (j < magn_keep) { if (i != j)mult_V[i][j] = 0; else mult_V[i][j] = sqrt(val[keep[i]]); } V[j][i] = temp[j][(int)idx[keep[i]]-1]; } } V = Multiply_Matrices_mds(V, mult_V, n, magn_keep, magn_keep); MAT return_MAT; return_MAT.matrix = V; return_MAT.rows = n; return_MAT.columns = magn_keep; Output_mds t; t.Y = return_MAT; t.eigen = val; t.number=n; return t; } Output_mds t; return t; }
subroutine initwaqpar(gdp) !----- GPL --------------------------------------------------------------------- ! ! Copyright (C) Stichting Deltares, 2011-2016. ! ! This program is free software: you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation version 3. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program. If not, see <http://www.gnu.org/licenses/>. ! ! contact: [email protected] ! Stichting Deltares ! P.O. Box 177 ! 2600 MH Delft, The Netherlands ! ! All indications and logos of, and references to, "Delft3D" and "Deltares" ! are registered trademarks of Stichting Deltares, and remain the property of ! Stichting Deltares. All rights reserved. ! !------------------------------------------------------------------------------- ! $Id: initwaqpar.f90 5717 2016-01-12 11:35:24Z mourits $ ! $HeadURL: https://svn.oss.deltares.nl/repos/delft3d/tags/6686/src/engines_gpl/flow2d3d/packages/data/src/gdp/initwaqpar.f90 $ !!--description----------------------------------------------------------------- ! NONE !!--pseudo code and references-------------------------------------------------- ! NONE !!--declarations---------------------------------------------------------------- use precision ! use globaldata ! implicit none ! type(globdat),target :: gdp ! ! The following list of pointer parameters is used to point inside the gdp structure ! integer , pointer :: itwqff integer , pointer :: itwqfi integer , pointer :: itwqfl integer , pointer :: lunvol integer , pointer :: lunare integer , pointer :: lunflo integer , pointer :: lunsal integer , pointer :: luntem integer , pointer :: lunvdf integer , pointer :: luntau integer , pointer :: lunsrctmp integer , pointer :: lunwlk integer , pointer :: lunsrc integer , pointer :: lunkmk logical , pointer :: first_cf logical , pointer :: firsttime logical , pointer :: firstwaq logical , pointer :: waqfil logical , pointer :: waqol character(256) , pointer :: flaggr ! !! executable statements ------------------------------------------------------- ! itwqff => gdp%gdwaqpar%itwqff itwqfi => gdp%gdwaqpar%itwqfi itwqfl => gdp%gdwaqpar%itwqfl lunvol => gdp%gdwaqpar%lunvol lunare => gdp%gdwaqpar%lunare lunflo => gdp%gdwaqpar%lunflo lunsal => gdp%gdwaqpar%lunsal luntem => gdp%gdwaqpar%luntem lunvdf => gdp%gdwaqpar%lunvdf luntau => gdp%gdwaqpar%luntau lunsrctmp => gdp%gdwaqpar%lunsrctmp lunwlk => gdp%gdwaqpar%lunwlk lunsrc => gdp%gdwaqpar%lunsrc lunkmk => gdp%gdwaqpar%lunkmk first_cf => gdp%gdwaqpar%first_cf firsttime => gdp%gdwaqpar%firsttime firstwaq => gdp%gdwaqpar%firstwaq waqfil => gdp%gdwaqpar%waqfil waqol => gdp%gdwaqpar%waqol flaggr => gdp%gdwaqpar%flaggr ! first_cf = .true. firsttime = .true. firstwaq = .true. waqfil = .false. waqol = .false. ! itwqff = 0 itwqfi = 0 itwqfl = 0 lunvol = 0 lunare = 0 lunflo = 0 lunsal = 0 luntem = 0 lunvdf = 0 luntau = 0 lunsrctmp = 0 lunwlk = 0 lunsrc = 0 lunkmk = 0 ! nullify(gdp%gdwaqpar%quwaq) nullify(gdp%gdwaqpar%qvwaq) nullify(gdp%gdwaqpar%qwwaq) nullify(gdp%gdwaqpar%discumwaq) nullify(gdp%gdwaqpar%ifrmto) nullify(gdp%gdwaqpar%isaggr) nullify(gdp%gdwaqpar%iqaggr) nullify(gdp%gdwaqpar%ilaggr) nullify(gdp%gdwaqpar%ifsmax) nullify(gdp%gdwaqpar%vol) nullify(gdp%gdwaqpar%sag) nullify(gdp%gdwaqpar%vol2) nullify(gdp%gdwaqpar%sag2) nullify(gdp%gdwaqpar%qag) nullify(gdp%gdwaqpar%horsurf) nullify(gdp%gdwaqpar%kmk) nullify(gdp%gdwaqpar%ksrwaq) nullify(gdp%gdwaqpar%loads) nullify(gdp%gdwaqpar%iwlk) nullify(gdp%gdwaqpar%lunsed) nullify(gdp%gdwaqpar%lunsedflx) nullify(gdp%gdwaqpar%cumsedflx) nullify(gdp%gdwaqpar%cumresflx) ! flaggr = ' ' end subroutine initwaqpar
[STATEMENT] lemma emeasure_gfp[consumes 1, case_names cont measurable]: assumes sets[simp]: "\<And>s. sets (M s) = sets N" assumes "\<And>s. finite_measure (M s)" assumes cont: "inf_continuous F" "inf_continuous f" assumes meas: "\<And>P. Measurable.pred N P \<Longrightarrow> Measurable.pred N (F P)" assumes iter: "\<And>P s. Measurable.pred N P \<Longrightarrow> emeasure (M s) {x\<in>space N. F P x} = f (\<lambda>s. emeasure (M s) {x\<in>space N. P x}) s" assumes bound: "\<And>P. f P \<le> f (\<lambda>s. emeasure (M s) (space (M s)))" shows "emeasure (M s) {x\<in>space N. gfp F x} = gfp f s" [PROOF STATE] proof (prove) goal (1 subgoal): 1. emeasure (M s) {x \<in> space N. gfp F x} = gfp f s [PROOF STEP] proof (subst gfp_transfer_bounded[where \<alpha>="\<lambda>F s. emeasure (M s) {x\<in>space N. F x}" and g=f and f=F and P="Measurable.pred N", symmetric]) [PROOF STATE] proof (state) goal (9 subgoals): 1. Measurable.pred N (F top) 2. \<And>x. Measurable.pred N x \<Longrightarrow> Measurable.pred N (F x) 3. \<And>M. \<lbrakk>decseq M; \<And>i. Measurable.pred N (M i)\<rbrakk> \<Longrightarrow> Measurable.pred N (Inf (range M)) 4. \<And>Ma. \<lbrakk>decseq Ma; \<And>i. Measurable.pred N (Ma i)\<rbrakk> \<Longrightarrow> (\<lambda>s. emeasure (M s) {x \<in> space N. Inf (range Ma) x}) = (INF i. (\<lambda>s. emeasure (M s) {x \<in> space N. Ma i x})) 5. inf_continuous F 6. inf_continuous f 7. \<And>x. Measurable.pred N x \<Longrightarrow> (\<lambda>s. emeasure (M s) {xa \<in> space N. F x xa}) = f (\<lambda>s. emeasure (M s) {xa \<in> space N. x xa}) 8. \<And>x. f x \<le> (\<lambda>s. emeasure (M s) {x \<in> space N. F top x}) 9. emeasure (M s) {x \<in> space N. gfp F x} = emeasure (M s) {x \<in> space N. gfp F x} [PROOF STEP] interpret finite_measure "M s" for s [PROOF STATE] proof (prove) goal (1 subgoal): 1. finite_measure (M s) [PROOF STEP] by fact [PROOF STATE] proof (state) goal (9 subgoals): 1. Measurable.pred N (F top) 2. \<And>x. Measurable.pred N x \<Longrightarrow> Measurable.pred N (F x) 3. \<And>M. \<lbrakk>decseq M; \<And>i. Measurable.pred N (M i)\<rbrakk> \<Longrightarrow> Measurable.pred N (Inf (range M)) 4. \<And>Ma. \<lbrakk>decseq Ma; \<And>i. Measurable.pred N (Ma i)\<rbrakk> \<Longrightarrow> (\<lambda>s. emeasure (M s) {x \<in> space N. Inf (range Ma) x}) = (INF i. (\<lambda>s. emeasure (M s) {x \<in> space N. Ma i x})) 5. inf_continuous F 6. inf_continuous f 7. \<And>x. Measurable.pred N x \<Longrightarrow> (\<lambda>s. emeasure (M s) {xa \<in> space N. F x xa}) = f (\<lambda>s. emeasure (M s) {xa \<in> space N. x xa}) 8. \<And>x. f x \<le> (\<lambda>s. emeasure (M s) {x \<in> space N. F top x}) 9. emeasure (M s) {x \<in> space N. gfp F x} = emeasure (M s) {x \<in> space N. gfp F x} [PROOF STEP] fix C [PROOF STATE] proof (state) goal (9 subgoals): 1. Measurable.pred N (F top) 2. \<And>x. Measurable.pred N x \<Longrightarrow> Measurable.pred N (F x) 3. \<And>M. \<lbrakk>decseq M; \<And>i. Measurable.pred N (M i)\<rbrakk> \<Longrightarrow> Measurable.pred N (Inf (range M)) 4. \<And>Ma. \<lbrakk>decseq Ma; \<And>i. Measurable.pred N (Ma i)\<rbrakk> \<Longrightarrow> (\<lambda>s. emeasure (M s) {x \<in> space N. Inf (range Ma) x}) = (INF i. (\<lambda>s. emeasure (M s) {x \<in> space N. Ma i x})) 5. inf_continuous F 6. inf_continuous f 7. \<And>x. Measurable.pred N x \<Longrightarrow> (\<lambda>s. emeasure (M s) {xa \<in> space N. F x xa}) = f (\<lambda>s. emeasure (M s) {xa \<in> space N. x xa}) 8. \<And>x. f x \<le> (\<lambda>s. emeasure (M s) {x \<in> space N. F top x}) 9. emeasure (M s) {x \<in> space N. gfp F x} = emeasure (M s) {x \<in> space N. gfp F x} [PROOF STEP] assume "decseq C" "\<And>i. Measurable.pred N (C i)" [PROOF STATE] proof (state) this: decseq C Measurable.pred N (C ?i) goal (9 subgoals): 1. Measurable.pred N (F top) 2. \<And>x. Measurable.pred N x \<Longrightarrow> Measurable.pred N (F x) 3. \<And>M. \<lbrakk>decseq M; \<And>i. Measurable.pred N (M i)\<rbrakk> \<Longrightarrow> Measurable.pred N (Inf (range M)) 4. \<And>Ma. \<lbrakk>decseq Ma; \<And>i. Measurable.pred N (Ma i)\<rbrakk> \<Longrightarrow> (\<lambda>s. emeasure (M s) {x \<in> space N. Inf (range Ma) x}) = (INF i. (\<lambda>s. emeasure (M s) {x \<in> space N. Ma i x})) 5. inf_continuous F 6. inf_continuous f 7. \<And>x. Measurable.pred N x \<Longrightarrow> (\<lambda>s. emeasure (M s) {xa \<in> space N. F x xa}) = f (\<lambda>s. emeasure (M s) {xa \<in> space N. x xa}) 8. \<And>x. f x \<le> (\<lambda>s. emeasure (M s) {x \<in> space N. F top x}) 9. emeasure (M s) {x \<in> space N. gfp F x} = emeasure (M s) {x \<in> space N. gfp F x} [PROOF STEP] then [PROOF STATE] proof (chain) picking this: decseq C Measurable.pred N (C ?i) [PROOF STEP] show "(\<lambda>s. emeasure (M s) {x \<in> space N. (INF i. C i) x}) = (INF i. (\<lambda>s. emeasure (M s) {x \<in> space N. C i x}))" [PROOF STATE] proof (prove) using this: decseq C Measurable.pred N (C ?i) goal (1 subgoal): 1. (\<lambda>s. emeasure (M s) {x \<in> space N. Inf (range C) x}) = (INF i. (\<lambda>s. emeasure (M s) {x \<in> space N. C i x})) [PROOF STEP] unfolding INF_apply[abs_def] [PROOF STATE] proof (prove) using this: decseq C Measurable.pred N (C ?i) goal (1 subgoal): 1. (\<lambda>s. emeasure (M s) {x \<in> space N. INF y. C y x}) = (\<lambda>x. INF y. emeasure (M x) {x \<in> space N. C y x}) [PROOF STEP] by (subst INF_emeasure_decseq) (auto simp: antimono_def fun_eq_iff intro!: arg_cong2[where f=emeasure]) [PROOF STATE] proof (state) this: (\<lambda>s. emeasure (M s) {x \<in> space N. Inf (range C) x}) = (INF i. (\<lambda>s. emeasure (M s) {x \<in> space N. C i x})) goal (8 subgoals): 1. Measurable.pred N (F top) 2. \<And>x. Measurable.pred N x \<Longrightarrow> Measurable.pred N (F x) 3. \<And>M. \<lbrakk>decseq M; \<And>i. Measurable.pred N (M i)\<rbrakk> \<Longrightarrow> Measurable.pred N (Inf (range M)) 4. inf_continuous F 5. inf_continuous f 6. \<And>x. Measurable.pred N x \<Longrightarrow> (\<lambda>s. emeasure (M s) {xa \<in> space N. F x xa}) = f (\<lambda>s. emeasure (M s) {xa \<in> space N. x xa}) 7. \<And>x. f x \<le> (\<lambda>s. emeasure (M s) {x \<in> space N. F top x}) 8. emeasure (M s) {x \<in> space N. gfp F x} = emeasure (M s) {x \<in> space N. gfp F x} [PROOF STEP] next [PROOF STATE] proof (state) goal (8 subgoals): 1. Measurable.pred N (F top) 2. \<And>x. Measurable.pred N x \<Longrightarrow> Measurable.pred N (F x) 3. \<And>M. \<lbrakk>decseq M; \<And>i. Measurable.pred N (M i)\<rbrakk> \<Longrightarrow> Measurable.pred N (Inf (range M)) 4. inf_continuous F 5. inf_continuous f 6. \<And>x. Measurable.pred N x \<Longrightarrow> (\<lambda>s. emeasure (M s) {xa \<in> space N. F x xa}) = f (\<lambda>s. emeasure (M s) {xa \<in> space N. x xa}) 7. \<And>x. f x \<le> (\<lambda>s. emeasure (M s) {x \<in> space N. F top x}) 8. emeasure (M s) {x \<in> space N. gfp F x} = emeasure (M s) {x \<in> space N. gfp F x} [PROOF STEP] show "f x \<le> (\<lambda>s. emeasure (M s) {x \<in> space N. F top x})" for x [PROOF STATE] proof (prove) goal (1 subgoal): 1. f x \<le> (\<lambda>s. emeasure (M s) {x \<in> space N. F top x}) [PROOF STEP] using bound[of x] sets_eq_imp_space_eq[OF sets] [PROOF STATE] proof (prove) using this: f x \<le> f (\<lambda>s. emeasure (M s) (space (M s))) space (M ?s1) = space N goal (1 subgoal): 1. f x \<le> (\<lambda>s. emeasure (M s) {x \<in> space N. F top x}) [PROOF STEP] by (simp add: iter) [PROOF STATE] proof (state) this: f ?x \<le> (\<lambda>s. emeasure (M s) {x \<in> space N. F top x}) goal (7 subgoals): 1. Measurable.pred N (F top) 2. \<And>x. Measurable.pred N x \<Longrightarrow> Measurable.pred N (F x) 3. \<And>M. \<lbrakk>decseq M; \<And>i. Measurable.pred N (M i)\<rbrakk> \<Longrightarrow> Measurable.pred N (Inf (range M)) 4. inf_continuous F 5. inf_continuous f 6. \<And>x. Measurable.pred N x \<Longrightarrow> (\<lambda>s. emeasure (M s) {xa \<in> space N. F x xa}) = f (\<lambda>s. emeasure (M s) {xa \<in> space N. x xa}) 7. emeasure (M s) {x \<in> space N. gfp F x} = emeasure (M s) {x \<in> space N. gfp F x} [PROOF STEP] qed (auto simp add: iter le_fun_def INF_apply[abs_def] intro!: meas cont)
using Test using Dates: now using ExtensibleScheduler using ExtensibleScheduler: MemoryJobStore, Job, get_job_id @testset "JobStores" begin function return_args(id) "Returned from return_args $id" end @testset "MemoryJobStore" begin jobstore = MemoryJobStore() @test isempty(jobstore) action1 = Action(return_args, 1) @test run(action1) == "Returned from return_args 1" trigger1 = Trigger(DateTime(2010, 1, 1)) id1 = get_job_id(jobstore) name1 = "Textual description of job1" priority1 = 0 dt_created1 = now() dt_updated1 = dt_created1 dt_next_fire1 = DateTime(0) n_triggered1 = 0 config1 = JobConfig() job1 = Job(id1, action1, trigger1, name1, priority1, dt_created1, dt_updated1, dt_next_fire1, n_triggered1, config1) push!(jobstore, job1) @test length(jobstore) == 1 action2 = Action(return_args, 2) @test run(action2) == "Returned from return_args 2" trigger2 = Trigger(DateTime(2010, 1, 1)) id2 = get_job_id(jobstore) @test id2 != id1 name2 = "Textual description of job2" priority2 = 0 dt_created2 = now() dt_updated2 = dt_created2 dt_next_fire2 = DateTime(0) n_triggered2 = 0 config2 = JobConfig() job2 = Job(id2, action2, trigger2, name2, priority2, dt_created2, dt_updated2, dt_next_fire2, n_triggered2, config2) push!(jobstore, job2) @test length(jobstore) == 2 end end
lemma LIMSEQ_iff_nz: "X \<longlonglongrightarrow> L \<longleftrightarrow> (\<forall>r>0. \<exists>no>0. \<forall>n\<ge>no. dist (X n) L < r)" for L :: "'a::metric_space"
proposition homotopic_loops_subset: "\<lbrakk>homotopic_loops s p q; s \<subseteq> t\<rbrakk> \<Longrightarrow> homotopic_loops t p q"
(* Property from Productive Use of Failure in Inductive Proof, Andrew Ireland and Alan Bundy, JAR 1996. This Isabelle theory is produced using the TIP tool offered at the following website: https://github.com/tip-org/tools This file was originally provided as part of TIP benchmark at the following website: https://github.com/tip-org/benchmarks Yutaka Nagashima at CIIRC, CTU changed the TIP output theory file slightly to make it compatible with Isabelle2017. Some proofs were added by Yutaka Nagashima.*) theory TIP_prop_25 imports "../../Test_Base" begin datatype 'a list = nil2 | cons2 "'a" "'a list" datatype Nat = Z | S "Nat" fun x :: "'a list => 'a list => 'a list" where "x (nil2) z = z" | "x (cons2 z2 xs) z = cons2 z2 (x xs z)" fun length :: "'a list => Nat" where "length (nil2) = Z" | "length (cons2 z xs) = S (length xs)" fun even :: "Nat => bool" where "even (Z) = True" | "even (S (Z)) = False" | "even (S (S z2)) = even z2" fun t2 :: "Nat => Nat => Nat" where "t2 (Z) z = z" | "t2 (S z2) z = S (t2 z2 z)" theorem property0 : "((even (length (x y z))) = (even (t2 (length z) (length y))))" oops end
$\mathcal{O}(f) = \mathcal{O}(g)$ if and only if $f \in \Theta(g)$.
module DualTail1 where open import Data.Nat open import Data.Fin using (Fin; zero; suc) open import Data.Product open import Function using (id; _∘_) open import Relation.Binary.PropositionalEquality using (_≡_; refl) open import Types.Direction open import Types.IND1 as IND hiding (GType; Type; SType; _≈_; _≈'_) import Types.COI as COI open import Types.Tail1 private variable n : ℕ -- instead of unrolling and substituting, we maintain a stack of bodies of recursive types data Stack {GType : ℕ → Set} : ℕ → Set where ε : Stack 0 ⟪_,_⟫ : Stack {GType} n → GType (suc n) → Stack (suc n) -- obtain an entry from the stack -- technically m = n - i, but we don't need to know get : ∀ {GType} (i : Fin n) → Stack {GType} n → Σ ℕ λ m → Stack {GType} m × GType (suc m) get zero ⟪ σ , x ⟫ = _ , (σ , x) get (suc i) ⟪ σ , x ⟫ = get i σ -- the dual of a stack dual-stack : Stack {GType} n → Stack {GType} n dual-stack ε = ε dual-stack ⟪ σ , g ⟫ = ⟪ dual-stack σ , dualG g ⟫ -- relate a stack entry to the corresponding entry on the dual stack get-dual-stack : (x : Fin n) (σ : Stack n) → get x (dual-stack σ) ≡ map id (map dual-stack dualG) (get x σ) get-dual-stack zero ⟪ σ , x ⟫ = refl get-dual-stack (suc x) ⟪ σ , x₁ ⟫ = get-dual-stack x σ -- stacked version of general mapping of inductive session type to COI ind2coiS : Stack {IND.GType} n → IND.SType n → COI.SType ind2coiG : Stack {IND.GType} n → IND.GType n → COI.STypeF COI.SType ind2coiT : Stack {IND.GType} n → IND.TType n → COI.Type COI.SType.force (ind2coiS σ (gdd G)) = ind2coiG σ G COI.SType.force (ind2coiS σ (rec G)) = ind2coiG ⟪ σ , G ⟫ G COI.SType.force (ind2coiS σ (var x)) with get x σ ... | m , σ' , gxs = ind2coiG ⟪ σ' , gxs ⟫ gxs ind2coiG σ (transmit d T S) = COI.transmit d (ind2coiT σ T) (ind2coiS σ S) ind2coiG σ (choice d m alt) = COI.choice d m (ind2coiS σ ∘ alt) ind2coiG σ end = COI.end ind2coiT σ TUnit = COI.TUnit ind2coiT σ TInt = COI.TInt ind2coiT σ (TPair T T₁) = COI.TPair (ind2coiT σ T) (ind2coiT σ T₁) ind2coiT σ (TChan S) = COI.TChan (ind2coiS σ S) -- mapping tail recursive session types to coinductive session types -- relies on a stack to unfold variables on the fly tail2coiT : Type → COI.Type tail2coiS : Stack {GType} n → SType n → COI.SType tail2coiG : Stack {GType} n → GType n → COI.STypeF COI.SType tail2coiT TUnit = COI.TUnit tail2coiT TInt = COI.TInt tail2coiT (TPair t t₁) = COI.TPair (tail2coiT t) (tail2coiT t₁) tail2coiT (TChan s) = COI.TChan (ind2coiS ε s) COI.SType.force (tail2coiS σ (gdd g)) = tail2coiG σ g COI.SType.force (tail2coiS σ (rec g)) = tail2coiG ⟪ σ , g ⟫ g COI.SType.force (tail2coiS σ (var x)) with get x σ ... | m , σ' , gxs = tail2coiG ⟪ σ' , gxs ⟫ gxs tail2coiG σ (transmit d t s) = COI.transmit d (tail2coiT t) (tail2coiS σ s) tail2coiG σ (choice d m alt) = COI.choice d m (tail2coiS σ ∘ alt) tail2coiG σ end = COI.end -- get coinductive bisimulation in scope _≈_ = COI._≈_ _≈'_ = COI._≈'_ -- main proposition dual-tailS : (σ : Stack {GType} n) (s : SType n) → COI.dual (tail2coiS σ s) ≈ tail2coiS (dual-stack σ) (dualS s) dual-tailG : (σ : Stack {GType} n) (g : GType n) → COI.dualF (tail2coiG σ g) ≈' tail2coiG (dual-stack σ) (dualG g) COI.Equiv.force (dual-tailS σ (gdd g)) = dual-tailG σ g COI.Equiv.force (dual-tailS σ (rec g)) = dual-tailG ⟪ σ , g ⟫ g COI.Equiv.force (dual-tailS σ (var x)) rewrite get-dual-stack x σ with get x σ ... | m , σ' , g = dual-tailG ⟪ σ' , g ⟫ g dual-tailG σ (transmit d t s) = COI.eq-transmit (dual-dir d) COI.≈ᵗ-refl (dual-tailS σ s) dual-tailG σ (choice d m alt) = COI.eq-choice (dual-dir d) (dual-tailS σ ∘ alt) dual-tailG σ end = COI.eq-end -- corrolary for SType 0 dual-tail : ∀ s → COI.dual (tail2coiS ε s) ≈ tail2coiS ε (dualS s) dual-tail = dual-tailS ε
%---------------------------------------------------------------------------------------- % PACKAGES AND OTHER DOCUMENT CONFIGURATIONS %---------------------------------------------------------------------------------------- \documentclass[10pt, a4paper, twocolumn]{book} \input{../resources/structure.tex} % Specifies the document structure and loads requires packages %---------------------------------------------------------------------------------------- % ARTICLE INFORMATION %---------------------------------------------------------------------------------------- \title{\begin{center}Title Goes Here\end{center}} % The article title \author{ \begin{center} \authorstyle{Antonius W. Torode\textsuperscript{1,2,3,4}} % Authors \newline\newline % Space before institutions \textsuperscript{1}\institution{Engineering Scientist Associate, University of Texas: Austin}\\ \textsuperscript{2}\institution{Degree in Biblical Studies, Ambassador Bible College}\\ \textsuperscript{3}\institution{Bachelors of Physics, Michigan State University}\\ \textsuperscript{4}\institution{Bachelors of Mathematics, Michigan State University}\\ \end{center} } \date{} % Add a date here if you would like one to appear underneath the title block, use \today for the current date, leave empty for no date %---------------------------------------------------------------------------------------- \begin{document} \maketitle % Print the title %---------------------------------------------------------------------------------------- % ABSTRACT %---------------------------------------------------------------------------------------- \abstract{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce maximus nisi ligula. Morbi laoreet ex ligula, vitae lobortis purus mattis vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec ac metus ut turpis mollis placerat et nec enim. Duis tristique nibh maximus faucibus facilisis. Praesent in consequat leo. Maecenas condimentum ex rhoncus, elementum diam vel, malesuada ante.} %---------------------------------------------------------------------------------------- % ARTICLE CONTENTS %---------------------------------------------------------------------------------------- \section{Section 1} This sentence requires citation \citep{dirac}. This sentence requires multiple citations to imply that it is better supported \citep{knuthwebsite,knuth-fa}. Finally, when conducting an appeal to authority, it can be useful to cite a reference in-text, much like \cite{einstein} do quite a bit. Oh, and make sure to check out the bear in Figure \ref{bear}\footnote{This is a reference}. \subsection{Subsection 1} \bluebox{ Fancy Box }{\lipsum[1]}{17} \lipsum[1-2] \begin{itemize} \item First item in a list \item Second item in a list \item Third item in a list \end{itemize} \lipsum[2] Nam dui ligula, fringilla a, euismod sodales, sollic-itudin vel, wisi. Morbi auctor lorem non justo.\vspace{17\baselineskip} Namlacus libero, pretium at, lobortis vitae, ultricies et,tellus. Donec aliquet, tortor sed accumsan biben-dum, erat ligula aliquet magna, vitae ornare odiometus a mi. Morbi ac orci et nisl hendrerit mollis.Suspendisse ut massa. Cras nec ante. Pellentesquea nulla. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquamtincidunt urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.Nam dui ligula, fringilla a, euismod sodales, sollic-itudin vel, wisi. Morbi\footnote{ Pellentesquea nulla. Cum sociis natoque penatibus et magnis dispar turient montes, nascetur ridiculus mus. Aliquamtincidunt urna. Nulla ullamcorper vestibulum turpis.Pellentesque cursus luctus mauris.} auctor lorem non justo. Namlacus libero, pretium at, lobortis vitae, ultricies et,tellus. Donec aliquet, tortor sed accumsan biben-dum, erat ligula aliquet magna, vitae ornare odiometus a mi. Morbi ac orci et nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesquea nulla. Cum sociis natoque penatibus et magnis dispar turient montes, nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris. \begin{description} \item[First] This is the first item \item[Last] This is the last item \end{description} %------------------------------------------------ \subsection{Subsection 2} \lipsum[5] \begin{enumerate} \item First numbered item in a list \item Second numbered item in a list \item Third numbered item in a list \end{enumerate} %------------------------------------------------ \section{Section 2} \begin{figure} \includegraphics[width=\linewidth]{bear.jpg} % Figure image \caption{A majestic grizzly bear} % Figure caption \label{bear} % Label for referencing with \ref{bear} \end{figure} \lipsum[6-10] \begin{table} \caption{Example table} \centering \begin{tabular}{llr} \toprule \multicolumn{2}{c}{Name} \\ \cmidrule(r){1-2} First Name & Last Name & Grade \\ \midrule John & Doe & $7.5$ \\ Richard & Miles & $5$ \\ \bottomrule \end{tabular} \end{table} \lipsum[11] In mathematics, the Pythagorean theorem, also known as Pythagoras' theorem, is a relation in Euclidean geometry among the three sides of a right triangle. \begin{fancybox}[Pythagoras' theorem]{thm:pythagoras} In a right triangle, the square of the hypotenuse is equal to the sum of the squares of the catheti. $$a^2+b^2=c^2$$ \end{fancybox} \lipsum[11-18] \begin{formal} Some text goes here. Perhaps a cool quote or fancy tidbit of information. \end{formal} \lipsum[18-24] \imagebox{Title of Box}{Here's some information to put in this box. The background of this box is an image.} %---------------------------------------------------------------------------------------- % BIBLIOGRAPHY %---------------------------------------------------------------------------------------- \section{References} \begingroup \let\clearpage\relax \pagestyle{fancy} \printbibliography[heading=none] \endgroup %---------------------------------------------------------------------------------------- \end{document}
module Test.Data.CatList import Test.Assert import Data.CatQueue import Data.CatList %access public export ------------------------------------------------------------------------------- foo : CatList Nat foo = CatCons 1 (MkCatQueue [(CatCons 2 (MkCatQueue [(CatCons 3 (MkCatQueue [] []))] []) )] []) showFoo : IO () showFoo = assertEq (show foo) "CatCons 1 MkCatQueue [CatCons 2 MkCatQueue [CatCons 3 MkCatQueue [] []] []] []"
theory TheoremD14 imports TheoremD13 begin context LocalLexing begin lemma empty_tokens_of_empty[simp]: "empty_tokens {} = {}" using empty_tokens_is_filter by blast lemma items_le_split_via_eq: "items_le (Suc k) J = items_le k J \<union> items_eq (Suc k) J" by (auto simp add: items_le_def items_eq_def) lemma paths_le_split_via_eq: "paths_le (Suc k) P = paths_le k P \<union> paths_eq (Suc k) P" by (auto simp add: paths_le_def paths_eq_def) lemma natUnion_superset: shows "g i \<subseteq> natUnion g" by (meson natUnion_elem subset_eq) definition indexle :: "nat \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> bool" where "indexle k' u' k u = ((indexlt k' u' k u) \<or> (k' = k \<and> u' = u))" definition produced_by_scan_step :: "item \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> bool" where "produced_by_scan_step x k u = (\<exists> k' u' y X. indexle k' u' k u \<and> y \<in> \<J> k' u' \<and> item_end y = k' \<and> X \<in> (\<T> k' u') \<and> x = inc_item y (k' + length (chars_of_token X)) \<and> next_symbol y = Some (terminal_of_token X))" lemma indexle_trans: "indexle k'' u'' k' u' \<Longrightarrow> indexle k' u' k u \<Longrightarrow> indexle k'' u'' k u" using indexle_def indexlt_trans proof - assume a1: "indexle k'' u'' k' u'" assume a2: "indexle k' u' k u" then have f3: "\<And>n na. u' = u \<or> indexlt n na k u \<or> \<not> indexlt n na k' u'" by (meson indexle_def indexlt_trans) have "\<And>n na. k' = k \<or> indexlt n na k u \<or> \<not> indexlt n na k' u'" using a2 by (meson indexle_def indexlt_trans) then show ?thesis using f3 a2 a1 indexle_def by auto qed lemma produced_by_scan_step_trans: assumes "indexle k' u' k u" assumes "produced_by_scan_step x k' u'" shows "produced_by_scan_step x k u" proof - from iffD1[OF produced_by_scan_step_def assms(2)] obtain k'a u'a y X where produced_k'_u': "indexle k'a u'a k' u' \<and> y \<in> \<J> k'a u'a \<and> item_end y = k'a \<and> X \<in> \<T> k'a u'a \<and> x = inc_item y (k'a + length (chars_of_token X)) \<and> next_symbol y = Some (terminal_of_token X)" by blast then show ?thesis using indexle_trans assms(1) produced_by_scan_step_def by blast qed lemma \<J>_induct[consumes 1, case_names Induct]: assumes "x \<in> \<J> k u" assumes induct: "\<And> x k u . (\<And> x' k' u'. x' \<in> \<J> k' u' \<Longrightarrow> indexlt k' u' k u \<Longrightarrow> P x' k' u') \<Longrightarrow> x \<in> \<J> k u \<Longrightarrow> P x k u" shows "P x k u" proof - let ?R = "indexlt_rel <*lex*> {}" have wf_R: "wf ?R" by (auto simp add: wf_indexlt_rel) let ?P = "\<lambda> a. snd a \<in> \<J> (fst (fst a)) (snd (fst a)) \<longrightarrow> P (snd a) (fst (fst a)) (snd (fst a))" have "x \<in> \<J> k u \<longrightarrow> P x k u" apply (rule wf_induct[OF wf_R, where P = ?P and a = "((k, u), x)", simplified]) apply (auto simp add: indexlt_def[symmetric]) apply (rule_tac x=ba and k=a and u=b in induct) by auto thus ?thesis using assms by auto qed lemma \<pi>_no_tokens_item_end: assumes x_in_\<pi>: "x \<in> \<pi> k {} I" shows "item_end x = k \<or> x \<in> I" proof - have x_in_limit: "x \<in> limit (\<lambda>I. Complete k (Predict k I)) I" using x_in_\<pi> \<pi>_no_tokens by auto then show ?thesis proof (induct rule: limit_induct) case (Init x) then show ?case by auto next case (Iterate x J) from Iterate(2) have "item_end x = k \<or> x \<in> Predict k J" using Complete_item_end by auto then show ?case proof (induct rule: disjCases2) case 1 then show ?case by blast next case 2 then have "item_end x = k \<or> x \<in> J" using Predict_item_end by auto then show ?case proof (induct rule: disjCases2) case 1 then show ?case by blast next case 2 then show ?case using Iterate(1)[OF 2] by blast qed qed qed qed lemma natUnion_ex: "x \<in> natUnion f \<Longrightarrow> \<exists> i. x \<in> f i" by (metis (no_types, hide_lams) mk_disjoint_insert natUnion_superset natUnion_upperbound subsetCE subset_insert) lemma locate_in_limit: assumes x_in_limit: "x \<in> limit f X" assumes x_notin_X: "x \<notin> X" shows "\<exists> n. x \<in> funpower f (Suc n) X \<and> x \<notin> funpower f n X" proof - have "\<exists> N. x \<in> funpower f N X" using x_in_limit limit_def natUnion_ex by fastforce then obtain N where N: "x \<in> funpower f N X" by blast { fix n :: nat have "x \<in> funpower f n X \<Longrightarrow> \<exists> m < n. x \<in> funpower f (Suc m) X \<and> x \<notin> funpower f m X" proof (induct n) case 0 with x_notin_X show ?case by auto next case (Suc n) have "x \<notin> funpower f n X \<or> x \<in> funpower f n X" by blast then show ?case proof (induct rule: disjCases2) case 1 then show ?case using Suc by fastforce next case 2 from Suc(1)[OF 2] show ?case using less_SucI by blast qed qed } with N show ?thesis by auto qed lemma produced_by_scan_step: "x \<in> \<J> k u \<Longrightarrow> item_end x > k \<Longrightarrow> produced_by_scan_step x k u" proof (induct rule: \<J>_induct) case (Induct x k u) have "(k = 0 \<and> u = 0) \<or> (k > 0 \<and> u = 0) \<or> (u > 0)" by arith then show ?case proof (induct rule: disjCases3) case 1 with Induct have "item_end x = 0" using \<J>_0_0_item_end by blast with Induct have "False" by arith then show ?case by blast next case 2 then obtain k' where k': "k = Suc k'" using Suc_pred' by blast with Induct 2 have "x \<in> \<J> (Suc k') 0" by auto then have "x \<in> \<pi> k {} (\<I> k')" by (simp add: k') then have "item_end x = k \<or> x \<in> \<I> k'" using \<pi>_no_tokens_item_end by blast then show ?case proof (induct rule: disjCases2) case 1 with Induct have "False" by auto then show ?case by blast next case 2 then have "\<exists> u'. x \<in> \<J> k' u'" using \<I>.simps natUnion_ex by fastforce then obtain u' where u': "x \<in> \<J> k' u'" by blast have k'_bound: "k' < item_end x" using k' Induct by arith have indexlt: "indexlt k' u' k u" by (simp add: indexlt_simp k') from Induct(1)[OF u' this k'_bound] have pred_produced: "produced_by_scan_step x k' u'" . then show ?case using indexlt produced_by_scan_step_trans indexle_def by blast qed next case 3 then have ex_u': "\<exists> u'. u = Suc u'" by arith then obtain u' where u': "u = Suc u'" by blast with Induct have "x \<in> \<J> k (Suc u')" by metis then have x_in_\<pi>: "x \<in> \<pi> k (\<T> k u) (\<J> k u')" using u' \<J>.simps by metis have "x \<in> \<J> k u' \<or> x \<notin> \<J> k u'" by blast then show ?case proof (induct rule: disjCases2) case 1 have indexlt: "indexlt k u' k u" by (simp add: indexlt_simp u') with Induct(1)[OF 1 indexlt Induct(3)] show ?case using indexle_def produced_by_scan_step_trans by blast next case 2 have item_end_x: "k < item_end x" using Induct by auto obtain f where f: "f = Scan (\<T> k u) k \<circ> Complete k \<circ> Predict k" by blast have "x \<in> limit f (\<J> k u')" using x_in_\<pi> \<pi>_functional f by simp from locate_in_limit[OF this 2] obtain n where n: "x \<in> funpower f (Suc n) (\<J> k u') \<and> x \<notin> funpower f n (\<J> k u')" by blast obtain Y where Y: "Y = funpower f n (\<J> k u')" by blast have x_f_Y: "x \<in> f Y \<and> x \<notin> Y" using Y n by auto then have "x \<in> Scan (\<T> k u) k (Complete k (Predict k Y))" using comp_apply f by simp then have "x \<in> (Complete k (Predict k Y)) \<or> x \<in> { inc_item x' (k + length c) | x' t c. x' \<in> bin (Complete k (Predict k Y)) k \<and> (t, c) \<in> (\<T> k u) \<and> next_symbol x' = Some t }" using Scan_def by simp then show ?case proof (induct rule: disjCases2) case 1 then have "False" using item_end_x x_f_Y Complete_item_end Predict_item_end using less_not_refl3 by blast then show ?case by auto next case 2 have "Y \<subseteq> limit f (\<J> k u')" using Y limit_def natUnion_superset by fastforce then have "Y \<subseteq> \<pi> k (\<T> k u) (\<J> k u')" using f by (simp add: \<pi>_functional) then have Y_in_\<J>: "Y \<subseteq> \<J> k u" using u' by simp then have in_\<J>: "Complete k (Predict k Y) \<subseteq> \<J> k u" proof - (* automatically generated *) have f1: "\<forall>f I Ia i. (\<not> mono f \<or> \<not> (I::item set) \<subseteq> Ia \<or> (i::item) \<notin> f I) \<or> i \<in> f Ia" by (meson mono_subset_elem) obtain ii :: "item set \<Rightarrow> item set \<Rightarrow> item" where "\<forall>x0 x1. (\<exists>v2. v2 \<in> x1 \<and> v2 \<notin> x0) = (ii x0 x1 \<in> x1 \<and> ii x0 x1 \<notin> x0)" by moura then have f2: "\<forall>I Ia. ii Ia I \<in> I \<and> ii Ia I \<notin> Ia \<or> I \<subseteq> Ia" by blast obtain nn :: nat where f3: "u = Suc nn" using ex_u' by presburger moreover { assume "ii (\<J> k u) (Complete k (Predict k Y)) \<in> Complete k (\<pi> k (\<T> k (Suc nn)) (\<J> k nn))" then have ?thesis using f3 f2 Complete_\<pi>_fix by auto } ultimately show ?thesis using f2 f1 by (metis (full_types) Complete_regular Predict_\<pi>_fix Predict_regular \<J>.simps(2) Y_in_\<J> regular_implies_mono) qed from 2 obtain x' t c where x'_t_c: "x = inc_item x' (k + length c) \<and> x' \<in> bin (Complete k (Predict k Y)) k \<and> (t, c) \<in> \<T> k u \<and> next_symbol x' = Some t" by blast show ?case apply (simp add: produced_by_scan_step_def) apply (rule_tac x=k in exI) apply (rule_tac x=u in exI) apply (simp add: indexle_def) apply (rule_tac x=x' in exI) apply auto using x'_t_c bin_def in_\<J> apply auto[1] using x'_t_c bin_def apply blast apply (rule_tac x=t in exI) apply (rule_tac x=c in exI) using x'_t_c by auto qed qed qed qed lemma limit_single_step: assumes "x \<in> f X" shows "x \<in> limit f X" by (metis assms elem_limit_simp funpower.simps(1) funpower.simps(2)) lemma Gen_union: "Gen (A \<union> B) = Gen A \<union> Gen B" by (simp add: Gen_def, blast) lemma is_prefix_Prefixes_subset: assumes "is_prefix q p" shows "Prefixes q \<subseteq> Prefixes p" proof - show ?thesis apply (auto simp add: Prefixes_def) using assms by (metis is_prefix_append is_prefix_def) qed lemma Prefixes_subset_\<P>: assumes "p \<in> \<P> k u" shows "Prefixes p \<subseteq> \<P> k u" using Prefixes_is_prefix assms prefixes_are_paths by blast lemma Prefixes_subset_paths_le: assumes "Prefixes p \<subseteq> P" shows "Prefixes p \<subseteq> paths_le (charslength p) P" using Prefixes_is_prefix assms charslength_of_prefix paths_le_def by auto lemma Scan_\<J>_subset_\<J>: "Scan (\<T> k (Suc u)) k (\<J> k u) \<subseteq> \<J> k (Suc u)" by (metis (no_types, lifting) Scan_\<pi>_fix \<J>.simps(2) \<J>_subset_Suc_u monoD mono_Scan) lemma subset_\<J>k: "u \<le> v \<Longrightarrow> \<J> k u \<subseteq> \<J> k v" thm \<J>_subset_Suc_u by (rule subset_fSuc, rule \<J>_subset_Suc_u) lemma subset_\<J>\<I>k: "\<J> k u \<subseteq> \<I> k" by (auto simp add: natUnion_def) lemma subset_\<I>\<J>Suc: "\<I> k \<subseteq> \<J> (Suc k) u" proof - have a: "\<I> k \<subseteq> \<J> (Suc k) 0" apply (simp only: \<J>.simps) using \<pi>_apply_setmonotone by blast show ?thesis apply (case_tac "u = 0") apply (simp only: a) apply (rule subset_trans[OF a subset_\<J>k]) by auto qed lemma subset_\<I>Suc: "\<I> k \<subseteq> \<I> (Suc k)" by (rule subset_trans[OF subset_\<I>\<J>Suc subset_\<J>\<I>k]) lemma subset_\<I>: "i \<le> j \<Longrightarrow> \<I> i \<subseteq> \<I> j" by (rule subset_fSuc[where u=i and v=j and f = \<I>, OF subset_\<I>Suc]) lemma subset_\<J> : assumes leq: "k' < k \<or> (k' = k \<and> u' \<le> u)" shows "\<J> k' u' \<subseteq> \<J> k u" proof - from leq show ?thesis proof (induct rule: disjCases2) case 1 have s1: "\<J> k' u' \<subseteq> \<I> k'" by (rule_tac subset_\<J>\<I>k) have s2: "\<I> k' \<subseteq> \<I> (k - 1)" apply (rule_tac subset_\<I>) using 1 by arith from subset_\<I>\<J>Suc[where k="k - 1"] 1 have s3: "\<I> (k - 1) \<subseteq> \<J> k 0" by simp have s4: "\<J> k 0 \<subseteq> \<J> k u" by (rule_tac subset_\<J>k, simp) from s1 s2 s3 s4 subset_trans show ?case by blast next case 2 thus ?case by (simp add : subset_\<J>k) qed qed lemma \<J>_subset: assumes "indexle k' u' k u" shows "\<J> k' u' \<subseteq> \<J> k u" using subset_\<J> indexle_def indexlt_simp by (metis assms less_imp_le_nat order_refl) lemma Scan_items_le: assumes bounded_T: "\<And> t . t \<in> T \<Longrightarrow> length (chars_of_token t) \<le> l" shows "Scan T k (items_le k P) \<subseteq> items_le (k + l) (Scan T k P)" proof - { fix x :: item assume x_dom: "x \<in> Scan T k (items_le k P)" then have x_dom': "x \<in> Scan T k P" by (meson items_le_is_filter mono_Scan mono_subset_elem) from x_dom have "x \<in> items_le k P \<or> (\<exists> y t c. x = inc_item y (k + length c) \<and> y \<in> bin (items_le k P) k \<and> (t, c) \<in> T \<and> next_symbol y = Some t)" using Scan_def using UnE mem_Collect_eq by auto then have "item_end x \<le> k + l" proof (induct rule: disjCases2) case 1 then show ?case by (meson items_le_fix_D items_le_idempotent trans_le_add1) next case 2 then obtain y t c where y: "x = inc_item y (k + length c) \<and> y \<in> bin (items_le k P) k \<and> (t, c) \<in> T \<and> next_symbol y = Some t" by blast then have item_end_x: "item_end x = (k + length c)" by simp from bounded_T y have "length c \<le> l" using chars_of_token_simp by auto with item_end_x show ?case by arith qed with x_dom' have "x \<in> items_le (k + l) (Scan T k P)" using items_le_def mem_Collect_eq by blast } then show ?thesis by blast qed lemma Scan_mono_tokens: "P \<subseteq> Q \<Longrightarrow> Scan P k I \<subseteq> Scan Q k I" by (auto simp add: Scan_def) theorem thmD14: "k \<le> length Doc \<Longrightarrow> items_le k (\<J> k u) = Gen (paths_le k (\<P> k u)) \<and> \<T> k u = \<Z> k u \<and> items_le k (\<I> k) = Gen (paths_le k (\<Q> k))" proof (induct k arbitrary: u rule: less_induct) case (less k) have "k = 0 \<or> k \<noteq> 0" by arith then show ?case proof (induct rule: disjCases2) case 1 have \<J>_eq_\<P>: "items_le k (\<J> k 0) = Gen (paths_le k (\<P> k 0))" by (simp only: 1 thmD8 items_le_paths_le) show ?case using thmD13[OF \<J>_eq_\<P> less.prems] by blast next case 2 have "\<exists> k'. k = Suc k'" using 2 by arith then obtain k' where k': "k = Suc k'" by blast have k'_less_k: "k' < k" using k' by arith have "items_le k (\<J> k 0) = Gen (paths_le k (\<P> k 0))" proof - have simp_left: "items_le k (\<J> k 0) = \<pi> k {} (items_le k (\<I> k'))" using items_le_\<pi>_swap k' wellformed_items_\<I> by auto have simp_right: "Gen (paths_le k (\<P> k 0)) = natUnion (\<lambda> v. Gen (paths_le k (\<P> k' v)))" by (simp add: k' paths_le_pointwise pointwise_Gen pointwise_natUnion_swap) { fix v :: nat have split_\<J>: "items_le k (\<J> k' v) = items_le k' (\<J> k' v) \<union> items_eq k (\<J> k' v)" using k' items_le_split_via_eq by blast have sub1: "items_le k' (\<J> k' v) \<subseteq> natUnion (\<lambda> v. Gen (paths_le k (\<P> k' v)))" proof - have h: "items_le k' (\<J> k' v) \<subseteq> Gen (paths_le k (\<P> k' v))" proof - (* automatically generated *) have f1: "items_le k' (Gen (\<P> k' v)) \<union> items_eq (Suc k') (Gen (\<P> k' v)) = Gen (paths_le k (\<P> k' v))" using LocalLexing.items_le_split_via_eq LocalLexing_axioms items_le_paths_le k' by blast have "k' \<le> length Doc" by (metis (no_types) dual_order.trans k' less.prems lessI less_imp_le_nat) then have "items_le k' (\<J> k' v) = items_le k' (Gen (\<P> k' v))" by (simp add: items_le_paths_le k' less.hyps) then show ?thesis using f1 by blast qed have "Gen (paths_le k (\<P> k' v)) \<subseteq> natUnion (\<lambda> v. Gen (paths_le k (\<P> k' v)))" using natUnion_superset by fastforce then show ?thesis using h by blast qed { fix x :: item assume x_dom: "x \<in> items_eq k (\<J> k' v)" have x_in_\<J>: "x \<in> \<J> k' v" using x_dom items_eq_def by auto have item_end_x: "item_end x = k" using x_dom items_eq_def by auto then have k'_bound: "k' < item_end x" using k' by arith from produced_by_scan_step[OF x_in_\<J> k'_bound] have "produced_by_scan_step x k' v" . from iffD1[OF produced_by_scan_step_def this] obtain k'' v'' y X where scan_step: "indexle k'' v'' k' v \<and> y \<in> \<J> k'' v'' \<and> item_end y = k'' \<and> X \<in> \<T> k'' v'' \<and> x = inc_item y (k'' + length (chars_of_token X)) \<and> next_symbol y = Some (terminal_of_token X)" by blast then have y_in_items_le: "y \<in> items_le k'' (\<J> k'' v'')" using items_le_def LocalLexing_axioms le_refl mem_Collect_eq by blast have y_in_Gen: "y \<in> Gen(paths_le k'' (\<P> k'' v''))" proof - (* automatically generated *) have f1: "\<And>n. k' < n \<or> \<not> k < n" using Suc_lessD k' by blast have f2: "k'' = k' \<or> k'' < k'" using indexle_def indexlt_simp scan_step by force have f3: "k' < k" using k' by blast have f4: "k' \<le> length Doc" using f1 by (meson less.prems less_Suc_eq_le) have "k'' \<le> length Doc \<or> k' = k''" using f2 f1 by (meson Suc_lessD less.prems less_Suc_eq_le less_trans_Suc) then show ?thesis using f4 f3 f2 Suc_lessD y_in_items_le less.hyps less_trans_Suc by blast qed then have "\<exists> p. p \<in> \<P> k'' v'' \<and> pvalid p y" by (meson Gen_implies_pvalid paths_le_is_filter rev_subsetD) then obtain p where p: "p \<in> \<P> k'' v'' \<and> pvalid p y" by blast then have charslength_p: "charslength p = k''" using pvalid_item_end scan_step by auto have pvalid_p_y: "pvalid p y" using p by blast have "admissible (p@[(fst X, snd X)])" apply (rule pvalid_next_terminal_admissible) apply (rule pvalid_p_y) using scan_step apply (simp add: terminal_of_token_def) using scan_step by (metis TokensAt_subset_\<X> \<T>_subset_TokensAt \<X>_are_terminals rev_subsetD terminal_of_token_def) then have admissible_p_X: "admissible (p@[X])" by simp have X_in_\<Z>: "X \<in> \<Z> k'' (Suc v'')" by (metis (no_types, lifting) Suc_lessD \<Z>_subset_Suc k'_bound dual_order.trans indexle_def indexlt_simp item_end_of_inc_item item_end_x le_add1 le_neq_implies_less less.hyps less.prems not_less_eq scan_step subsetCE) have pX_in_\<P>_k''_v'': "p@[X] \<in> \<P> k'' (Suc v'')" apply (simp only: \<P>.simps) apply (rule limit_single_step) apply (auto simp only: Append_def) apply (rule_tac x=p in exI) apply (rule_tac x=X in exI) apply (simp only: admissible_p_X X_in_\<Z>) using charslength_p p by auto have "indexle k'' v'' k' v" using scan_step by simp then have "indexle k'' (Suc v'') k' (Suc v)" by (simp add: indexle_def indexlt_simp) then have "\<P> k'' (Suc v'') \<subseteq> \<P> k' (Suc v)" by (metis indexle_def indexlt_simp less_or_eq_imp_le subset_\<P>) with pX_in_\<P>_k''_v'' have pX_in_\<P>_k': "p@[X] \<in> \<P> k' (Suc v)" by blast have "charslength (p@[X]) = k'' + length (chars_of_token X)" using charslength_p by auto then have "charslength (p@[X]) = item_end x" using scan_step by simp then have charslength_p_X: "charslength (p@[X]) = k" using item_end_x by simp then have pX_dom: "p@[X] \<in> paths_le k (\<P> k' (Suc v))" using lessI less_Suc_eq_le mem_Collect_eq pX_in_\<P>_k' paths_le_def by auto have wellformed_x: "wellformed_item x" using item_end_x less.prems scan_step wellformed_inc_item wellformed_items_\<J> wellformed_items_def by auto have wellformed_p_X: "wellformed_tokens (p@[X])" using \<P>_wellformed pX_in_\<P>_k''_v'' by blast from iffD1[OF pvalid_def pvalid_p_y] obtain r \<gamma> where r_\<gamma>: "wellformed_tokens p \<and> wellformed_item y \<and> r \<le> length p \<and> charslength p = item_end y \<and> charslength (take r p) = item_origin y \<and> is_derivation (terminals (take r p) @ [item_nonterminal y] @ \<gamma>) \<and> derives (item_\<alpha> y) (terminals (drop r p))" by blast have r_le_p: "r \<le> length p" by (simp add: r_\<gamma>) have item_nonterminal_x: "item_nonterminal x = item_nonterminal y" by (simp add: scan_step) have item_\<alpha>_x: "item_\<alpha> x = (item_\<alpha> y) @ [terminal_of_token X]" by (simp add: item_\<alpha>_of_inc_item r_\<gamma> scan_step) have pvalid_x: "pvalid (p@[X]) x" apply (auto simp add: pvalid_def wellformed_x wellformed_p_X) apply (rule_tac x=r in exI) apply auto apply (simp add: le_SucI r_\<gamma>) using r_\<gamma> scan_step apply auto[1] using r_\<gamma> scan_step apply auto[1] apply (rule_tac x=\<gamma> in exI) apply (simp add: r_le_p item_nonterminal_x) using r_\<gamma> apply simp apply (simp add: r_le_p item_\<alpha>_x) by (metis terminals_singleton append_Nil2 derives_implies_leftderives derives_is_sentence is_sentence_concat is_sentence_cons is_symbol_def is_word_append is_word_cons is_word_terminals is_word_terminals_drop leftderives_implies_derives leftderives_padback leftderives_refl r_\<gamma> terminals_append terminals_drop wellformed_p_X) then have "x \<in> Gen (paths_le k (\<P> k' (Suc v)))" using pX_dom Gen_def LocalLexing_axioms mem_Collect_eq by auto } then have sub2: "items_eq k (\<J> k' v) \<subseteq> natUnion (\<lambda> v. Gen (paths_le k (\<P> k' v)))" by (meson dual_order.trans natUnion_superset subsetI) have suffices3: "items_le k (\<J> k' v) \<subseteq> natUnion (\<lambda> v. Gen (paths_le k (\<P> k' v)))" using split_\<J> sub1 sub2 by blast have "items_le k (\<J> k' v) \<subseteq> Gen (paths_le k (\<P> k 0))" using suffices3 simp_right by blast } note suffices2 = this have items_le_natUnion_swap: "items_le k (\<I> k') = natUnion(\<lambda> v. items_le k (\<J> k' v))" by (simp add: items_le_pointwise pointwise_natUnion_swap) then have suffices1: "items_le k (\<I> k') \<subseteq> Gen (paths_le k (\<P> k 0))" using suffices2 natUnion_upperbound by metis have sub_lemma: "items_le k (\<J> k 0) \<subseteq> Gen (paths_le k (\<P> k 0))" proof - have "items_le k (\<J> k 0) \<subseteq> Gen (\<P> k 0)" apply (subst simp_left) apply (rule thmD5) apply (auto simp only: less) using suffices1 items_le_is_filter items_le_paths_le subsetCE by blast then show ?thesis by (simp add: items_le_idempotent remove_paths_le_in_subset_Gen) qed have eq1: "\<pi> k {} (items_le k (\<I> k')) = \<pi> k {} (items_le k (natUnion (\<J> k')))" by simp then have eq2: "\<pi> k {} (items_le k (natUnion (\<J> k'))) = \<pi> k {} (natUnion (\<lambda> v. items_le k (\<J> k' v)))" using items_le_natUnion_swap by auto from simp_left eq1 eq2 have simp_left': "items_le k (\<J> k 0) = \<pi> k {} (natUnion (\<lambda> v. items_le k (\<J> k' v)))" by metis { fix v :: nat fix q :: "token list" fix x :: item assume q_dom: "q \<in> paths_eq k (\<P> k' v)" assume pvalid_q_x: "pvalid q x" have q_in_\<P>: "q \<in> \<P> k' v" using q_dom paths_eq_def by auto have charslength_q: "charslength q = k" using q_dom paths_eq_def by auto with k'_less_k have q_nonempty: "q \<noteq> []" using "2.hyps" chars.simps(1) charslength.simps list.size(3) by auto then have "\<exists> p X. q = p @ [X]" by (metis append_butlast_last_id) then obtain p X where pX: "q = p @ [X]" by blast from last_step_of_path[OF q_in_\<P> pX] obtain k'' v'' where k'': "indexlt k'' v'' k' v \<and> q \<in> \<P> k'' (Suc v'') \<and> charslength p = k'' \<and> X \<in> \<Z> k'' (Suc v'')" by blast have h1: "p \<in> \<PP>" by (metis (no_types, lifting) LocalLexing.\<PP>_covers_\<P> LocalLexing_axioms append_Nil2 is_prefix_cancel is_prefix_empty pX prefixes_are_paths q_in_\<P> subsetCE) have h2: "charslength p = k''" using k'' by blast obtain T where T: "T = {X}" by blast have h3: "X \<in> T" using T by blast have h4: "T \<subseteq> \<X> k''" using \<Z>_subset_\<X> T k'' by blast obtain N where N: "N = item_nonterminal x" by blast obtain \<alpha> where \<alpha>: "\<alpha> = item_\<alpha> x" by blast obtain \<beta> where \<beta>: "\<beta> = item_\<beta> x" by blast have wellformed_x: "wellformed_item x" using pvalid_def pvalid_q_x by blast then have h5: "(N, \<alpha> @ \<beta>) \<in> \<RR>" using N \<alpha> \<beta> item_nonterminal_def item_rhs_def item_rhs_split prod.collapse wellformed_item_def by auto have pvalid_left_q_x: "pvalid_left q x" using pvalid_q_x by (simp add: pvalid_left) from iffD1[OF pvalid_left_def pvalid_left_q_x] obtain r \<gamma> where r_\<gamma>: "wellformed_tokens q \<and> wellformed_item x \<and> r \<le> length q \<and> charslength q = item_end x \<and> charslength (take r q) = item_origin x \<and> is_leftderivation (terminals (take r q) @ [item_nonterminal x] @ \<gamma>) \<and> leftderives (item_\<alpha> x) (terminals (drop r q))" by blast have h6: "r \<le> length q" using r_\<gamma> by blast have h7: "leftderives [\<SS>] (terminals (take r q) @ [N] @ \<gamma>)" using r_\<gamma> N is_leftderivation_def by blast have h8: "leftderives \<alpha> (terminals (drop r q))" using r_\<gamma> \<alpha> by metis have h9: "k = k'' + length (chars_of_token X)" using r_\<gamma> using charslength_q h2 pX by auto have h10: "x = Item (N, \<alpha> @ \<beta>) (length \<alpha>) (charslength (take r q)) k" by (metis N \<alpha> \<beta> charslength_q item.collapse item_dot_is_\<alpha>_length item_nonterminal_def item_rhs_def item_rhs_split prod.collapse r_\<gamma>) from thmD11[OF h1 h2 h3 h4 pX h5 h6 h7 h8 h9 h10] have "x \<in> items_le k (\<pi> k {} (Scan T k'' (Gen (Prefixes p))))" by blast then have x_in: "x \<in> \<pi> k {} (Scan T k'' (Gen (Prefixes p)))" using items_le_is_filter by blast have subset1: "Prefixes p \<subseteq> Prefixes q" apply (rule is_prefix_Prefixes_subset) by (simp add: pX is_prefix_def) have subset2: "Prefixes q \<subseteq> \<P> k'' (Suc v'')" apply (rule Prefixes_subset_\<P>) using k'' by blast from subset1 subset2 have "Prefixes p \<subseteq> \<P> k'' (Suc v'')" by blast then have "Prefixes p \<subseteq> paths_le k'' (\<P> k'' (Suc v''))" using k'' Prefixes_subset_paths_le by blast then have subset3: "Gen (Prefixes p) \<subseteq> Gen (paths_le k'' (\<P> k'' (Suc v'')))" using Gen_def LocalLexing_axioms by auto have k''_less_k: "k'' < k" using k'' k' using indexlt_simp less_Suc_eq by auto then have k''_Doc_bound: "k'' \<le> length Doc" using less by auto from less(1)[OF k''_less_k k''_Doc_bound, of "Suc v''"] have induct1: "items_le k'' (\<J> k'' (Suc v'')) = Gen (paths_le k'' (\<P> k'' (Suc v'')))" by blast from less(1)[OF k''_less_k k''_Doc_bound, of "Suc(Suc v'')"] have induct2: "\<T> k'' (Suc (Suc v'')) = \<Z> k'' (Suc (Suc v''))" by blast have subset4: "Gen (Prefixes p) \<subseteq> items_le k'' (\<J> k'' (Suc v''))" using subset3 induct1 by auto from induct1 subset4 have subset6: "Scan T k'' (Gen (Prefixes p)) \<subseteq> Scan T k'' (items_le k'' (\<J> k'' (Suc v'')))" apply (rule_tac monoD[OF mono_Scan]) by blast have "k'' + length (chars_of_token X) = k" by (simp add: h9) have "\<And> t. t \<in> T \<Longrightarrow> length (chars_of_token t) \<le> length (chars_of_token X)" using T by auto from Scan_items_le[of T, OF this, simplified, of k'' "\<J> k'' (Suc v'')"] h9 have subset7: "Scan T k'' (items_le k'' (\<J> k'' (Suc v''))) \<subseteq> items_le k (Scan T k'' (\<J> k'' (Suc v'')))" by simp have "T \<subseteq> \<Z> k'' (Suc (Suc v''))" using T k'' using \<Z>_subset_Suc rev_subsetD singletonD subsetI by blast then have T_subset_\<T>: "T \<subseteq> \<T> k'' (Suc (Suc v''))" using induct2 by auto have subset8: "Scan T k'' (\<J> k'' (Suc v'')) \<subseteq> Scan (\<T> k'' (Suc (Suc v''))) k'' (\<J> k'' (Suc v''))" using T_subset_\<T> Scan_mono_tokens by blast have subset9: "Scan (\<T> k'' (Suc (Suc v''))) k'' (\<J> k'' (Suc v'')) \<subseteq> \<J> k'' (Suc (Suc v''))" by (rule Scan_\<J>_subset_\<J>) have subset10: "(Scan T k'' (\<J> k'' (Suc v''))) \<subseteq> \<J> k'' (Suc (Suc v''))" using subset8 subset9 by blast have "k'' \<le> k'" using k'' indexlt_simp by auto then have "indexle k'' (Suc (Suc v'')) k' (Suc (Suc v''))" using indexlt_simp using indexle_def le_neq_implies_less by auto then have subset11: "\<J> k'' (Suc (Suc v'')) \<subseteq> \<J> k' (Suc (Suc v''))" using \<J>_subset by blast have subset12: "Scan T k'' (\<J> k'' (Suc v'')) \<subseteq> \<J> k' (Suc (Suc v''))" using subset8 subset9 subset10 subset11 by blast then have subset13: "items_le k (Scan T k'' (\<J> k'' (Suc v''))) \<subseteq> items_le k (\<J> k' (Suc (Suc v'')))" using items_le_def mem_Collect_eq rev_subsetD subsetI by auto have subset14: "Scan T k'' (Gen (Prefixes p)) \<subseteq> items_le k (\<J> k' (Suc (Suc v'')))" using subset6 subset7 subset13 by blast then have x_in': "x \<in> \<pi> k {} (items_le k (\<J> k' (Suc (Suc v''))))" using x_in by (meson \<pi>_apply_setmonotone \<pi>_subset_elem_trans subsetCE subsetI) from x_in' have "x \<in> \<pi> k {} (natUnion (\<lambda> v. items_le k (\<J> k' v)))" by (meson k' mono_\<pi> mono_subset_elem natUnion_superset) } note suffices6 = this { fix v :: nat have "Gen (paths_eq k (\<P> k' v)) \<subseteq> \<pi> k {} (natUnion (\<lambda> v. items_le k (\<J> k' v)))" using suffices6 by (meson Gen_implies_pvalid subsetI) } note suffices5 = this { fix v :: nat have "paths_le k (\<P> k' v) = paths_le k' (\<P> k' v) \<union> paths_eq k (\<P> k' v)" using paths_le_split_via_eq k' by metis then have Gen_split: "Gen (paths_le k (\<P> k' v)) = Gen (paths_le k' (\<P> k' v)) \<union> Gen(paths_eq k (\<P> k' v))" using Gen_union by metis have case_le: "Gen (paths_le k' (\<P> k' v)) \<subseteq> \<pi> k {} (natUnion (\<lambda> v. items_le k (\<J> k' v)))" proof - from less k'_less_k have "k' \<le> length Doc" by arith from less(1)[OF k'_less_k this] have "items_le k' (\<J> k' v) = Gen (paths_le k' (\<P> k' v))" by blast then have "Gen (paths_le k' (\<P> k' v)) \<subseteq> natUnion (\<lambda> v. items_le k (\<J> k' v))" using items_le_def LocalLexing_axioms k'_less_k natUnion_superset by fastforce then show ?thesis using \<pi>_apply_setmonotone by blast qed have "Gen (paths_le k (\<P> k' v)) \<subseteq> \<pi> k {} (natUnion (\<lambda> v. items_le k (\<J> k' v)))" using Gen_split case_le suffices5 UnE rev_subsetD subsetI by blast } note suffices4 = this have super_lemma: "Gen (paths_le k (\<P> k 0)) \<subseteq> items_le k (\<J> k 0)" apply (subst simp_right) apply (subst simp_left') using suffices4 by (meson natUnion_ex rev_subsetD subsetI) from super_lemma sub_lemma show ?thesis by blast qed then show ?case using thmD13 less.prems by blast qed qed end end
-- Non-deterministic insert and permutation with choose oracle -- The oracle is passed through the individual functions. open import bool module even-double-eo (Choice : Set) (choose : Choice → 𝔹) (lchoice : Choice → Choice) (rchoice : Choice → Choice) where open import eq open import bool-thms open import nat open import nat-thms open import list ---------------------------------------------------------------------- -- double is deterministic: double : ℕ → ℕ double x = x + x -- even is a deterministic predicate: even : ℕ → 𝔹 even zero = tt even (suc 0) = ff even (suc (suc x)) = even x -- eo yields an even and odd number close to the input value: eo : Choice → ℕ → ℕ eo ch n = if choose ch then n else (suc n) -- auxiliary property for x+x instead of double: even-x+x : ∀ (x : ℕ) → even (x + x) ≡ tt even-x+x zero = refl even-x+x (suc x) rewrite +suc x x | even-x+x x = refl -- (even (double x)) is always true: even-double-is-true : ∀ (x : ℕ) → even (double x) ≡ tt even-double-is-true x rewrite even-x+x x = refl -- (even (double (eo n))) is always true: even-double-eo-is-true : ∀ (ch : Choice) (n : ℕ) → even (double (eo ch n)) ≡ tt even-double-eo-is-true ch n = even-double-is-true (eo ch n) ----------------------------------------------------------------------
State Before: L : Language T : Theory L α : Type w M : Type w' inst✝² : Structure L M inst✝¹ : Nonempty M inst✝ : M ⊨ T p : CompleteType T α ⊢ ∃ M, p ∈ realizedTypes T (↑M) α State After: case intro L : Language T : Theory L α : Type w M✝ : Type w' inst✝² : Structure L M✝ inst✝¹ : Nonempty M✝ inst✝ : M✝ ⊨ T p : CompleteType T α M : ModelType ↑p ⊢ ∃ M, p ∈ realizedTypes T (↑M) α Tactic: obtain ⟨M⟩ := p.isMaximal.1 State Before: case intro L : Language T : Theory L α : Type w M✝ : Type w' inst✝² : Structure L M✝ inst✝¹ : Nonempty M✝ inst✝ : M✝ ⊨ T p : CompleteType T α M : ModelType ↑p ⊢ ∃ M, p ∈ realizedTypes T (↑M) α State After: case intro L : Language T : Theory L α : Type w M✝ : Type w' inst✝² : Structure L M✝ inst✝¹ : Nonempty M✝ inst✝ : M✝ ⊨ T p : CompleteType T α M : ModelType ↑p ⊢ (typeOf T fun a => ↑(Language.con L a)) = p Tactic: refine' ⟨(M.subtheoryModel p.subset).reduct (L.lhomWithConstants α), fun a => (L.con a : M), _⟩ State Before: case intro L : Language T : Theory L α : Type w M✝ : Type w' inst✝² : Structure L M✝ inst✝¹ : Nonempty M✝ inst✝ : M✝ ⊨ T p : CompleteType T α M : ModelType ↑p ⊢ (typeOf T fun a => ↑(Language.con L a)) = p State After: case intro L : Language T : Theory L α : Type w M✝ : Type w' inst✝² : Structure L M✝ inst✝¹ : Nonempty M✝ inst✝ : M✝ ⊨ T p : CompleteType T α M : ModelType ↑p φ : Sentence (L[[α]]) ⊢ (φ ∈ typeOf T fun a => ↑(Language.con L a)) ↔ φ ∈ p Tactic: refine' SetLike.ext fun φ => _ State Before: case intro L : Language T : Theory L α : Type w M✝ : Type w' inst✝² : Structure L M✝ inst✝¹ : Nonempty M✝ inst✝ : M✝ ⊨ T p : CompleteType T α M : ModelType ↑p φ : Sentence (L[[α]]) ⊢ (φ ∈ typeOf T fun a => ↑(Language.con L a)) ↔ φ ∈ p State After: case intro L : Language T : Theory L α : Type w M✝ : Type w' inst✝² : Structure L M✝ inst✝¹ : Nonempty M✝ inst✝ : M✝ ⊨ T p : CompleteType T α M : ModelType ↑p φ : Sentence (L[[α]]) ⊢ (Formula.Realize (↑Formula.equivSentence.symm φ) fun a => ↑(Language.con L a)) ↔ φ ∈ p Tactic: simp only [CompleteType.mem_typeOf] State Before: case intro L : Language T : Theory L α : Type w M✝ : Type w' inst✝² : Structure L M✝ inst✝¹ : Nonempty M✝ inst✝ : M✝ ⊨ T p : CompleteType T α M : ModelType ↑p φ : Sentence (L[[α]]) ⊢ (Formula.Realize (↑Formula.equivSentence.symm φ) fun a => ↑(Language.con L a)) ↔ φ ∈ p State After: case intro L : Language T : Theory L α : Type w M✝ : Type w' inst✝² : Structure L M✝ inst✝¹ : Nonempty M✝ inst✝ : M✝ ⊨ T p : CompleteType T α M : ModelType ↑p φ : Sentence (L[[α]]) ⊢ ↑(ModelType.reduct (lhomWithConstants L α) (ModelType.subtheoryModel M (_ : LHom.onTheory (lhomWithConstants L α) T ⊆ ↑p))) ⊨ φ ↔ ↑M ⊨ φ Tactic: refine' (@Formula.realize_equivSentence_symm_con _ ((M.subtheoryModel p.subset).reduct (L.lhomWithConstants α)) _ _ M.struc _ φ).trans (_root_.trans (_root_.trans _ (p.isMaximal.isComplete.realize_sentence_iff φ M)) (p.isMaximal.mem_iff_models φ).symm) State Before: case intro L : Language T : Theory L α : Type w M✝ : Type w' inst✝² : Structure L M✝ inst✝¹ : Nonempty M✝ inst✝ : M✝ ⊨ T p : CompleteType T α M : ModelType ↑p φ : Sentence (L[[α]]) ⊢ ↑(ModelType.reduct (lhomWithConstants L α) (ModelType.subtheoryModel M (_ : LHom.onTheory (lhomWithConstants L α) T ⊆ ↑p))) ⊨ φ ↔ ↑M ⊨ φ State After: no goals Tactic: rfl
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sébastien Gouëzel, Floris van Doorn, Mario Carneiro -/ import data.list.big_operators /-! # Join of a list of lists This file proves basic properties of `list.join`, which concatenates a list of lists. It is defined in [`data.list.defs`](./data/list/defs). -/ variables {α β : Type*} namespace list attribute [simp] join @[simp] lemma join_nil : [([] : list α)].join = [] := rfl @[simp] lemma join_eq_nil : ∀ {L : list (list α)}, join L = [] ↔ ∀ l ∈ L, l = [] | [] := iff_of_true rfl (forall_mem_nil _) | (l :: L) := by simp only [join, append_eq_nil, join_eq_nil, forall_mem_cons] @[simp] lemma join_append (L₁ L₂ : list (list α)) : join (L₁ ++ L₂) = join L₁ ++ join L₂ := by induction L₁; [refl, simp only [*, join, cons_append, append_assoc]] @[simp] lemma join_filter_empty_eq_ff [decidable_pred (λ l : list α, l.empty = ff)] : ∀ {L : list (list α)}, join (L.filter (λ l, l.empty = ff)) = L.join | [] := rfl | ([] :: L) := by simp [@join_filter_empty_eq_ff L] | ((a :: l) :: L) := by simp [@join_filter_empty_eq_ff L] @[simp] lemma join_filter_ne_nil [decidable_pred (λ l : list α, l ≠ [])] {L : list (list α)} : join (L.filter (λ l, l ≠ [])) = L.join := by simp [join_filter_empty_eq_ff, ← empty_iff_eq_nil] lemma join_join (l : list (list (list α))) : l.join.join = (l.map join).join := by { induction l, simp, simp [l_ih] } @[simp] lemma length_join (L : list (list α)) : length (join L) = sum (map length L) := by induction L; [refl, simp only [*, join, map, sum_cons, length_append]] @[simp] lemma length_bind (l : list α) (f : α → list β) : length (list.bind l f) = sum (map (length ∘ f) l) := by rw [list.bind, length_join, map_map] @[simp] lemma bind_eq_nil {l : list α} {f : α → list β} : list.bind l f = [] ↔ ∀ x ∈ l, f x = [] := join_eq_nil.trans $ by simp only [mem_map, forall_exists_index, and_imp, forall_apply_eq_imp_iff₂] /-- In a join, taking the first elements up to an index which is the sum of the lengths of the first `i` sublists, is the same as taking the join of the first `i` sublists. -/ lemma take_sum_join (L : list (list α)) (i : ℕ) : L.join.take ((L.map length).take i).sum = (L.take i).join := begin induction L generalizing i, { simp }, cases i, { simp }, simp [take_append, L_ih] end /-- In a join, dropping all the elements up to an index which is the sum of the lengths of the first `i` sublists, is the same as taking the join after dropping the first `i` sublists. -/ lemma drop_sum_join (L : list (list α)) (i : ℕ) : L.join.drop ((L.map length).take i).sum = (L.drop i).join := begin induction L generalizing i, { simp }, cases i, { simp }, simp [drop_append, L_ih], end /-- Taking only the first `i+1` elements in a list, and then dropping the first `i` ones, one is left with a list of length `1` made of the `i`-th element of the original list. -/ lemma drop_take_succ_eq_cons_nth_le (L : list α) {i : ℕ} (hi : i < L.length) : (L.take (i+1)).drop i = [nth_le L i hi] := begin induction L generalizing i, { simp only [length] at hi, exact (nat.not_succ_le_zero i hi).elim }, cases i, { simp }, have : i < L_tl.length, { simp at hi, exact nat.lt_of_succ_lt_succ hi }, simp [L_ih this], refl end /-- In a join of sublists, taking the slice between the indices `A` and `B - 1` gives back the original sublist of index `i` if `A` is the sum of the lenghts of sublists of index `< i`, and `B` is the sum of the lengths of sublists of index `≤ i`. -/ lemma drop_take_succ_join_eq_nth_le (L : list (list α)) {i : ℕ} (hi : i < L.length) : (L.join.take ((L.map length).take (i+1)).sum).drop ((L.map length).take i).sum = nth_le L i hi := begin have : (L.map length).take i = ((L.take (i+1)).map length).take i, by simp [map_take, take_take], simp [take_sum_join, this, drop_sum_join, drop_take_succ_eq_cons_nth_le _ hi] end /-- Auxiliary lemma to control elements in a join. -/ lemma sum_take_map_length_lt1 (L : list (list α)) {i j : ℕ} (hi : i < L.length) (hj : j < (nth_le L i hi).length) : ((L.map length).take i).sum + j < ((L.map length).take (i+1)).sum := by simp [hi, sum_take_succ, hj] /-- Auxiliary lemma to control elements in a join. -/ lemma sum_take_map_length_lt2 (L : list (list α)) {i j : ℕ} (hi : i < L.length) (hj : j < (nth_le L i hi).length) : ((L.map length).take i).sum + j < L.join.length := begin convert lt_of_lt_of_le (sum_take_map_length_lt1 L hi hj) (monotone_sum_take _ hi), have : L.length = (L.map length).length, by simp, simp [this, -length_map] end /-- The `n`-th element in a join of sublists is the `j`-th element of the `i`th sublist, where `n` can be obtained in terms of `i` and `j` by adding the lengths of all the sublists of index `< i`, and adding `j`. -/ lemma nth_le_join (L : list (list α)) {i j : ℕ} (hi : i < L.length) (hj : j < (nth_le L i hi).length) : nth_le L.join (((L.map length).take i).sum + j) (sum_take_map_length_lt2 L hi hj) = nth_le (nth_le L i hi) j hj := by rw [nth_le_take L.join (sum_take_map_length_lt2 L hi hj) (sum_take_map_length_lt1 L hi hj), nth_le_drop, nth_le_of_eq (drop_take_succ_join_eq_nth_le L hi)] /-- Two lists of sublists are equal iff their joins coincide, as well as the lengths of the sublists. -/ theorem eq_iff_join_eq (L L' : list (list α)) : L = L' ↔ L.join = L'.join ∧ map length L = map length L' := begin refine ⟨λ H, by simp [H], _⟩, rintros ⟨join_eq, length_eq⟩, apply ext_le, { have : length (map length L) = length (map length L'), by rw length_eq, simpa using this }, { assume n h₁ h₂, rw [← drop_take_succ_join_eq_nth_le, ← drop_take_succ_join_eq_nth_le, join_eq, length_eq] } end end list
/* movstat/test_Qn.c * * Copyright (C) 2018 Patrick Alken * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <gsl/gsl_math.h> #include <gsl/gsl_vector.h> #include <gsl/gsl_statistics.h> #include <gsl/gsl_sort.h> #include <gsl/gsl_test.h> #include <gsl/gsl_movstat.h> /* calculate Q_n statistic for input vector using slow/naive algorithm */ static int slow_movQn(const gsl_movstat_end_t etype, const gsl_vector * x, gsl_vector * y, const int H, const int J) { const size_t n = x->size; const int K = H + J + 1; double *window = malloc(K * sizeof(double)); double *work = malloc(3 * K * sizeof(double)); int *work_int = malloc(5 * K * sizeof(int)); size_t i; for (i = 0; i < n; ++i) { size_t wsize = gsl_movstat_fill(etype, x, i, H, J, window); double Qn; gsl_sort(window, 1, wsize); Qn = gsl_stats_Qn_from_sorted_data(window, 1, wsize, work, work_int); gsl_vector_set(y, i, Qn); } free(window); free(work); free(work_int); return GSL_SUCCESS; } static double func_Qn(const size_t n, double x[], void * params) { double *work = malloc(3 * n * sizeof(double)); int *work_int = malloc(5 * n * sizeof(int)); double Qn; (void) params; gsl_sort(x, 1, n); Qn = gsl_stats_Qn_from_sorted_data(x, 1, n, work, work_int); free(work); free(work_int); return Qn; } static void test_Qn_proc(const double tol, const size_t n, const size_t H, const size_t J, const gsl_movstat_end_t etype, gsl_rng *rng_p) { gsl_movstat_workspace *w; gsl_vector *x = gsl_vector_alloc(n); gsl_vector *y = gsl_vector_alloc(n); gsl_vector *z = gsl_vector_alloc(n); gsl_movstat_function F; char buf[2048]; F.function = func_Qn; F.params = NULL; if (H == J) w = gsl_movstat_alloc(2*H + 1); else w = gsl_movstat_alloc2(H, J); /* test moving median with random input */ random_vector(x, rng_p); /* y = Q_n(x) with slow brute force algorithm */ slow_movQn(etype, x, y, H, J); /* z = Q_n(x) */ gsl_movstat_Qn(etype, x, z, w); /* test y = z */ sprintf(buf, "n=%zu H=%zu J=%zu endtype=%u Qn random", n, H, J, etype); compare_vectors(tol, z, y, buf); /* z = Q_n(x) in-place */ gsl_vector_memcpy(z, x); gsl_movstat_Qn(etype, z, z, w); sprintf(buf, "n=%zu H=%zu J=%zu endtype=%u Qn random in-place", n, H, J, etype); compare_vectors(tol, z, y, buf); /* z = Q_n(x) with user-defined function */ gsl_movstat_apply(etype, &F, x, z, w); sprintf(buf, "n=%zu H=%zu J=%zu endtype=%u Qn user", n, H, J, etype); compare_vectors(tol, z, y, buf); gsl_vector_free(x); gsl_vector_free(y); gsl_vector_free(z); gsl_movstat_free(w); } static void test_Qn(gsl_rng * rng_p) { test_Qn_proc(GSL_DBL_EPSILON, 1000, 0, 0, GSL_MOVSTAT_END_PADZERO, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 1000, 5, 5, GSL_MOVSTAT_END_PADZERO, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 1000, 5, 2, GSL_MOVSTAT_END_PADZERO, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 1000, 2, 5, GSL_MOVSTAT_END_PADZERO, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 2000, 50, 0, GSL_MOVSTAT_END_PADZERO, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 2000, 0, 50, GSL_MOVSTAT_END_PADZERO, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 20, 50, 50, GSL_MOVSTAT_END_PADZERO, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 20, 1, 50, GSL_MOVSTAT_END_PADZERO, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 20, 50, 1, GSL_MOVSTAT_END_PADZERO, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 1000, 0, 0, GSL_MOVSTAT_END_PADVALUE, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 1000, 5, 5, GSL_MOVSTAT_END_PADVALUE, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 1000, 5, 2, GSL_MOVSTAT_END_PADVALUE, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 1000, 2, 5, GSL_MOVSTAT_END_PADVALUE, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 2000, 50, 0, GSL_MOVSTAT_END_PADVALUE, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 2000, 0, 50, GSL_MOVSTAT_END_PADVALUE, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 20, 50, 50, GSL_MOVSTAT_END_PADVALUE, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 20, 1, 50, GSL_MOVSTAT_END_PADVALUE, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 20, 50, 1, GSL_MOVSTAT_END_PADVALUE, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 1000, 0, 0, GSL_MOVSTAT_END_TRUNCATE, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 1000, 5, 5, GSL_MOVSTAT_END_TRUNCATE, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 1000, 5, 2, GSL_MOVSTAT_END_TRUNCATE, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 1000, 2, 5, GSL_MOVSTAT_END_TRUNCATE, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 2000, 50, 0, GSL_MOVSTAT_END_TRUNCATE, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 2000, 0, 50, GSL_MOVSTAT_END_TRUNCATE, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 20, 50, 50, GSL_MOVSTAT_END_TRUNCATE, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 20, 1, 50, GSL_MOVSTAT_END_TRUNCATE, rng_p); test_Qn_proc(GSL_DBL_EPSILON, 20, 50, 1, GSL_MOVSTAT_END_TRUNCATE, rng_p); }
import cv2 from PIL import Image import os import lxml.etree import shutil import random from tqdm import tqdm import numpy as np FOLDER_IMAGE = r'D:\Project\SCS\dataset\first_device\ToTrain_Ani_V3\Train\Foreign_Material' FOLDER_ANNO = r'D:\Project\SCS\dataset\first_device\ToTrain_Ani_V3\Annotations' FOLDER_OUTPUT = r'D:\Project\SCS\dataset\first_device\ToTrain_Ani_V3\Visual' COLOR = [(0, 0, 255),(0, 255, 0),(255, 0, 0),(0, 0, 255)] THICKNESS = 2 files=[f[:-4] for f in os.listdir(FOLDER_IMAGE)] # if len(f[:-4])>9] print("leng file",len(files)) def parse_xml(xml): if not len(xml): return {xml.tag: xml.text} result = {} for child in xml: child_result = parse_xml(child) if child.tag != 'object': result[child.tag] = child_result[child.tag] else: if child.tag not in result: result[child.tag] = [] result[child.tag].append(child_result[child.tag]) return {xml.tag: result} def read_xml(path): annotation_xml = lxml.etree.fromstring(open(path).read()) annotation = parse_xml(annotation_xml)['annotation'] return annotation def draw_rect_and_save(path_image,xml_path,output_path,color=(0, 0, 255),thickness=2): anno = read_xml(xml_path) img = cv2.imread(path_image) for obj in anno['object']: bbox = obj['bndbox'] label = obj['name'] p1= (int(bbox['xmin']),int(bbox['ymin'])) p2= (int(bbox['xmax']),int(bbox['ymax'])) img = cv2.rectangle(img, p1, p2, color, thickness) img = cv2.putText(img,label,p1,cv2.FONT_HERSHEY_SIMPLEX,1,color,thickness) cv2.imwrite(output_path,img) def check_valid(p1,p2,H,W): p1=list(p1) p2=list(p2) H=int(H) W=int(W) shift_pixels_h = 50#abs(int(p1[0]-p2[0])) # if shift_pixels_h>50: # shift_pixels_h=50 shift_pixels_w = 50#abs(int(p2[1]-p1[1])) # if shift_pixels_w>50: # shift_pixels_w=50 if p1[0] - shift_pixels_h <0: p1[0]=0 else: p1[0]-=shift_pixels_h if p1[1]-shift_pixels_w<0: p1[1]=0 else: p1[1]-=shift_pixels_w if p2[0]+shift_pixels_h>H: p2[0]=H else: p2[0]+=shift_pixels_h if p2[1]+shift_pixels_w>W: p2[1]=W else: p2[1]+=shift_pixels_w return p1,p2 def main(): meta_data={'Chipping':[],'Foreign_Material':[],'Peeling':[],'Scratches':[]} meta_data_id={'Chipping':0,'Foreign_Material':0,'Peeling':0,'Scratches':0} id_data={'Chipping':0,'Foreign_Material':1,'Peeling':2,'Scratches':3} count=0 # arr = np.arange(5026) # np.random.shuffle(arr) for file in tqdm(files): xml_file = os.path.join(FOLDER_ANNO,file+'.xml') image_file = os.path.join(FOLDER_IMAGE,file+'.jpg') out_put= os.path.join(FOLDER_OUTPUT,file+'.jpg') draw_rect_and_save(image_file,xml_file,out_put) # anno = read_xml(xml_file) # W=anno['size']['width'] # H=anno['size']['height'] # # print(H,W) # img=Image.open(image_file) # try: # anno['object'] # except KeyError: # print(KeyError,file) # continue # for obj in anno['object']: # name=obj['name'] # bbox = obj['bndbox'] # p1= (int(bbox['xmin']),int(bbox['ymin'])) # p2= (int(bbox['xmax']),int(bbox['ymax'])) # p1,p2=check_valid(p1,p2,H,W) # temp_img=img.crop((p1[0],p1[1],p2[0],p2[1])) # if not os.path.isdir(os.path.join(FOLDER_OUTPUT,name)): # os.makedirs(os.path.join(FOLDER_OUTPUT,name)) # path_save=os.path.join(FOLDER_OUTPUT,name,str(count)+'.jpg') # temp_img.save(path_save) # count+=1 # print("Total have {} image".format(count)) # cv2.imwrite(path_save,temp_img) # print(p1,p2) ## Thống kê trong dataset # try: # xml_file = os.path.join(FOLDER_ANNO,file+'.xml') # # image_file = os.path.join(FOLDER_IMAGE,file+'.jpg') # anno = read_xml(xml_file) # #shutil.copy(image_file,out_image_1) # # img = cv2.imread(image_file) # # try: # # for obj in anno['object'][0]: # # bbox = obj['bndbox'] # label = anno['object'][0]['name'] # # meta_data[label].append(file) # # if label == 'Scratches': # # print(file) # # meta_data_id[label]+=1 # except: # print(file) # # p1= (int(bbox['xmin']),int(bbox['ymin'])) # # p2= (int(bbox['xmax']),int(bbox['ymax'])) # # img = cv2.rectangle(img, p1, p2, COLOR[id_data[label]], THICKNESS) # # img = cv2.putText(img,label,p1,cv2.FONT_HERSHEY_SIMPLEX,1,COLOR[id_data[label]],THICKNESS) # # cv2.imwrite(out_image,img) # # except: # # print(image_file) # # print(type(meta_data['Chipping'])) # print(meta_data_id) # # path_out = 'D:\Project\SCS\dataset\\new_dataset\\final_ani_edit\\Val_tem' # # path_out_1='D:\Project\SCS\dataset\\22_05_raw\Train' # # print(meta_data) # # for i in meta_data: # # # if os.path.exists(os.path.join(path_out,i)) is False: # # # os.makedirs(os.path.join(path_out,i)) # # if os.path.exists(os.path.join(path_out_1,i)) is False: # # os.makedirs(os.path.join(path_out_1,i)) # # # val = random.choices(meta_data[i],k=150) # # train= [f for f in meta_data[i]]# if f not in val] # # print(train) # # # print(len(val),len(train),len(val)+len(train),len(meta_data[i])) # # # for item in val: # # shutil.copy2(os.path.join(FOLDER_IMAGE,item+'.jpg'),os.path.join(path_out,i,item+'.jpg')) # # for item in train: # # shutil.copy2(os.path.join(FOLDER_IMAGE,item+'.jpg'),os.path.join(path_out_1,i,item+'.jpg')) if __name__ == "__main__": main() pass
[STATEMENT] lemma (in su_rel_fun) repr: "(f A = B) = ((A,B)\<in>F)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. (f A = B) = ((A, B) \<in> F) [PROOF STEP] using repr1 repr2 [PROOF STATE] proof (prove) using this: (?A, f ?A) \<in> F (?A, ?B) \<in> F \<Longrightarrow> ?B = f ?A goal (1 subgoal): 1. (f A = B) = ((A, B) \<in> F) [PROOF STEP] by (blast)
Today some of the sharpest opening variations have been analyzed so deeply that they are often used as drawing weapons . For example , at the highest levels , Black often uses the Marshall Attack in the Ruy Lopez , a line where Black sacrifices a pawn for strong attacking chances , to obtain an endgame where Black is still a pawn down but is able to draw with correct play .
// Copyright (C) 2020 T. Zachary Laine // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // Warning! This file is autogenerated. #include <boost/text/collation_table.hpp> #include <boost/text/collate.hpp> #include <boost/text/data/all.hpp> #ifndef LIMIT_TESTING_FOR_CI #include <boost/text/save_load_table.hpp> #include <boost/filesystem.hpp> #endif #include <gtest/gtest.h> using namespace boost::text; auto const error = [](std::string const & s) { std::cout << s; }; auto const warning = [](std::string const & s) {}; collation_table make_save_load_table() { #ifdef LIMIT_TESTING_FOR_CI std::string const table_str(data::zh::stroke_collation_tailoring()); return tailored_collation_table( table_str, "zh::stroke_collation_tailoring()", error, warning); #else if (!exists(boost::filesystem::path("zh_stroke.table"))) { std::string const table_str(data::zh::stroke_collation_tailoring()); collation_table table = tailored_collation_table( table_str, "zh::stroke_collation_tailoring()", error, warning); save_table(table, "zh_stroke.table.11"); boost::filesystem::rename("zh_stroke.table.11", "zh_stroke.table"); } return load_table("zh_stroke.table"); #endif } collation_table const & table() { static collation_table retval = make_save_load_table(); return retval; } TEST(tailoring, zh_stroke_010_000) { { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8d4f); auto const rel = std::vector<uint32_t>(1, 0x8d50); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8d50); auto const rel = std::vector<uint32_t>(1, 0x8d51); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8d51); auto const rel = std::vector<uint32_t>(1, 0x8d52); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8d52); auto const rel = std::vector<uint32_t>(1, 0x8d53); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8d53); auto const rel = std::vector<uint32_t>(1, 0x8d54); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8d54); auto const rel = std::vector<uint32_t>(1, 0x8d55); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8d55); auto const rel = std::vector<uint32_t>(1, 0x8d80); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8d80); auto const rel = std::vector<uint32_t>(1, 0x8d81); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8d81); auto const rel = std::vector<uint32_t>(1, 0x8d82); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8d82); auto const rel = std::vector<uint32_t>(1, 0x8d83); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8d83); auto const rel = std::vector<uint32_t>(1, 0x8d84); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8d84); auto const rel = std::vector<uint32_t>(1, 0x8d85); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8d85); auto const rel = std::vector<uint32_t>(1, 0x8d86); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8d86); auto const rel = std::vector<uint32_t>(1, 0x8d87); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8d87); auto const rel = std::vector<uint32_t>(1, 0x8d88); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8d88); auto const rel = std::vector<uint32_t>(1, 0x8d89); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8d89); auto const rel = std::vector<uint32_t>(1, 0x8d8a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8d8a); auto const rel = std::vector<uint32_t>(1, 0x8d8b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8d8b); auto const rel = std::vector<uint32_t>(1, 0x47a1); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x47a1); auto const rel = std::vector<uint32_t>(1, 0x47a3); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x47a3); auto const rel = std::vector<uint32_t>(1, 0x8dc5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8dc5); auto const rel = std::vector<uint32_t>(1, 0x8dc6); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8dc6); auto const rel = std::vector<uint32_t>(1, 0x8dc7); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8dc7); auto const rel = std::vector<uint32_t>(1, 0x8dc8); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8dc8); auto const rel = std::vector<uint32_t>(1, 0x8dc9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8dc9); auto const rel = std::vector<uint32_t>(1, 0x8dca); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8dca); auto const rel = std::vector<uint32_t>(1, 0x8dcb); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8dcb); auto const rel = std::vector<uint32_t>(1, 0x8dcc); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8dcc); auto const rel = std::vector<uint32_t>(1, 0x8dcd); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8dcd); auto const rel = std::vector<uint32_t>(1, 0x8dce); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8dce); auto const rel = std::vector<uint32_t>(1, 0x8dcf); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8dcf); auto const rel = std::vector<uint32_t>(1, 0x8dd1); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8dd1); auto const rel = std::vector<uint32_t>(1, 0x8dd2); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8dd2); auto const rel = std::vector<uint32_t>(1, 0x8dd3); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8dd3); auto const rel = std::vector<uint32_t>(1, 0x8dd4); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8dd4); auto const rel = std::vector<uint32_t>(1, 0x8dd5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8dd5); auto const rel = std::vector<uint32_t>(1, 0x8dd6); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8dd6); auto const rel = std::vector<uint32_t>(1, 0x8dd7); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8dd7); auto const rel = std::vector<uint32_t>(1, 0x8dd8); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8dd8); auto const rel = std::vector<uint32_t>(1, 0x8dd9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8dd9); auto const rel = std::vector<uint32_t>(1, 0x8dda); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8dda); auto const rel = std::vector<uint32_t>(1, 0x8ddb); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8ddb); auto const rel = std::vector<uint32_t>(1, 0x8ddc); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8ddc); auto const rel = std::vector<uint32_t>(1, 0x8ddd); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8ddd); auto const rel = std::vector<uint32_t>(1, 0x8dde); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8dde); auto const rel = std::vector<uint32_t>(1, 0x8df5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8df5); auto const rel = std::vector<uint32_t>(1, 0x47ed); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x47ed); auto const rel = std::vector<uint32_t>(1, 0x27ff9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x27ff9); auto const rel = std::vector<uint32_t>(1, 0x28002); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x28002); auto const rel = std::vector<uint32_t>(1, 0x28009); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x28009); auto const rel = std::vector<uint32_t>(1, 0x8eb0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } } TEST(tailoring, zh_stroke_011_001) { { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8eb0); auto const rel = std::vector<uint32_t>(1, 0x8ee4); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8ee4); auto const rel = std::vector<uint32_t>(1, 0x8ee5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8ee5); auto const rel = std::vector<uint32_t>(1, 0x8ee6); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8ee6); auto const rel = std::vector<uint32_t>(1, 0x8ee7); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8ee7); auto const rel = std::vector<uint32_t>(1, 0x8ee8); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8ee8); auto const rel = std::vector<uint32_t>(1, 0x8ee9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8ee9); auto const rel = std::vector<uint32_t>(1, 0x8eea); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8eea); auto const rel = std::vector<uint32_t>(1, 0x8eeb); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8eeb); auto const rel = std::vector<uint32_t>(1, 0x8eec); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8eec); auto const rel = std::vector<uint32_t>(1, 0x8eee); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8eee); auto const rel = std::vector<uint32_t>(1, 0x8eef); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8eef); auto const rel = std::vector<uint32_t>(1, 0x8ef0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8ef0); auto const rel = std::vector<uint32_t>(1, 0x8ef1); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8ef1); auto const rel = std::vector<uint32_t>(1, 0x8ef2); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8ef2); auto const rel = std::vector<uint32_t>(1, 0x8ef3); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8ef3); auto const rel = std::vector<uint32_t>(1, 0x8ef4); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8ef4); auto const rel = std::vector<uint32_t>(1, 0x8ef5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8ef5); auto const rel = std::vector<uint32_t>(1, 0x8ef6); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8ef6); auto const rel = std::vector<uint32_t>(1, 0x8ef7); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8ef7); auto const rel = std::vector<uint32_t>(1, 0x8ef8); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8ef8); auto const rel = std::vector<uint32_t>(1, 0x8ef9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8ef9); auto const rel = std::vector<uint32_t>(1, 0x8efa); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8efa); auto const rel = std::vector<uint32_t>(1, 0x8efb); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8efb); auto const rel = std::vector<uint32_t>(1, 0x8efc); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8efc); auto const rel = std::vector<uint32_t>(1, 0x8efd); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8efd); auto const rel = std::vector<uint32_t>(1, 0x9fab); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9fab); auto const rel = std::vector<uint32_t>(1, 0x4852); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x4852); auto const rel = std::vector<uint32_t>(1, 0x282e2); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x282e2); auto const rel = std::vector<uint32_t>(1, 0x8f87); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8f87); auto const rel = std::vector<uint32_t>(1, 0x8f88); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8f88); auto const rel = std::vector<uint32_t>(1, 0x8f89); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8f89); auto const rel = std::vector<uint32_t>(1, 0x8f8a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8f8a); auto const rel = std::vector<uint32_t>(1, 0x8f8b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8f8b); auto const rel = std::vector<uint32_t>(1, 0x8f8c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8f8c); auto const rel = std::vector<uint32_t>(1, 0x8f8d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8f8d); auto const rel = std::vector<uint32_t>(1, 0x8f8e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8f8e); auto const rel = std::vector<uint32_t>(1, 0x8f9c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8f9c); auto const rel = std::vector<uint32_t>(1, 0x8f9d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x8f9d); auto const rel = std::vector<uint32_t>(1, 0x28412); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x28412); auto const rel = std::vector<uint32_t>(1, 0x9028); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9028); auto const rel = std::vector<uint32_t>(1, 0x9029); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9029); auto const rel = std::vector<uint32_t>(1, 0x902a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x902a); auto const rel = std::vector<uint32_t>(1, 0x902b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x902b); auto const rel = std::vector<uint32_t>(1, 0x902c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x902c); auto const rel = std::vector<uint32_t>(1, 0x902d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x902d); auto const rel = std::vector<uint32_t>(1, 0x902e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x902e); auto const rel = std::vector<uint32_t>(1, 0x902f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x902f); auto const rel = std::vector<uint32_t>(1, 0x9030); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9030); auto const rel = std::vector<uint32_t>(1, 0x9031); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9031); auto const rel = std::vector<uint32_t>(1, 0x9032); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9032); auto const rel = std::vector<uint32_t>(1, 0x9033); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } } TEST(tailoring, zh_stroke_011_002) { { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9033); auto const rel = std::vector<uint32_t>(1, 0x9034); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9034); auto const rel = std::vector<uint32_t>(1, 0x9035); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9035); auto const rel = std::vector<uint32_t>(1, 0x9036); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9036); auto const rel = std::vector<uint32_t>(1, 0x9037); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9037); auto const rel = std::vector<uint32_t>(1, 0x9038); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9038); auto const rel = std::vector<uint32_t>(1, 0x9039); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9039); auto const rel = std::vector<uint32_t>(1, 0x903a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x903a); auto const rel = std::vector<uint32_t>(1, 0x903b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x903b); auto const rel = std::vector<uint32_t>(1, 0x2853c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x2853c); auto const rel = std::vector<uint32_t>(1, 0x2853d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x2853d); auto const rel = std::vector<uint32_t>(1, 0x90f5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x90f5); auto const rel = std::vector<uint32_t>(1, 0x90f9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x90f9); auto const rel = std::vector<uint32_t>(1, 0x90fb); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x90fb); auto const rel = std::vector<uint32_t>(1, 0x90fc); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x90fc); auto const rel = std::vector<uint32_t>(1, 0x90fe); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x90fe); auto const rel = std::vector<uint32_t>(1, 0x90ff); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x90ff); auto const rel = std::vector<uint32_t>(1, 0x9100); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9100); auto const rel = std::vector<uint32_t>(1, 0x9101); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9101); auto const rel = std::vector<uint32_t>(1, 0x9102); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9102); auto const rel = std::vector<uint32_t>(1, 0x9103); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9103); auto const rel = std::vector<uint32_t>(1, 0x9104); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9104); auto const rel = std::vector<uint32_t>(1, 0x9105); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9105); auto const rel = std::vector<uint32_t>(1, 0x9106); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9106); auto const rel = std::vector<uint32_t>(1, 0x9107); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9107); auto const rel = std::vector<uint32_t>(1, 0x9108); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9108); auto const rel = std::vector<uint32_t>(1, 0x9109); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9109); auto const rel = std::vector<uint32_t>(1, 0x910a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x910a); auto const rel = std::vector<uint32_t>(1, 0x48d0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x48d0); auto const rel = std::vector<uint32_t>(1, 0x912c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x912c); auto const rel = std::vector<uint32_t>(1, 0x915f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x915f); auto const rel = std::vector<uint32_t>(1, 0x9160); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9160); auto const rel = std::vector<uint32_t>(1, 0x9161); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9161); auto const rel = std::vector<uint32_t>(1, 0x9162); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9162); auto const rel = std::vector<uint32_t>(1, 0x9163); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9163); auto const rel = std::vector<uint32_t>(1, 0x9164); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9164); auto const rel = std::vector<uint32_t>(1, 0x9165); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9165); auto const rel = std::vector<uint32_t>(1, 0x48f3); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x48f3); auto const rel = std::vector<uint32_t>(1, 0x91c9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x91c9); auto const rel = std::vector<uint32_t>(1, 0x91ca); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x91ca); auto const rel = std::vector<uint32_t>(1, 0x91cf); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x91cf); auto const rel = std::vector<uint32_t>(1, 0x91fd); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x91fd); auto const rel = std::vector<uint32_t>(1, 0x91fe); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x91fe); auto const rel = std::vector<uint32_t>(1, 0x91ff); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x91ff); auto const rel = std::vector<uint32_t>(1, 0x9200); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9200); auto const rel = std::vector<uint32_t>(1, 0x9201); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9201); auto const rel = std::vector<uint32_t>(1, 0x9202); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9202); auto const rel = std::vector<uint32_t>(1, 0x9203); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9203); auto const rel = std::vector<uint32_t>(1, 0x9204); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9204); auto const rel = std::vector<uint32_t>(1, 0x9205); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9205); auto const rel = std::vector<uint32_t>(1, 0x9206); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9206); auto const rel = std::vector<uint32_t>(1, 0x9207); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } } TEST(tailoring, zh_stroke_011_003) { { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9207); auto const rel = std::vector<uint32_t>(1, 0x9208); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9208); auto const rel = std::vector<uint32_t>(1, 0x9209); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9209); auto const rel = std::vector<uint32_t>(1, 0x920a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x920a); auto const rel = std::vector<uint32_t>(1, 0x920b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x920b); auto const rel = std::vector<uint32_t>(1, 0x920c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x920c); auto const rel = std::vector<uint32_t>(1, 0x920d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x920d); auto const rel = std::vector<uint32_t>(1, 0x920e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x920e); auto const rel = std::vector<uint32_t>(1, 0x920f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x920f); auto const rel = std::vector<uint32_t>(1, 0x9210); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9210); auto const rel = std::vector<uint32_t>(1, 0x9211); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9211); auto const rel = std::vector<uint32_t>(1, 0x9212); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9212); auto const rel = std::vector<uint32_t>(1, 0x9213); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9213); auto const rel = std::vector<uint32_t>(1, 0x9214); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9214); auto const rel = std::vector<uint32_t>(1, 0x9215); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9215); auto const rel = std::vector<uint32_t>(1, 0x9216); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9216); auto const rel = std::vector<uint32_t>(1, 0x9217); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9217); auto const rel = std::vector<uint32_t>(1, 0x9218); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9218); auto const rel = std::vector<uint32_t>(1, 0x9219); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9219); auto const rel = std::vector<uint32_t>(1, 0x921a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x921a); auto const rel = std::vector<uint32_t>(1, 0x921b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x921b); auto const rel = std::vector<uint32_t>(1, 0x921c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x921c); auto const rel = std::vector<uint32_t>(1, 0x921d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x921d); auto const rel = std::vector<uint32_t>(1, 0x921e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x921e); auto const rel = std::vector<uint32_t>(1, 0x921f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x921f); auto const rel = std::vector<uint32_t>(1, 0x9220); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9220); auto const rel = std::vector<uint32_t>(1, 0x9221); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9221); auto const rel = std::vector<uint32_t>(1, 0x9222); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9222); auto const rel = std::vector<uint32_t>(1, 0x9223); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9223); auto const rel = std::vector<uint32_t>(1, 0x9224); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9224); auto const rel = std::vector<uint32_t>(1, 0x9225); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9225); auto const rel = std::vector<uint32_t>(1, 0x9226); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9226); auto const rel = std::vector<uint32_t>(1, 0x9227); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9227); auto const rel = std::vector<uint32_t>(1, 0x9228); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9228); auto const rel = std::vector<uint32_t>(1, 0x9229); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9229); auto const rel = std::vector<uint32_t>(1, 0x922a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x922a); auto const rel = std::vector<uint32_t>(1, 0x922b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x922b); auto const rel = std::vector<uint32_t>(1, 0x922c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x922c); auto const rel = std::vector<uint32_t>(1, 0x491e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x491e); auto const rel = std::vector<uint32_t>(1, 0x4920); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x4920); auto const rel = std::vector<uint32_t>(1, 0x28956); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x28956); auto const rel = std::vector<uint32_t>(1, 0x28964); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x28964); auto const rel = std::vector<uint32_t>(1, 0x94f8); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x94f8); auto const rel = std::vector<uint32_t>(1, 0x94f9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x94f9); auto const rel = std::vector<uint32_t>(1, 0x94fa); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x94fa); auto const rel = std::vector<uint32_t>(1, 0x94fb); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x94fb); auto const rel = std::vector<uint32_t>(1, 0x94fc); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x94fc); auto const rel = std::vector<uint32_t>(1, 0x94fd); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x94fd); auto const rel = std::vector<uint32_t>(1, 0x94fe); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x94fe); auto const rel = std::vector<uint32_t>(1, 0x94ff); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x94ff); auto const rel = std::vector<uint32_t>(1, 0x9500); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9500); auto const rel = std::vector<uint32_t>(1, 0x9501); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } } TEST(tailoring, zh_stroke_011_004) { { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9501); auto const rel = std::vector<uint32_t>(1, 0x9502); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9502); auto const rel = std::vector<uint32_t>(1, 0x9503); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9503); auto const rel = std::vector<uint32_t>(1, 0x9504); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9504); auto const rel = std::vector<uint32_t>(1, 0x9505); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9505); auto const rel = std::vector<uint32_t>(1, 0x9506); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9506); auto const rel = std::vector<uint32_t>(1, 0x9507); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9507); auto const rel = std::vector<uint32_t>(1, 0x9508); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9508); auto const rel = std::vector<uint32_t>(1, 0x9509); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9509); auto const rel = std::vector<uint32_t>(1, 0x950a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x950a); auto const rel = std::vector<uint32_t>(1, 0x950b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x950b); auto const rel = std::vector<uint32_t>(1, 0x950c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x950c); auto const rel = std::vector<uint32_t>(1, 0x950d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x950d); auto const rel = std::vector<uint32_t>(1, 0x950e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x950e); auto const rel = std::vector<uint32_t>(1, 0x950f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x950f); auto const rel = std::vector<uint32_t>(1, 0x9510); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9510); auto const rel = std::vector<uint32_t>(1, 0x9511); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9511); auto const rel = std::vector<uint32_t>(1, 0x9512); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9512); auto const rel = std::vector<uint32_t>(1, 0x9513); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9513); auto const rel = std::vector<uint32_t>(1, 0x9514); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9514); auto const rel = std::vector<uint32_t>(1, 0x9515); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9515); auto const rel = std::vector<uint32_t>(1, 0x957b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x957b); auto const rel = std::vector<uint32_t>(1, 0x958b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x958b); auto const rel = std::vector<uint32_t>(1, 0x958c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x958c); auto const rel = std::vector<uint32_t>(1, 0x958d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x958d); auto const rel = std::vector<uint32_t>(1, 0x958e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x958e); auto const rel = std::vector<uint32_t>(1, 0x958f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x958f); auto const rel = std::vector<uint32_t>(1, 0x9590); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9590); auto const rel = std::vector<uint32_t>(1, 0x9591); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9591); auto const rel = std::vector<uint32_t>(1, 0x9592); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9592); auto const rel = std::vector<uint32_t>(1, 0x9593); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9593); auto const rel = std::vector<uint32_t>(1, 0x9594); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9594); auto const rel = std::vector<uint32_t>(1, 0x9595); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9595); auto const rel = std::vector<uint32_t>(1, 0x9596); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9596); auto const rel = std::vector<uint32_t>(1, 0x9597); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9597); auto const rel = std::vector<uint32_t>(1, 0x9611); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9611); auto const rel = std::vector<uint32_t>(1, 0x9612); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9612); auto const rel = std::vector<uint32_t>(1, 0x9613); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9613); auto const rel = std::vector<uint32_t>(1, 0x9614); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9614); auto const rel = std::vector<uint32_t>(1, 0x9615); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9615); auto const rel = std::vector<uint32_t>(1, 0x9672); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9672); auto const rel = std::vector<uint32_t>(1, 0x967b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x967b); auto const rel = std::vector<uint32_t>(1, 0x967d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x967d); auto const rel = std::vector<uint32_t>(1, 0x967e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x967e); auto const rel = std::vector<uint32_t>(1, 0x967f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x967f); auto const rel = std::vector<uint32_t>(1, 0x9680); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9680); auto const rel = std::vector<uint32_t>(1, 0x9681); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9681); auto const rel = std::vector<uint32_t>(1, 0x9682); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9682); auto const rel = std::vector<uint32_t>(1, 0x9683); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9683); auto const rel = std::vector<uint32_t>(1, 0x9684); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9684); auto const rel = std::vector<uint32_t>(1, 0x9685); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9685); auto const rel = std::vector<uint32_t>(1, 0x9686); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } } TEST(tailoring, zh_stroke_011_005) { { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9686); auto const rel = std::vector<uint32_t>(1, 0x9687); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9687); auto const rel = std::vector<uint32_t>(1, 0x9688); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9688); auto const rel = std::vector<uint32_t>(1, 0x9689); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9689); auto const rel = std::vector<uint32_t>(1, 0x968a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x968a); auto const rel = std::vector<uint32_t>(1, 0x968b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x968b); auto const rel = std::vector<uint32_t>(1, 0x968c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x968c); auto const rel = std::vector<uint32_t>(1, 0x968d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x968d); auto const rel = std::vector<uint32_t>(1, 0x968e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x968e); auto const rel = std::vector<uint32_t>(1, 0x9690); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9690); auto const rel = std::vector<uint32_t>(1, 0x28ed9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x28ed9); auto const rel = std::vector<uint32_t>(1, 0x28ee7); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x28ee7); auto const rel = std::vector<uint32_t>(1, 0x96c1); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x96c1); auto const rel = std::vector<uint32_t>(1, 0x96c2); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x96c2); auto const rel = std::vector<uint32_t>(1, 0x96c3); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x96c3); auto const rel = std::vector<uint32_t>(1, 0x96c4); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x96c4); auto const rel = std::vector<uint32_t>(1, 0x96c5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x96c5); auto const rel = std::vector<uint32_t>(1, 0x96c6); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x96c6); auto const rel = std::vector<uint32_t>(1, 0x96c7); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x96c7); auto const rel = std::vector<uint32_t>(1, 0x96c8); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x96c8); auto const rel = std::vector<uint32_t>(1, 0x96ec); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x96ec); auto const rel = std::vector<uint32_t>(1, 0x96ed); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x96ed); auto const rel = std::vector<uint32_t>(1, 0x96ee); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x96ee); auto const rel = std::vector<uint32_t>(1, 0x96ef); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x96ef); auto const rel = std::vector<uint32_t>(1, 0x96f0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x96f0); auto const rel = std::vector<uint32_t>(1, 0x96f1); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x96f1); auto const rel = std::vector<uint32_t>(1, 0x96f2); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x96f2); auto const rel = std::vector<uint32_t>(1, 0x96f3); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x96f3); auto const rel = std::vector<uint32_t>(1, 0x29088); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x29088); auto const rel = std::vector<uint32_t>(1, 0x2908b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x2908b); auto const rel = std::vector<uint32_t>(1, 0x9753); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9753); auto const rel = std::vector<uint32_t>(1, 0x9754); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9754); auto const rel = std::vector<uint32_t>(1, 0x975f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x975f); auto const rel = std::vector<uint32_t>(1, 0x976b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x976b); auto const rel = std::vector<uint32_t>(1, 0x976c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x976c); auto const rel = std::vector<uint32_t>(1, 0x976d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x976d); auto const rel = std::vector<uint32_t>(1, 0x976e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x976e); auto const rel = std::vector<uint32_t>(1, 0x976f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x976f); auto const rel = std::vector<uint32_t>(1, 0x9770); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9770); auto const rel = std::vector<uint32_t>(1, 0x9771); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9771); auto const rel = std::vector<uint32_t>(1, 0x97cc); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x97cc); auto const rel = std::vector<uint32_t>(1, 0x97e9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x97e9); auto const rel = std::vector<uint32_t>(1, 0x9805); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9805); auto const rel = std::vector<uint32_t>(1, 0x9806); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9806); auto const rel = std::vector<uint32_t>(1, 0x9807); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9807); auto const rel = std::vector<uint32_t>(1, 0x9808); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9808); auto const rel = std::vector<uint32_t>(1, 0x9889); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9889); auto const rel = std::vector<uint32_t>(1, 0x988a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x988a); auto const rel = std::vector<uint32_t>(1, 0x988b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x988b); auto const rel = std::vector<uint32_t>(1, 0x988c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x988c); auto const rel = std::vector<uint32_t>(1, 0x988d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x988d); auto const rel = std::vector<uint32_t>(1, 0x988e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } } TEST(tailoring, zh_stroke_011_006) { { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x988e); auto const rel = std::vector<uint32_t>(1, 0x988f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x988f); auto const rel = std::vector<uint32_t>(1, 0x98a9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x98a9); auto const rel = std::vector<uint32_t>(1, 0x98aa); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x98aa); auto const rel = std::vector<uint32_t>(1, 0x2959e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x2959e); auto const rel = std::vector<uint32_t>(1, 0x98d3); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x98d3); auto const rel = std::vector<uint32_t>(1, 0x98e7); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x98e7); auto const rel = std::vector<uint32_t>(1, 0x98e8); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x98e8); auto const rel = std::vector<uint32_t>(1, 0x98e9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x98e9); auto const rel = std::vector<uint32_t>(1, 0x98ea); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x98ea); auto const rel = std::vector<uint32_t>(1, 0x98eb); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x98eb); auto const rel = std::vector<uint32_t>(1, 0x98ed); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x98ed); auto const rel = std::vector<uint32_t>(1, 0x98ef); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x98ef); auto const rel = std::vector<uint32_t>(1, 0x98f0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x98f0); auto const rel = std::vector<uint32_t>(1, 0x98f2); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x98f2); auto const rel = std::vector<uint32_t>(1, 0x9987); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9987); auto const rel = std::vector<uint32_t>(1, 0x9988); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9988); auto const rel = std::vector<uint32_t>(1, 0x998a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x998a); auto const rel = std::vector<uint32_t>(1, 0x998b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x998b); auto const rel = std::vector<uint32_t>(1, 0x99ad); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x99ad); auto const rel = std::vector<uint32_t>(1, 0x99ae); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x99ae); auto const rel = std::vector<uint32_t>(1, 0x9a97); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9a97); auto const rel = std::vector<uint32_t>(1, 0x9a98); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9a98); auto const rel = std::vector<uint32_t>(1, 0x9a99); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9a99); auto const rel = std::vector<uint32_t>(1, 0x9a9a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9a9a); auto const rel = std::vector<uint32_t>(1, 0x9a9b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9a9b); auto const rel = std::vector<uint32_t>(1, 0x9aa9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9aa9); auto const rel = std::vector<uint32_t>(1, 0x9ae0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9ae0); auto const rel = std::vector<uint32_t>(1, 0x4c32); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x4c32); auto const rel = std::vector<uint32_t>(1, 0x9c7f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9c7f); auto const rel = std::vector<uint32_t>(1, 0x9c80); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9c80); auto const rel = std::vector<uint32_t>(1, 0x9c81); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9c81); auto const rel = std::vector<uint32_t>(1, 0x9c82); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9c82); auto const rel = std::vector<uint32_t>(1, 0x9c83); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9c83); auto const rel = std::vector<uint32_t>(1, 0x9ce6); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9ce6); auto const rel = std::vector<uint32_t>(1, 0x9e40); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9e40); auto const rel = std::vector<uint32_t>(1, 0x9e41); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9e41); auto const rel = std::vector<uint32_t>(1, 0x9e42); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9e42); auto const rel = std::vector<uint32_t>(1, 0x9e43); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9e43); auto const rel = std::vector<uint32_t>(1, 0x9e44); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9e44); auto const rel = std::vector<uint32_t>(1, 0x9e45); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9e45); auto const rel = std::vector<uint32_t>(1, 0x9e46); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9e46); auto const rel = std::vector<uint32_t>(1, 0x9e47); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9e47); auto const rel = std::vector<uint32_t>(1, 0x9e48); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9e48); auto const rel = std::vector<uint32_t>(1, 0x9ec3); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9ec3); auto const rel = std::vector<uint32_t>(1, 0x9ec4); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9ec4); auto const rel = std::vector<uint32_t>(1, 0x9ecd); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9ecd); auto const rel = std::vector<uint32_t>(1, 0x9ed1); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9ed1); auto const rel = std::vector<uint32_t>(1, 0x9ef9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9ef9); auto const rel = std::vector<uint32_t>(1, 0x9f0b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9f0b); auto const rel = std::vector<uint32_t>(1, 0x9f82); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x9f82); auto const rel = std::vector<uint32_t>{0xfdd0, 0x280d}; std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } } TEST(tailoring, zh_stroke_011_007) { { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>{0xfdd0, 0x280d}; auto const rel = std::vector<uint32_t>(1, 0x4e82); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x4e82); auto const rel = std::vector<uint32_t>(1, 0x4e83); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x4e83); auto const rel = std::vector<uint32_t>(1, 0x4e84); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x4e84); auto const rel = std::vector<uint32_t>(1, 0x4eb6); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x4eb6); auto const rel = std::vector<uint32_t>(1, 0x4eb7); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x4eb7); auto const rel = std::vector<uint32_t>(1, 0x50aa); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50aa); auto const rel = std::vector<uint32_t>(1, 0x50ab); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50ab); auto const rel = std::vector<uint32_t>(1, 0x50ac); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50ac); auto const rel = std::vector<uint32_t>(1, 0x50ad); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50ad); auto const rel = std::vector<uint32_t>(1, 0x50ae); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50ae); auto const rel = std::vector<uint32_t>(1, 0x50af); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50af); auto const rel = std::vector<uint32_t>(1, 0x50b0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50b0); auto const rel = std::vector<uint32_t>(1, 0x50b1); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50b1); auto const rel = std::vector<uint32_t>(1, 0x50b2); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50b2); auto const rel = std::vector<uint32_t>(1, 0x50b3); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50b3); auto const rel = std::vector<uint32_t>(1, 0x50b4); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50b4); auto const rel = std::vector<uint32_t>(1, 0x50b5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50b5); auto const rel = std::vector<uint32_t>(1, 0x50b6); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50b6); auto const rel = std::vector<uint32_t>(1, 0x50b7); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50b7); auto const rel = std::vector<uint32_t>(1, 0x50b8); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50b8); auto const rel = std::vector<uint32_t>(1, 0x50b9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50b9); auto const rel = std::vector<uint32_t>(1, 0x50ba); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50ba); auto const rel = std::vector<uint32_t>(1, 0x50bb); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50bb); auto const rel = std::vector<uint32_t>(1, 0x50bc); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50bc); auto const rel = std::vector<uint32_t>(1, 0x50bd); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50bd); auto const rel = std::vector<uint32_t>(1, 0x50be); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50be); auto const rel = std::vector<uint32_t>(1, 0x50bf); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50bf); auto const rel = std::vector<uint32_t>(1, 0x50c0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50c0); auto const rel = std::vector<uint32_t>(1, 0x50c1); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50c1); auto const rel = std::vector<uint32_t>(1, 0x50c2); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50c2); auto const rel = std::vector<uint32_t>(1, 0x50c3); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50c3); auto const rel = std::vector<uint32_t>(1, 0x50c4); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50c4); auto const rel = std::vector<uint32_t>(1, 0x50c5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50c5); auto const rel = std::vector<uint32_t>(1, 0x50c6); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50c6); auto const rel = std::vector<uint32_t>(1, 0x50c7); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50c7); auto const rel = std::vector<uint32_t>(1, 0x50c8); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50c8); auto const rel = std::vector<uint32_t>(1, 0x50c9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50c9); auto const rel = std::vector<uint32_t>(1, 0x50ca); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50ca); auto const rel = std::vector<uint32_t>(1, 0x50cb); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50cb); auto const rel = std::vector<uint32_t>(1, 0x50cc); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50cc); auto const rel = std::vector<uint32_t>(1, 0x50cd); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x50cd); auto const rel = std::vector<uint32_t>(1, 0x347d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x347d); auto const rel = std::vector<uint32_t>(1, 0x347e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x347e); auto const rel = std::vector<uint32_t>(1, 0x20341); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20341); auto const rel = std::vector<uint32_t>(1, 0x20345); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20345); auto const rel = std::vector<uint32_t>(1, 0x20346); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20346); auto const rel = std::vector<uint32_t>(1, 0x20347); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20347); auto const rel = std::vector<uint32_t>(1, 0x203b5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x203b5); auto const rel = std::vector<uint32_t>(1, 0x5161); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5161); auto const rel = std::vector<uint32_t>(1, 0x517e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x517e); auto const rel = std::vector<uint32_t>(1, 0x517f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } } TEST(tailoring, zh_stroke_011_008) { { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x517f); auto const rel = std::vector<uint32_t>(1, 0x51d7); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x51d7); auto const rel = std::vector<uint32_t>(1, 0x5277); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5277); auto const rel = std::vector<uint32_t>(1, 0x5278); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5278); auto const rel = std::vector<uint32_t>(1, 0x5279); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5279); auto const rel = std::vector<uint32_t>(1, 0x527a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x527a); auto const rel = std::vector<uint32_t>(1, 0x527b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x527b); auto const rel = std::vector<uint32_t>(1, 0x527c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x527c); auto const rel = std::vector<uint32_t>(1, 0x527d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x527d); auto const rel = std::vector<uint32_t>(1, 0x527e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x527e); auto const rel = std::vector<uint32_t>(1, 0x527f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x527f); auto const rel = std::vector<uint32_t>(1, 0x52df); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x52df); auto const rel = std::vector<uint32_t>(1, 0x52e0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x52e0); auto const rel = std::vector<uint32_t>(1, 0x52e1); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x52e1); auto const rel = std::vector<uint32_t>(1, 0x52e2); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x52e2); auto const rel = std::vector<uint32_t>(1, 0x52e3); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x52e3); auto const rel = std::vector<uint32_t>(1, 0x52e4); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x52e4); auto const rel = std::vector<uint32_t>(1, 0x52e5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x52e5); auto const rel = std::vector<uint32_t>(1, 0x52e6); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x52e6); auto const rel = std::vector<uint32_t>(1, 0x52e7); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x52e7); auto const rel = std::vector<uint32_t>(1, 0x532f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x532f); auto const rel = std::vector<uint32_t>(1, 0x3532); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3532); auto const rel = std::vector<uint32_t>(1, 0x3533); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3533); auto const rel = std::vector<uint32_t>(1, 0x3534); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3534); auto const rel = std::vector<uint32_t>(1, 0x5380); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5380); auto const rel = std::vector<uint32_t>(1, 0x5381); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5381); auto const rel = std::vector<uint32_t>(1, 0x53aa); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x53aa); auto const rel = std::vector<uint32_t>(1, 0x53ab); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x53ab); auto const rel = std::vector<uint32_t>(1, 0x53af); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x53af); auto const rel = std::vector<uint32_t>(1, 0x53e0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x53e0); auto const rel = std::vector<uint32_t>(1, 0xfa0e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0xfa0e); auto const rel = std::vector<uint32_t>(1, 0x558d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x558d); auto const rel = std::vector<uint32_t>(1, 0x55bf); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55bf); auto const rel = std::vector<uint32_t>(1, 0x55c0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55c0); auto const rel = std::vector<uint32_t>(1, 0x55c1); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55c1); auto const rel = std::vector<uint32_t>(1, 0x55c2); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55c2); auto const rel = std::vector<uint32_t>(1, 0x55c3); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55c3); auto const rel = std::vector<uint32_t>(1, 0x55c4); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55c4); auto const rel = std::vector<uint32_t>(1, 0x55c5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55c5); auto const rel = std::vector<uint32_t>(1, 0x55c6); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55c6); auto const rel = std::vector<uint32_t>(1, 0x55c7); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55c7); auto const rel = std::vector<uint32_t>(1, 0x55c8); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55c8); auto const rel = std::vector<uint32_t>(1, 0x55c9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55c9); auto const rel = std::vector<uint32_t>(1, 0x55ca); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55ca); auto const rel = std::vector<uint32_t>(1, 0x55cb); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55cb); auto const rel = std::vector<uint32_t>(1, 0x55cc); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55cc); auto const rel = std::vector<uint32_t>(1, 0x55cd); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55cd); auto const rel = std::vector<uint32_t>(1, 0x55ce); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55ce); auto const rel = std::vector<uint32_t>(1, 0x55cf); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55cf); auto const rel = std::vector<uint32_t>(1, 0x55d0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55d0); auto const rel = std::vector<uint32_t>(1, 0x55d1); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55d1); auto const rel = std::vector<uint32_t>(1, 0x55d2); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } } TEST(tailoring, zh_stroke_011_009) { { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55d2); auto const rel = std::vector<uint32_t>(1, 0x55d3); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55d3); auto const rel = std::vector<uint32_t>(1, 0x55d4); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55d4); auto const rel = std::vector<uint32_t>(1, 0x55d5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55d5); auto const rel = std::vector<uint32_t>(1, 0x55d6); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55d6); auto const rel = std::vector<uint32_t>(1, 0x55d7); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55d7); auto const rel = std::vector<uint32_t>(1, 0x55d8); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55d8); auto const rel = std::vector<uint32_t>(1, 0x55d9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55d9); auto const rel = std::vector<uint32_t>(1, 0x55da); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55da); auto const rel = std::vector<uint32_t>(1, 0x55db); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55db); auto const rel = std::vector<uint32_t>(1, 0x55dc); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55dc); auto const rel = std::vector<uint32_t>(1, 0x55dd); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55dd); auto const rel = std::vector<uint32_t>(1, 0x55df); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55df); auto const rel = std::vector<uint32_t>(1, 0x55e0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55e0); auto const rel = std::vector<uint32_t>(1, 0x55e1); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55e1); auto const rel = std::vector<uint32_t>(1, 0x55e2); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55e2); auto const rel = std::vector<uint32_t>(1, 0x55e3); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55e3); auto const rel = std::vector<uint32_t>(1, 0x55e4); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55e4); auto const rel = std::vector<uint32_t>(1, 0x55e5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55e5); auto const rel = std::vector<uint32_t>(1, 0x55e6); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55e6); auto const rel = std::vector<uint32_t>(1, 0x55e7); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55e7); auto const rel = std::vector<uint32_t>(1, 0x55e8); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55e8); auto const rel = std::vector<uint32_t>(1, 0x55e9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55e9); auto const rel = std::vector<uint32_t>(1, 0x55ea); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55ea); auto const rel = std::vector<uint32_t>(1, 0x55eb); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55eb); auto const rel = std::vector<uint32_t>(1, 0x55ec); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55ec); auto const rel = std::vector<uint32_t>(1, 0x55ed); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55ed); auto const rel = std::vector<uint32_t>(1, 0x55ee); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55ee); auto const rel = std::vector<uint32_t>(1, 0x55ef); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55ef); auto const rel = std::vector<uint32_t>(1, 0x55f0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55f0); auto const rel = std::vector<uint32_t>(1, 0x55f1); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55f1); auto const rel = std::vector<uint32_t>(1, 0x55f2); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55f2); auto const rel = std::vector<uint32_t>(1, 0x55f3); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55f3); auto const rel = std::vector<uint32_t>(1, 0x55f4); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55f4); auto const rel = std::vector<uint32_t>(1, 0x55f5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x55f5); auto const rel = std::vector<uint32_t>(1, 0x35d2); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x35d2); auto const rel = std::vector<uint32_t>(1, 0x35d6); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x35d6); auto const rel = std::vector<uint32_t>(1, 0x35db); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x35db); auto const rel = std::vector<uint32_t>(1, 0x35dd); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x35dd); auto const rel = std::vector<uint32_t>(1, 0x35e0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x35e0); auto const rel = std::vector<uint32_t>(1, 0x20e4c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20e4c); auto const rel = std::vector<uint32_t>(1, 0x20e6d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20e6d); auto const rel = std::vector<uint32_t>(1, 0x20e73); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20e73); auto const rel = std::vector<uint32_t>(1, 0x20e75); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20e75); auto const rel = std::vector<uint32_t>(1, 0x20e76); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20e76); auto const rel = std::vector<uint32_t>(1, 0x20e77); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20e77); auto const rel = std::vector<uint32_t>(1, 0x20e78); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20e78); auto const rel = std::vector<uint32_t>(1, 0x20e79); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20e79); auto const rel = std::vector<uint32_t>(1, 0x20e7a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20e7a); auto const rel = std::vector<uint32_t>(1, 0x20e7b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20e7b); auto const rel = std::vector<uint32_t>(1, 0x20e8c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20e8c); auto const rel = std::vector<uint32_t>(1, 0x20e96); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } } TEST(tailoring, zh_stroke_011_010) { { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20e96); auto const rel = std::vector<uint32_t>(1, 0x20e98); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20e98); auto const rel = std::vector<uint32_t>(1, 0x20e9d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20e9d); auto const rel = std::vector<uint32_t>(1, 0x20ea2); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20ea2); auto const rel = std::vector<uint32_t>(1, 0x20eaa); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20eaa); auto const rel = std::vector<uint32_t>(1, 0x20eab); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20eab); auto const rel = std::vector<uint32_t>(1, 0x20eac); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20eac); auto const rel = std::vector<uint32_t>(1, 0x20eb6); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x20eb6); auto const rel = std::vector<uint32_t>(1, 0x5711); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5711); auto const rel = std::vector<uint32_t>(1, 0x5712); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5712); auto const rel = std::vector<uint32_t>(1, 0x5713); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5713); auto const rel = std::vector<uint32_t>(1, 0x5714); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5714); auto const rel = std::vector<uint32_t>(1, 0x5715); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5715); auto const rel = std::vector<uint32_t>(1, 0x583d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x583d); auto const rel = std::vector<uint32_t>(1, 0x5843); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5843); auto const rel = std::vector<uint32_t>(1, 0x5849); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5849); auto const rel = std::vector<uint32_t>(1, 0x584a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x584a); auto const rel = std::vector<uint32_t>(1, 0x584b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x584b); auto const rel = std::vector<uint32_t>(1, 0x584c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x584c); auto const rel = std::vector<uint32_t>(1, 0x584d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x584d); auto const rel = std::vector<uint32_t>(1, 0x584e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x584e); auto const rel = std::vector<uint32_t>(1, 0x584f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x584f); auto const rel = std::vector<uint32_t>(1, 0x5850); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5850); auto const rel = std::vector<uint32_t>(1, 0x5851); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5851); auto const rel = std::vector<uint32_t>(1, 0x5852); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5852); auto const rel = std::vector<uint32_t>(1, 0x5853); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5853); auto const rel = std::vector<uint32_t>(1, 0x5854); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5854); auto const rel = std::vector<uint32_t>(1, 0x5855); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5855); auto const rel = std::vector<uint32_t>(1, 0x5856); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5856); auto const rel = std::vector<uint32_t>(1, 0x5857); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5857); auto const rel = std::vector<uint32_t>(1, 0x5858); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5858); auto const rel = std::vector<uint32_t>(1, 0x5859); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5859); auto const rel = std::vector<uint32_t>(1, 0x585a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x585a); auto const rel = std::vector<uint32_t>(1, 0x585b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x585b); auto const rel = std::vector<uint32_t>(1, 0x585c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x585c); auto const rel = std::vector<uint32_t>(1, 0x585d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x585d); auto const rel = std::vector<uint32_t>(1, 0x585e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x585e); auto const rel = std::vector<uint32_t>(1, 0x585f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x585f); auto const rel = std::vector<uint32_t>(1, 0x5860); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5860); auto const rel = std::vector<uint32_t>(1, 0x5861); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5861); auto const rel = std::vector<uint32_t>(1, 0x5862); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5862); auto const rel = std::vector<uint32_t>(1, 0x5863); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5863); auto const rel = std::vector<uint32_t>(1, 0x5864); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5864); auto const rel = std::vector<uint32_t>(1, 0x5865); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5865); auto const rel = std::vector<uint32_t>(1, 0x5866); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5866); auto const rel = std::vector<uint32_t>(1, 0x5867); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5867); auto const rel = std::vector<uint32_t>(1, 0x5868); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5868); auto const rel = std::vector<uint32_t>(1, 0x5869); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5869); auto const rel = std::vector<uint32_t>(1, 0x586a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x586a); auto const rel = std::vector<uint32_t>(1, 0x586b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x586b); auto const rel = std::vector<uint32_t>(1, 0x586c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x586c); auto const rel = std::vector<uint32_t>(1, 0x586d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } } TEST(tailoring, zh_stroke_011_011) { { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x586d); auto const rel = std::vector<uint32_t>(1, 0x586e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x586e); auto const rel = std::vector<uint32_t>(1, 0x586f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x586f); auto const rel = std::vector<uint32_t>(1, 0x5870); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5870); auto const rel = std::vector<uint32_t>(1, 0x5871); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5871); auto const rel = std::vector<uint32_t>(1, 0x365f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x365f); auto const rel = std::vector<uint32_t>(1, 0x213c5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x213c5); auto const rel = std::vector<uint32_t>(1, 0x213c6); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x213c6); auto const rel = std::vector<uint32_t>(1, 0x58fc); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x58fc); auto const rel = std::vector<uint32_t>(1, 0x5966); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5966); auto const rel = std::vector<uint32_t>(1, 0x5967); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5967); auto const rel = std::vector<uint32_t>(1, 0x5968); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5968); auto const rel = std::vector<uint32_t>(1, 0x21661); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x21661); auto const rel = std::vector<uint32_t>(1, 0x5a90); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5a90); auto const rel = std::vector<uint32_t>(1, 0x5ab0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ab0); auto const rel = std::vector<uint32_t>(1, 0x5ab1); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ab1); auto const rel = std::vector<uint32_t>(1, 0x5ab2); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ab2); auto const rel = std::vector<uint32_t>(1, 0x5ab3); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ab3); auto const rel = std::vector<uint32_t>(1, 0x5ab4); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ab4); auto const rel = std::vector<uint32_t>(1, 0x5ab5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ab5); auto const rel = std::vector<uint32_t>(1, 0x5ab6); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ab6); auto const rel = std::vector<uint32_t>(1, 0x5ab7); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ab7); auto const rel = std::vector<uint32_t>(1, 0x5ab8); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ab8); auto const rel = std::vector<uint32_t>(1, 0x5ab9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ab9); auto const rel = std::vector<uint32_t>(1, 0x5aba); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5aba); auto const rel = std::vector<uint32_t>(1, 0x5abb); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5abb); auto const rel = std::vector<uint32_t>(1, 0x5abc); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5abc); auto const rel = std::vector<uint32_t>(1, 0x5abd); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5abd); auto const rel = std::vector<uint32_t>(1, 0x5abe); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5abe); auto const rel = std::vector<uint32_t>(1, 0x5abf); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5abf); auto const rel = std::vector<uint32_t>(1, 0x5ac0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ac0); auto const rel = std::vector<uint32_t>(1, 0x5ac1); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ac1); auto const rel = std::vector<uint32_t>(1, 0x5ac2); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ac2); auto const rel = std::vector<uint32_t>(1, 0x5ac3); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ac3); auto const rel = std::vector<uint32_t>(1, 0x5ac4); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ac4); auto const rel = std::vector<uint32_t>(1, 0x5ac5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ac5); auto const rel = std::vector<uint32_t>(1, 0x5ac6); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ac6); auto const rel = std::vector<uint32_t>(1, 0x5ac7); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ac7); auto const rel = std::vector<uint32_t>(1, 0x5ac8); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ac8); auto const rel = std::vector<uint32_t>(1, 0x5ac9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ac9); auto const rel = std::vector<uint32_t>(1, 0x5aca); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5aca); auto const rel = std::vector<uint32_t>(1, 0x5acb); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5acb); auto const rel = std::vector<uint32_t>(1, 0x5acc); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5acc); auto const rel = std::vector<uint32_t>(1, 0x5acd); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5acd); auto const rel = std::vector<uint32_t>(1, 0x5ace); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ace); auto const rel = std::vector<uint32_t>(1, 0x5ad0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ad0); auto const rel = std::vector<uint32_t>(1, 0x5ad1); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ad1); auto const rel = std::vector<uint32_t>(1, 0x5ad2); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ad2); auto const rel = std::vector<uint32_t>(1, 0x5ad3); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ad3); auto const rel = std::vector<uint32_t>(1, 0x5ad4); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ad4); auto const rel = std::vector<uint32_t>(1, 0x3708); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3708); auto const rel = std::vector<uint32_t>(1, 0x370a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } } TEST(tailoring, zh_stroke_011_012) { { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x370a); auto const rel = std::vector<uint32_t>(1, 0x370d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x370d); auto const rel = std::vector<uint32_t>(1, 0x217ef); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x217ef); auto const rel = std::vector<uint32_t>(1, 0x217f5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x217f5); auto const rel = std::vector<uint32_t>(1, 0x217f6); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x217f6); auto const rel = std::vector<uint32_t>(1, 0x217f8); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x217f8); auto const rel = std::vector<uint32_t>(1, 0x217f9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x217f9); auto const rel = std::vector<uint32_t>(1, 0x217fa); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x217fa); auto const rel = std::vector<uint32_t>(1, 0x217fb); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x217fb); auto const rel = std::vector<uint32_t>(1, 0x217fc); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x217fc); auto const rel = std::vector<uint32_t>(1, 0x5b74); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5b74); auto const rel = std::vector<uint32_t>(1, 0x21983); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x21983); auto const rel = std::vector<uint32_t>(1, 0x21988); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x21988); auto const rel = std::vector<uint32_t>(1, 0x5b76); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5b76); auto const rel = std::vector<uint32_t>(1, 0x5bd6); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5bd6); auto const rel = std::vector<uint32_t>(1, 0x5bd7); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5bd7); auto const rel = std::vector<uint32_t>(1, 0x5bd8); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5bd8); auto const rel = std::vector<uint32_t>(1, 0x5bd9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5bd9); auto const rel = std::vector<uint32_t>(1, 0x5bda); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5bda); auto const rel = std::vector<uint32_t>(1, 0x5bdb); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5bdb); auto const rel = std::vector<uint32_t>(1, 0x5bdc); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5bdc); auto const rel = std::vector<uint32_t>(1, 0x5bdd); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5bdd); auto const rel = std::vector<uint32_t>(1, 0x3766); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3766); auto const rel = std::vector<uint32_t>(1, 0x21a63); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x21a63); auto const rel = std::vector<uint32_t>(1, 0x5c1f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5c1f); auto const rel = std::vector<uint32_t>(1, 0x5c20); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5c20); auto const rel = std::vector<uint32_t>(1, 0x5c32); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5c32); auto const rel = std::vector<uint32_t>(1, 0x5c33); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5c33); auto const rel = std::vector<uint32_t>(1, 0x5c34); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5c34); auto const rel = std::vector<uint32_t>(1, 0x21cac); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x21cac); auto const rel = std::vector<uint32_t>(1, 0x5d4a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d4a); auto const rel = std::vector<uint32_t>(1, 0x5d5e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d5e); auto const rel = std::vector<uint32_t>(1, 0x5d5f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d5f); auto const rel = std::vector<uint32_t>(1, 0x5d60); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d60); auto const rel = std::vector<uint32_t>(1, 0x5d61); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d61); auto const rel = std::vector<uint32_t>(1, 0x5d62); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d62); auto const rel = std::vector<uint32_t>(1, 0x5d63); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d63); auto const rel = std::vector<uint32_t>(1, 0x5d64); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d64); auto const rel = std::vector<uint32_t>(1, 0x5d65); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d65); auto const rel = std::vector<uint32_t>(1, 0x5d66); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d66); auto const rel = std::vector<uint32_t>(1, 0x5d67); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d67); auto const rel = std::vector<uint32_t>(1, 0x5d68); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d68); auto const rel = std::vector<uint32_t>(1, 0x5d69); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d69); auto const rel = std::vector<uint32_t>(1, 0x5d6a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d6a); auto const rel = std::vector<uint32_t>(1, 0x5d6c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d6c); auto const rel = std::vector<uint32_t>(1, 0x5d6d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d6d); auto const rel = std::vector<uint32_t>(1, 0x5d6e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d6e); auto const rel = std::vector<uint32_t>(1, 0x5d6f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d6f); auto const rel = std::vector<uint32_t>(1, 0x5d70); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d70); auto const rel = std::vector<uint32_t>(1, 0x5d71); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d71); auto const rel = std::vector<uint32_t>(1, 0x5d72); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d72); auto const rel = std::vector<uint32_t>(1, 0x5d73); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } } TEST(tailoring, zh_stroke_011_013) { { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d73); auto const rel = std::vector<uint32_t>(1, 0x5d74); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d74); auto const rel = std::vector<uint32_t>(1, 0x5d75); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d75); auto const rel = std::vector<uint32_t>(1, 0x5d76); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5d76); auto const rel = std::vector<uint32_t>(1, 0x37f2); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x37f2); auto const rel = std::vector<uint32_t>(1, 0x37f8); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x37f8); auto const rel = std::vector<uint32_t>(1, 0x21ec8); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x21ec8); auto const rel = std::vector<uint32_t>(1, 0x21ed5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x21ed5); auto const rel = std::vector<uint32_t>(1, 0x5df0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5df0); auto const rel = std::vector<uint32_t>(1, 0x5e4a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5e4a); auto const rel = std::vector<uint32_t>(1, 0x5e4b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5e4b); auto const rel = std::vector<uint32_t>(1, 0x5e4c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5e4c); auto const rel = std::vector<uint32_t>(1, 0x5e4d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5e4d); auto const rel = std::vector<uint32_t>(1, 0x5e4e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5e4e); auto const rel = std::vector<uint32_t>(1, 0x5e4f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5e4f); auto const rel = std::vector<uint32_t>(1, 0x5e79); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5e79); auto const rel = std::vector<uint32_t>(1, 0x5ec5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ec5); auto const rel = std::vector<uint32_t>(1, 0x5ec6); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ec6); auto const rel = std::vector<uint32_t>(1, 0x5ec7); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ec7); auto const rel = std::vector<uint32_t>(1, 0x5ec8); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ec8); auto const rel = std::vector<uint32_t>(1, 0x5ec9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ec9); auto const rel = std::vector<uint32_t>(1, 0x5ecb); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ecb); auto const rel = std::vector<uint32_t>(1, 0x5ecc); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5ecc); auto const rel = std::vector<uint32_t>(1, 0x2227c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x2227c); auto const rel = std::vector<uint32_t>(1, 0x5f12); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5f12); auto const rel = std::vector<uint32_t>(1, 0x5f3f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5f3f); auto const rel = std::vector<uint32_t>(1, 0x5f40); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5f40); auto const rel = std::vector<uint32_t>(1, 0x5f41); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5f41); auto const rel = std::vector<uint32_t>(1, 0x5f42); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5f42); auto const rel = std::vector<uint32_t>(1, 0x5f59); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5f59); auto const rel = std::vector<uint32_t>(1, 0x5f5a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5f5a); auto const rel = std::vector<uint32_t>(1, 0x22465); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x22465); auto const rel = std::vector<uint32_t>(1, 0x5f6e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5f6e); auto const rel = std::vector<uint32_t>(1, 0x5fac); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5fac); auto const rel = std::vector<uint32_t>(1, 0x5fad); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5fad); auto const rel = std::vector<uint32_t>(1, 0x5fae); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5fae); auto const rel = std::vector<uint32_t>(1, 0x5faf); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5faf); auto const rel = std::vector<uint32_t>(1, 0x5fb0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x5fb0); auto const rel = std::vector<uint32_t>(1, 0x60f3); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x60f3); auto const rel = std::vector<uint32_t>(1, 0x60f7); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x60f7); auto const rel = std::vector<uint32_t>(1, 0x60f9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x60f9); auto const rel = std::vector<uint32_t>(1, 0x6101); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6101); auto const rel = std::vector<uint32_t>(1, 0x6102); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6102); auto const rel = std::vector<uint32_t>(1, 0x6106); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6106); auto const rel = std::vector<uint32_t>(1, 0x6108); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6108); auto const rel = std::vector<uint32_t>(1, 0x610d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x610d); auto const rel = std::vector<uint32_t>(1, 0x610f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x610f); auto const rel = std::vector<uint32_t>(1, 0x6117); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6117); auto const rel = std::vector<uint32_t>(1, 0x6119); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6119); auto const rel = std::vector<uint32_t>(1, 0x611a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x611a); auto const rel = std::vector<uint32_t>(1, 0x611b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x611b); auto const rel = std::vector<uint32_t>(1, 0x611f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } } TEST(tailoring, zh_stroke_011_014) { { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x611f); auto const rel = std::vector<uint32_t>(1, 0x3963); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3963); auto const rel = std::vector<uint32_t>(1, 0x3964); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3964); auto const rel = std::vector<uint32_t>(1, 0x3966); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3966); auto const rel = std::vector<uint32_t>(1, 0x6127); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6127); auto const rel = std::vector<uint32_t>(1, 0x6129); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6129); auto const rel = std::vector<uint32_t>(1, 0x612a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x612a); auto const rel = std::vector<uint32_t>(1, 0x612b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x612b); auto const rel = std::vector<uint32_t>(1, 0x612d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x612d); auto const rel = std::vector<uint32_t>(1, 0x612e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x612e); auto const rel = std::vector<uint32_t>(1, 0x612f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x612f); auto const rel = std::vector<uint32_t>(1, 0x6130); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6130); auto const rel = std::vector<uint32_t>(1, 0x6131); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6131); auto const rel = std::vector<uint32_t>(1, 0x6132); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6132); auto const rel = std::vector<uint32_t>(1, 0x6134); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6134); auto const rel = std::vector<uint32_t>(1, 0x6135); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6135); auto const rel = std::vector<uint32_t>(1, 0x6136); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6136); auto const rel = std::vector<uint32_t>(1, 0x6137); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6137); auto const rel = std::vector<uint32_t>(1, 0x6139); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6139); auto const rel = std::vector<uint32_t>(1, 0x613a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x613a); auto const rel = std::vector<uint32_t>(1, 0x613c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x613c); auto const rel = std::vector<uint32_t>(1, 0x613d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x613d); auto const rel = std::vector<uint32_t>(1, 0x613e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x613e); auto const rel = std::vector<uint32_t>(1, 0x6140); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6140); auto const rel = std::vector<uint32_t>(1, 0x6143); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6143); auto const rel = std::vector<uint32_t>(1, 0x6144); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6144); auto const rel = std::vector<uint32_t>(1, 0x6145); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6145); auto const rel = std::vector<uint32_t>(1, 0x6146); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6146); auto const rel = std::vector<uint32_t>(1, 0x6149); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6149); auto const rel = std::vector<uint32_t>(1, 0x614a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x614a); auto const rel = std::vector<uint32_t>(1, 0x614c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x614c); auto const rel = std::vector<uint32_t>(1, 0x614d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x614d); auto const rel = std::vector<uint32_t>(1, 0x614e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x614e); auto const rel = std::vector<uint32_t>(1, 0x614f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x614f); auto const rel = std::vector<uint32_t>(1, 0x6151); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6151); auto const rel = std::vector<uint32_t>(1, 0x22796); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x22796); auto const rel = std::vector<uint32_t>(1, 0x227b4); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x227b4); auto const rel = std::vector<uint32_t>(1, 0x227b5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x227b5); auto const rel = std::vector<uint32_t>(1, 0x227cd); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x227cd); auto const rel = std::vector<uint32_t>(1, 0x6226); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6226); auto const rel = std::vector<uint32_t>(1, 0x6220); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6220); auto const rel = std::vector<uint32_t>(1, 0x6221); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6221); auto const rel = std::vector<uint32_t>(1, 0x6222); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6222); auto const rel = std::vector<uint32_t>(1, 0x6223); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6223); auto const rel = std::vector<uint32_t>(1, 0x6224); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6224); auto const rel = std::vector<uint32_t>(1, 0x6225); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6225); auto const rel = std::vector<uint32_t>(1, 0x63e7); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x63e7); auto const rel = std::vector<uint32_t>(1, 0x63eb); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x63eb); auto const rel = std::vector<uint32_t>(1, 0x63f1); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x63f1); auto const rel = std::vector<uint32_t>(1, 0x6406); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6406); auto const rel = std::vector<uint32_t>(1, 0x6407); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6407); auto const rel = std::vector<uint32_t>(1, 0x6408); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } } TEST(tailoring, zh_stroke_011_015) { { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6408); auto const rel = std::vector<uint32_t>(1, 0x6409); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6409); auto const rel = std::vector<uint32_t>(1, 0x640a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x640a); auto const rel = std::vector<uint32_t>(1, 0x640b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x640b); auto const rel = std::vector<uint32_t>(1, 0x640c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x640c); auto const rel = std::vector<uint32_t>(1, 0x640d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x640d); auto const rel = std::vector<uint32_t>(1, 0x640e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x640e); auto const rel = std::vector<uint32_t>(1, 0x640f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x640f); auto const rel = std::vector<uint32_t>(1, 0x6410); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6410); auto const rel = std::vector<uint32_t>(1, 0x6411); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6411); auto const rel = std::vector<uint32_t>(1, 0x6412); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6412); auto const rel = std::vector<uint32_t>(1, 0x6413); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6413); auto const rel = std::vector<uint32_t>(1, 0x6414); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6414); auto const rel = std::vector<uint32_t>(1, 0x6415); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6415); auto const rel = std::vector<uint32_t>(1, 0x6416); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6416); auto const rel = std::vector<uint32_t>(1, 0x6417); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6417); auto const rel = std::vector<uint32_t>(1, 0x6418); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6418); auto const rel = std::vector<uint32_t>(1, 0x6419); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6419); auto const rel = std::vector<uint32_t>(1, 0x641a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x641a); auto const rel = std::vector<uint32_t>(1, 0x641b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x641b); auto const rel = std::vector<uint32_t>(1, 0x641c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x641c); auto const rel = std::vector<uint32_t>(1, 0x641d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x641d); auto const rel = std::vector<uint32_t>(1, 0x641e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x641e); auto const rel = std::vector<uint32_t>(1, 0x641f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x641f); auto const rel = std::vector<uint32_t>(1, 0x6420); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6420); auto const rel = std::vector<uint32_t>(1, 0x6421); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6421); auto const rel = std::vector<uint32_t>(1, 0x6422); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6422); auto const rel = std::vector<uint32_t>(1, 0x6423); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6423); auto const rel = std::vector<uint32_t>(1, 0x6424); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6424); auto const rel = std::vector<uint32_t>(1, 0x6425); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6425); auto const rel = std::vector<uint32_t>(1, 0x6426); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6426); auto const rel = std::vector<uint32_t>(1, 0x6427); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6427); auto const rel = std::vector<uint32_t>(1, 0x6428); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6428); auto const rel = std::vector<uint32_t>(1, 0x6429); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6429); auto const rel = std::vector<uint32_t>(1, 0x642a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x642a); auto const rel = std::vector<uint32_t>(1, 0x642c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x642c); auto const rel = std::vector<uint32_t>(1, 0x642d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x642d); auto const rel = std::vector<uint32_t>(1, 0x642e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x642e); auto const rel = std::vector<uint32_t>(1, 0x642f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x642f); auto const rel = std::vector<uint32_t>(1, 0x6430); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6430); auto const rel = std::vector<uint32_t>(1, 0x6432); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6432); auto const rel = std::vector<uint32_t>(1, 0x6433); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6433); auto const rel = std::vector<uint32_t>(1, 0x6435); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6435); auto const rel = std::vector<uint32_t>(1, 0x6436); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6436); auto const rel = std::vector<uint32_t>(1, 0x6437); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6437); auto const rel = std::vector<uint32_t>(1, 0x6438); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6438); auto const rel = std::vector<uint32_t>(1, 0x6439); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6439); auto const rel = std::vector<uint32_t>(1, 0x643a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x643a); auto const rel = std::vector<uint32_t>(1, 0x643c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x643c); auto const rel = std::vector<uint32_t>(1, 0x643d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x643d); auto const rel = std::vector<uint32_t>(1, 0x643e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x643e); auto const rel = std::vector<uint32_t>(1, 0x6440); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } } TEST(tailoring, zh_stroke_011_016) { { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6440); auto const rel = std::vector<uint32_t>(1, 0x6441); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6441); auto const rel = std::vector<uint32_t>(1, 0x6442); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6442); auto const rel = std::vector<uint32_t>(1, 0x6443); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6443); auto const rel = std::vector<uint32_t>(1, 0x6444); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6444); auto const rel = std::vector<uint32_t>(1, 0x6445); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6445); auto const rel = std::vector<uint32_t>(1, 0x6446); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6446); auto const rel = std::vector<uint32_t>(1, 0x6447); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6447); auto const rel = std::vector<uint32_t>(1, 0x6448); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6448); auto const rel = std::vector<uint32_t>(1, 0x6449); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6449); auto const rel = std::vector<uint32_t>(1, 0x644a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x644a); auto const rel = std::vector<uint32_t>(1, 0x3a20); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3a20); auto const rel = std::vector<uint32_t>(1, 0x3a23); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3a23); auto const rel = std::vector<uint32_t>(1, 0x3a26); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3a26); auto const rel = std::vector<uint32_t>(1, 0x3a29); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3a29); auto const rel = std::vector<uint32_t>(1, 0x3a2a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3a2a); auto const rel = std::vector<uint32_t>(1, 0x22c62); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x22c62); auto const rel = std::vector<uint32_t>(1, 0x22c88); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x22c88); auto const rel = std::vector<uint32_t>(1, 0x22c9b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x22c9b); auto const rel = std::vector<uint32_t>(1, 0x22ca1); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x22ca1); auto const rel = std::vector<uint32_t>(1, 0x22ca9); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x22ca9); auto const rel = std::vector<uint32_t>(1, 0x22cb2); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x22cb2); auto const rel = std::vector<uint32_t>(1, 0x63c5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x63c5); auto const rel = std::vector<uint32_t>(1, 0x6431); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6431); auto const rel = std::vector<uint32_t>(1, 0x656d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x656d); auto const rel = std::vector<uint32_t>(1, 0x656b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x656b); auto const rel = std::vector<uint32_t>(1, 0x656c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x656c); auto const rel = std::vector<uint32_t>(1, 0x656e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x656e); auto const rel = std::vector<uint32_t>(1, 0x656f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x656f); auto const rel = std::vector<uint32_t>(1, 0x6570); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6570); auto const rel = std::vector<uint32_t>(1, 0x6592); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6592); auto const rel = std::vector<uint32_t>(1, 0x295b0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x295b0); auto const rel = std::vector<uint32_t>(1, 0x659f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x659f); auto const rel = std::vector<uint32_t>(1, 0x65b0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x65b0); auto const rel = std::vector<uint32_t>(1, 0x65d2); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x65d2); auto const rel = std::vector<uint32_t>(1, 0x65d3); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x65d3); auto const rel = std::vector<uint32_t>(1, 0x65d4); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x65d4); auto const rel = std::vector<uint32_t>(1, 0x65d5); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x65d5); auto const rel = std::vector<uint32_t>(1, 0x65e4); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x65e4); auto const rel = std::vector<uint32_t>(1, 0x6678); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6678); auto const rel = std::vector<uint32_t>(1, 0x6684); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6684); auto const rel = std::vector<uint32_t>(1, 0x6685); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6685); auto const rel = std::vector<uint32_t>(1, 0x6686); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6686); auto const rel = std::vector<uint32_t>(1, 0x6687); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6687); auto const rel = std::vector<uint32_t>(1, 0x6688); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6688); auto const rel = std::vector<uint32_t>(1, 0x6689); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6689); auto const rel = std::vector<uint32_t>(1, 0x668a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x668a); auto const rel = std::vector<uint32_t>(1, 0x668b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x668b); auto const rel = std::vector<uint32_t>(1, 0x668c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x668c); auto const rel = std::vector<uint32_t>(1, 0x668d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x668d); auto const rel = std::vector<uint32_t>(1, 0x668e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x668e); auto const rel = std::vector<uint32_t>(1, 0x668f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } } TEST(tailoring, zh_stroke_011_017) { { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x668f); auto const rel = std::vector<uint32_t>(1, 0x6690); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6690); auto const rel = std::vector<uint32_t>(1, 0x6692); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6692); auto const rel = std::vector<uint32_t>(1, 0x6693); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6693); auto const rel = std::vector<uint32_t>(1, 0x6694); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6694); auto const rel = std::vector<uint32_t>(1, 0x6695); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6695); auto const rel = std::vector<uint32_t>(1, 0x6696); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6696); auto const rel = std::vector<uint32_t>(1, 0x6697); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6697); auto const rel = std::vector<uint32_t>(1, 0x6698); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6698); auto const rel = std::vector<uint32_t>(1, 0x6699); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6699); auto const rel = std::vector<uint32_t>(1, 0x3b01); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3b01); auto const rel = std::vector<uint32_t>(1, 0x3b02); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3b02); auto const rel = std::vector<uint32_t>(1, 0x3b03); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3b03); auto const rel = std::vector<uint32_t>(1, 0x3b04); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3b04); auto const rel = std::vector<uint32_t>(1, 0x3b05); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3b05); auto const rel = std::vector<uint32_t>(1, 0x3b06); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3b06); auto const rel = std::vector<uint32_t>(1, 0x3b07); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3b07); auto const rel = std::vector<uint32_t>(1, 0x3b08); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3b08); auto const rel = std::vector<uint32_t>(1, 0x3b09); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3b09); auto const rel = std::vector<uint32_t>(1, 0x3b0a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3b0a); auto const rel = std::vector<uint32_t>(1, 0x3b0b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3b0b); auto const rel = std::vector<uint32_t>(1, 0x3b0c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3b0c); auto const rel = std::vector<uint32_t>(1, 0x23225); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x23225); auto const rel = std::vector<uint32_t>(1, 0x2322f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x2322f); auto const rel = std::vector<uint32_t>(1, 0x23231); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x23231); auto const rel = std::vector<uint32_t>(1, 0x23232); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x23232); auto const rel = std::vector<uint32_t>(1, 0x23233); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x23233); auto const rel = std::vector<uint32_t>(1, 0x23234); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x23234); auto const rel = std::vector<uint32_t>(1, 0x6703); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6703); auto const rel = std::vector<uint32_t>(1, 0x6720); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6720); auto const rel = std::vector<uint32_t>(1, 0x6721); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6721); auto const rel = std::vector<uint32_t>(1, 0x692f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x692f); auto const rel = std::vector<uint32_t>(1, 0x6930); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6930); auto const rel = std::vector<uint32_t>(1, 0x6931); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6931); auto const rel = std::vector<uint32_t>(1, 0x6932); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6932); auto const rel = std::vector<uint32_t>(1, 0x6933); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6933); auto const rel = std::vector<uint32_t>(1, 0x6934); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6934); auto const rel = std::vector<uint32_t>(1, 0x6935); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6935); auto const rel = std::vector<uint32_t>(1, 0x6936); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6936); auto const rel = std::vector<uint32_t>(1, 0x6937); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6937); auto const rel = std::vector<uint32_t>(1, 0x6938); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6938); auto const rel = std::vector<uint32_t>(1, 0x6939); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6939); auto const rel = std::vector<uint32_t>(1, 0x693a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x693a); auto const rel = std::vector<uint32_t>(1, 0x693b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x693b); auto const rel = std::vector<uint32_t>(1, 0x693c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x693c); auto const rel = std::vector<uint32_t>(1, 0x693d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x693d); auto const rel = std::vector<uint32_t>(1, 0x693e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x693e); auto const rel = std::vector<uint32_t>(1, 0x693f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x693f); auto const rel = std::vector<uint32_t>(1, 0x6940); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6940); auto const rel = std::vector<uint32_t>(1, 0x6941); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6941); auto const rel = std::vector<uint32_t>(1, 0x6942); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6942); auto const rel = std::vector<uint32_t>(1, 0x6943); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } } TEST(tailoring, zh_stroke_011_018) { { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6943); auto const rel = std::vector<uint32_t>(1, 0x6944); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6944); auto const rel = std::vector<uint32_t>(1, 0x6945); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6945); auto const rel = std::vector<uint32_t>(1, 0x6946); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6946); auto const rel = std::vector<uint32_t>(1, 0x6947); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6947); auto const rel = std::vector<uint32_t>(1, 0x6948); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6948); auto const rel = std::vector<uint32_t>(1, 0x6949); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6949); auto const rel = std::vector<uint32_t>(1, 0x694a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x694a); auto const rel = std::vector<uint32_t>(1, 0x694b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x694b); auto const rel = std::vector<uint32_t>(1, 0x694c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x694c); auto const rel = std::vector<uint32_t>(1, 0x694d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x694d); auto const rel = std::vector<uint32_t>(1, 0x694e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x694e); auto const rel = std::vector<uint32_t>(1, 0x694f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x694f); auto const rel = std::vector<uint32_t>(1, 0x6950); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6950); auto const rel = std::vector<uint32_t>(1, 0x6951); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6951); auto const rel = std::vector<uint32_t>(1, 0x6952); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6952); auto const rel = std::vector<uint32_t>(1, 0x6953); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6953); auto const rel = std::vector<uint32_t>(1, 0x6954); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6954); auto const rel = std::vector<uint32_t>(1, 0x6955); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6955); auto const rel = std::vector<uint32_t>(1, 0x6957); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6957); auto const rel = std::vector<uint32_t>(1, 0x6958); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6958); auto const rel = std::vector<uint32_t>(1, 0x6959); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6959); auto const rel = std::vector<uint32_t>(1, 0x695a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x695a); auto const rel = std::vector<uint32_t>(1, 0x695b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x695b); auto const rel = std::vector<uint32_t>(1, 0x695c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x695c); auto const rel = std::vector<uint32_t>(1, 0x695d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x695d); auto const rel = std::vector<uint32_t>(1, 0x695e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x695e); auto const rel = std::vector<uint32_t>(1, 0x695f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x695f); auto const rel = std::vector<uint32_t>(1, 0x6960); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6960); auto const rel = std::vector<uint32_t>(1, 0x6961); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6961); auto const rel = std::vector<uint32_t>(1, 0x6962); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6962); auto const rel = std::vector<uint32_t>(1, 0x6963); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6963); auto const rel = std::vector<uint32_t>(1, 0x6964); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6964); auto const rel = std::vector<uint32_t>(1, 0x6965); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6965); auto const rel = std::vector<uint32_t>(1, 0x6966); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6966); auto const rel = std::vector<uint32_t>(1, 0x6967); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6967); auto const rel = std::vector<uint32_t>(1, 0x6968); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6968); auto const rel = std::vector<uint32_t>(1, 0x6969); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6969); auto const rel = std::vector<uint32_t>(1, 0x696a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x696a); auto const rel = std::vector<uint32_t>(1, 0x696b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x696b); auto const rel = std::vector<uint32_t>(1, 0x696c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x696c); auto const rel = std::vector<uint32_t>(1, 0x696d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x696d); auto const rel = std::vector<uint32_t>(1, 0x696f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x696f); auto const rel = std::vector<uint32_t>(1, 0x6971); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6971); auto const rel = std::vector<uint32_t>(1, 0x6972); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6972); auto const rel = std::vector<uint32_t>(1, 0x6973); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6973); auto const rel = std::vector<uint32_t>(1, 0x6974); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6974); auto const rel = std::vector<uint32_t>(1, 0x6975); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6975); auto const rel = std::vector<uint32_t>(1, 0x6976); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6976); auto const rel = std::vector<uint32_t>(1, 0x6977); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6977); auto const rel = std::vector<uint32_t>(1, 0x6978); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6978); auto const rel = std::vector<uint32_t>(1, 0x6979); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } } TEST(tailoring, zh_stroke_011_019) { { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6979); auto const rel = std::vector<uint32_t>(1, 0x697a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x697a); auto const rel = std::vector<uint32_t>(1, 0x697b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x697b); auto const rel = std::vector<uint32_t>(1, 0x697c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x697c); auto const rel = std::vector<uint32_t>(1, 0x697d); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x697d); auto const rel = std::vector<uint32_t>(1, 0x697e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x697e); auto const rel = std::vector<uint32_t>(1, 0x697f); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x697f); auto const rel = std::vector<uint32_t>(1, 0x6980); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6980); auto const rel = std::vector<uint32_t>(1, 0x6981); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6981); auto const rel = std::vector<uint32_t>(1, 0x6982); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6982); auto const rel = std::vector<uint32_t>(1, 0x6983); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6983); auto const rel = std::vector<uint32_t>(1, 0x6984); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6984); auto const rel = std::vector<uint32_t>(1, 0x6985); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6985); auto const rel = std::vector<uint32_t>(1, 0x6986); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6986); auto const rel = std::vector<uint32_t>(1, 0x6987); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6987); auto const rel = std::vector<uint32_t>(1, 0x6988); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6988); auto const rel = std::vector<uint32_t>(1, 0x6989); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6989); auto const rel = std::vector<uint32_t>(1, 0x698b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x698b); auto const rel = std::vector<uint32_t>(1, 0x698c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x698c); auto const rel = std::vector<uint32_t>(1, 0x6994); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6994); auto const rel = std::vector<uint32_t>(1, 0x6998); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6998); auto const rel = std::vector<uint32_t>(1, 0xfa13); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0xfa13); auto const rel = std::vector<uint32_t>(1, 0x3b95); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3b95); auto const rel = std::vector<uint32_t>(1, 0x3b96); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3b96); auto const rel = std::vector<uint32_t>(1, 0x3b99); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3b99); auto const rel = std::vector<uint32_t>(1, 0x23551); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x23551); auto const rel = std::vector<uint32_t>(1, 0x2355a); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x2355a); auto const rel = std::vector<uint32_t>(1, 0x23567); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x23567); auto const rel = std::vector<uint32_t>(1, 0x23595); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x23595); auto const rel = std::vector<uint32_t>(1, 0x23599); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x23599); auto const rel = std::vector<uint32_t>(1, 0x2359c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x2359c); auto const rel = std::vector<uint32_t>(1, 0x6b40); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6b40); auto const rel = std::vector<uint32_t>(1, 0x6b41); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6b41); auto const rel = std::vector<uint32_t>(1, 0x6b42); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6b42); auto const rel = std::vector<uint32_t>(1, 0x6b43); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6b43); auto const rel = std::vector<uint32_t>(1, 0x6b44); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6b44); auto const rel = std::vector<uint32_t>(1, 0x6b45); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6b45); auto const rel = std::vector<uint32_t>(1, 0x6b46); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6b46); auto const rel = std::vector<uint32_t>(1, 0x6b47); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6b47); auto const rel = std::vector<uint32_t>(1, 0x6b48); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6b48); auto const rel = std::vector<uint32_t>(1, 0x3c3c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3c3c); auto const rel = std::vector<uint32_t>(1, 0x3c3e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3c3e); auto const rel = std::vector<uint32_t>(1, 0x6b71); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6b71); auto const rel = std::vector<uint32_t>(1, 0x6b72); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6b72); auto const rel = std::vector<uint32_t>(1, 0x6b73); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6b73); auto const rel = std::vector<uint32_t>(1, 0x6b9b); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6b9b); auto const rel = std::vector<uint32_t>(1, 0x6b9c); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6b9c); auto const rel = std::vector<uint32_t>(1, 0x3c6e); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x3c6e); auto const rel = std::vector<uint32_t>(1, 0x6bbf); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6bbf); auto const rel = std::vector<uint32_t>(1, 0x6bc0); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6bc0); auto const rel = std::vector<uint32_t>(1, 0x6bc1); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } { // greater than (or equal to, for =) preceeding cps auto const res = std::vector<uint32_t>(1, 0x6bc1); auto const rel = std::vector<uint32_t>(1, 0x6bc2); std::string const res_str = to_string(res); std::string const rel_str = to_string(rel); auto const res_view = as_utf32(res); auto const rel_view = as_utf32(rel); EXPECT_EQ(collate( res.begin(), res.end(), rel.begin(), rel.end(), table(), collation_strength::primary), -1); EXPECT_EQ(collate( res_view.begin(), res_view.end(), rel_view.begin(), rel_view.end(), table(), collation_strength::primary), -1); } }
[STATEMENT] lemma Id_on_int: "Id_on A O f = (A \<times> UNIV) \<inter> f" [PROOF STATE] proof (prove) goal (1 subgoal): 1. Id_on A O f = A \<times> UNIV \<inter> f [PROOF STEP] by auto
def do_case(i): print(cases[i]) (dirname, n_pdfs, n_params) = cases[i] (z_low, z_high) = datasets[dirname]['z_ends'] z = np.arange(z_low, z_high, 0.01, dtype='float') z_range = z_high - z_low delta_z = z_range / len(z) with open(datasets[dirname]['filename'], 'rb') as data_file: lines = (line.split(None) for line in data_file) lines.next() all_pdfs = np.array([[float(line[k]) for k in range(1,len(line))] for line in lines]) n_pdfs_tot = len(all_pdfs) full_pdf_range = range(n_pdfs_tot) subset = np.random.choice(full_pdf_range, n_pdfs) pdfs = all_pdfs[subset] nz_stats = {} nz_stats['KLD'] = {} nz_stats['RMS'] = {} pr = cProfile.Profile() pr.enable() E0 = qp.Ensemble(n_pdfs, gridded=(z, pdfs), vb=False) samparr = E0.sample(n_samps, vb=False) Ei = qp.Ensemble(n_pdfs, samples=samparr, vb=False) fits = Ei.mix_mod_fit(comps=datasets[dirname]['n_comps'], using='gridded', vb=False) Ef = qp.Ensemble(n_pdfs, truth=fits, vb=False) P = qp.PDF(gridded=Ef.stack(z, using='mix_mod', vb=False)['mix_mod'], vb=False) # pr = cProfile.Profile() # pr.enable() Eq = qp.Ensemble(n_pdfs, quantiles=Ef.quantize(N=n_params)) Q = qp.PDF(gridded=Eq.stack(z, using='quantiles', vb=False)['quantiles'], vb=False) nz_stats['KLD']['quantiles'] = qp.utils.calculate_kl_divergence(P, Q) nz_stats['RMS']['quantiles'] = qp.utils.calculate_rmse(P, Q) Eh = qp.Ensemble(n_pdfs, histogram=Ef.histogramize(N=n_params, binrange=datasets[dirname]['z_ends'])) Q = qp.PDF(gridded=Eh.stack(z, using='histogram', vb=False)['histogram'], vb=False) nz_stats['KLD']['histogram'] = qp.utils.calculate_kl_divergence(P, Q) nz_stats['RMS']['histogram'] = qp.utils.calculate_rmse(P, Q) Es = qp.Ensemble(n_pdfs, samples=Ef.sample(samps=n_params)) Q = qp.PDF(gridded=Es.stack(z, using='samples', vb=False)['samples'], vb=False) nz_stats['KLD']['samples'] = qp.utils.calculate_kl_divergence(P, Q) nz_stats['RMS']['samples'] = qp.utils.calculate_rmse(P, Q) pr.disable() s = StringIO.StringIO() sortby = 'cumtime' ps = pstats.Stats(pr, stream=s).sort_stats(sortby) ps.print_stats() with open(logfilename, 'wb') as logfile: logfile.write('ran case '+str(cases[i])+' with '+str(s.getvalue())+'\n') print(n_pdfs, n_params, s.getvalue()) all_stats[str(i)] = nz_stats outpath = os.path.join(dirname, str(n_pdfs)+dirname+str(n_params)+'.hkl') with open(outpath, 'w') as outfile: hkl.dump(nz_stats, outfile) return if __name__ == "__main__": import os import itertools import numpy as np import cProfile import pstats import StringIO import hickle as hkl # import pathos import matplotlib.pyplot as plt import qp logfilename = 'progress.txt' datasets = {} datasets['mg'] = {} datasets['mg']['filename'] = 'bpz_euclid_test_10_2.probs' datasets['mg']['z_ends'] = (0.01, 3.51) datasets['mg']['n_comps'] = 3 datasets['ss'] = {} datasets['ss']['filename'] = 'test_magscat_trainingfile_probs.out' datasets['ss']['z_ends'] = (0.005, 2.11) datasets['ss']['n_comps'] = 5 for dirname in datasets.keys(): if not os.path.exists(dirname): os.makedirs(dirname) n_samps = 1000 n_gals = [10000] n_params_to_test = [3, 10, 30, 100] params_to_test = ['samples', 'histogram', 'quantiles'] cases = list(itertools.product(datasets.keys(), n_gals, n_params_to_test)) case_range = range(len(cases)) all_stats = {} # nps = psutil.cpu_count() # pool = Pool(nps) # final = pool.map(do_case, case_range) for i in case_range: do_case(i)
{-# OPTIONS --safe #-} {- Properties of nullary relations, i.e. structures on types. Includes several results from [Notions of Anonymous Existence in Martin-Löf Type Theory](https://lmcs.episciences.org/3217) by Altenkirch, Coquand, Escardo, Kraus. -} module Cubical.Relation.Nullary.Properties where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Function open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.Equiv open import Cubical.Functions.Fixpoint open import Cubical.Data.Empty as ⊥ open import Cubical.Relation.Nullary.Base open import Cubical.HITs.PropositionalTruncation.Base private variable ℓ : Level A : Type ℓ IsoPresDiscrete : ∀ {ℓ ℓ'}{A : Type ℓ} {B : Type ℓ'} → Iso A B → Discrete A → Discrete B IsoPresDiscrete e dA x y with dA (Iso.inv e x) (Iso.inv e y) ... | yes p = subst Dec (λ i → Iso.rightInv e x i ≡ Iso.rightInv e y i) (yes (cong (Iso.fun e) p)) ... | no p = subst Dec (λ i → Iso.rightInv e x i ≡ Iso.rightInv e y i) (no λ q → p (sym (Iso.leftInv e (Iso.inv e x)) ∙∙ cong (Iso.inv e) q ∙∙ Iso.leftInv e (Iso.inv e y))) EquivPresDiscrete : ∀ {ℓ ℓ'}{A : Type ℓ} {B : Type ℓ'} → A ≃ B → Discrete A → Discrete B EquivPresDiscrete e = IsoPresDiscrete (equivToIso e) isProp¬ : (A : Type ℓ) → isProp (¬ A) isProp¬ A p q i x = isProp⊥ (p x) (q x) i Stable¬ : Stable (¬ A) Stable¬ ¬¬¬a a = ¬¬¬a ¬¬a where ¬¬a = λ ¬a → ¬a a fromYes : A → Dec A → A fromYes _ (yes a) = a fromYes a (no _) = a discreteDec : (Adis : Discrete A) → Discrete (Dec A) discreteDec Adis (yes p) (yes p') = decideYes (Adis p p') -- TODO: monad would simply stuff where decideYes : Dec (p ≡ p') → Dec (yes p ≡ yes p') decideYes (yes eq) = yes (cong yes eq) decideYes (no ¬eq) = no λ eq → ¬eq (cong (fromYes p) eq) discreteDec Adis (yes p) (no ¬p) = ⊥.rec (¬p p) discreteDec Adis (no ¬p) (yes p) = ⊥.rec (¬p p) discreteDec {A = A} Adis (no ¬p) (no ¬p') = yes (cong no (isProp¬ A ¬p ¬p')) isPropDec : (Aprop : isProp A) → isProp (Dec A) isPropDec Aprop (yes a) (yes a') = cong yes (Aprop a a') isPropDec Aprop (yes a) (no ¬a) = ⊥.rec (¬a a) isPropDec Aprop (no ¬a) (yes a) = ⊥.rec (¬a a) isPropDec {A = A} Aprop (no ¬a) (no ¬a') = cong no (isProp¬ A ¬a ¬a') mapDec : ∀ {B : Type ℓ} → (A → B) → (¬ A → ¬ B) → Dec A → Dec B mapDec f _ (yes p) = yes (f p) mapDec _ f (no ¬p) = no (f ¬p) EquivPresDec : ∀ {ℓ ℓ'}{A : Type ℓ} {B : Type ℓ'} → A ≃ B → Dec A → Dec B EquivPresDec p = mapDec (p .fst) (λ f → f ∘ invEq p) ¬→¬∥∥ : ¬ A → ¬ ∥ A ∥ ¬→¬∥∥ ¬p ∣ a ∣ = ¬p a ¬→¬∥∥ ¬p (squash x y i) = isProp⊥ (¬→¬∥∥ ¬p x) (¬→¬∥∥ ¬p y) i Dec∥∥ : Dec A → Dec ∥ A ∥ Dec∥∥ = mapDec ∣_∣ ¬→¬∥∥ -- we have the following implications -- X ── ∣_∣ ─→ ∥ X ∥ -- ∥ X ∥ ── populatedBy ─→ ⟪ X ⟫ -- ⟪ X ⟫ ── notEmptyPopulated ─→ NonEmpty X -- reexport propositional truncation for uniformity open Cubical.HITs.PropositionalTruncation.Base using (∣_∣) public populatedBy : ∥ A ∥ → ⟪ A ⟫ populatedBy {A = A} a (f , fIsConst) = h a where h : ∥ A ∥ → Fixpoint f h ∣ a ∣ = f a , fIsConst (f a) a h (squash a b i) = 2-Constant→isPropFixpoint f fIsConst (h a) (h b) i notEmptyPopulated : ⟪ A ⟫ → NonEmpty A notEmptyPopulated {A = A} pop u = u (fixpoint (pop (h , hIsConst))) where h : A → A h a = ⊥.elim (u a) hIsConst : ∀ x y → h x ≡ h y hIsConst x y i = ⊥.elim (isProp⊥ (u x) (u y) i) -- these implications induce the following for different kinds of stability, gradually weakening the assumption Dec→Stable : Dec A → Stable A Dec→Stable (yes x) = λ _ → x Dec→Stable (no x) = λ f → ⊥.elim (f x) Stable→PStable : Stable A → PStable A Stable→PStable st = st ∘ notEmptyPopulated PStable→SplitSupport : PStable A → SplitSupport A PStable→SplitSupport pst = pst ∘ populatedBy -- Although SplitSupport and Collapsible are not properties, their path versions, HSeparated and Collapsible≡, are. -- Nevertheless they are logically equivalent SplitSupport→Collapsible : SplitSupport A → Collapsible A SplitSupport→Collapsible {A = A} hst = h , hIsConst where h : A → A h p = hst ∣ p ∣ hIsConst : 2-Constant h hIsConst p q i = hst (squash ∣ p ∣ ∣ q ∣ i) Collapsible→SplitSupport : Collapsible A → SplitSupport A Collapsible→SplitSupport f x = fixpoint (populatedBy x f) HSeparated→Collapsible≡ : HSeparated A → Collapsible≡ A HSeparated→Collapsible≡ hst x y = SplitSupport→Collapsible (hst x y) Collapsible≡→HSeparated : Collapsible≡ A → HSeparated A Collapsible≡→HSeparated col x y = Collapsible→SplitSupport (col x y) -- stability of path space under truncation or path collapsability are necessary and sufficient properties -- for a a type to be a set. Collapsible≡→isSet : Collapsible≡ A → isSet A Collapsible≡→isSet {A = A} col a b p q = p≡q where f : (x : A) → a ≡ x → a ≡ x f x = col a x .fst fIsConst : (x : A) → (p q : a ≡ x) → f x p ≡ f x q fIsConst x = col a x .snd rem : (p : a ≡ b) → PathP (λ i → a ≡ p i) (f a refl) (f b p) rem p j = f (p j) (λ i → p (i ∧ j)) p≡q : p ≡ q p≡q j i = hcomp (λ k → λ { (i = i0) → f a refl k ; (i = i1) → fIsConst b p q j k ; (j = i0) → rem p i k ; (j = i1) → rem q i k }) a HSeparated→isSet : HSeparated A → isSet A HSeparated→isSet = Collapsible≡→isSet ∘ HSeparated→Collapsible≡ isSet→HSeparated : isSet A → HSeparated A isSet→HSeparated setA x y = extract where extract : ∥ x ≡ y ∥ → x ≡ y extract ∣ p ∣ = p extract (squash p q i) = setA x y (extract p) (extract q) i -- by the above more sufficient conditions to inhibit isSet A are given PStable≡→HSeparated : PStable≡ A → HSeparated A PStable≡→HSeparated pst x y = PStable→SplitSupport (pst x y) PStable≡→isSet : PStable≡ A → isSet A PStable≡→isSet = HSeparated→isSet ∘ PStable≡→HSeparated Separated→PStable≡ : Separated A → PStable≡ A Separated→PStable≡ st x y = Stable→PStable (st x y) Separated→isSet : Separated A → isSet A Separated→isSet = PStable≡→isSet ∘ Separated→PStable≡ -- Proof of Hedberg's theorem: a type with decidable equality is an h-set Discrete→Separated : Discrete A → Separated A Discrete→Separated d x y = Dec→Stable (d x y) Discrete→isSet : Discrete A → isSet A Discrete→isSet = Separated→isSet ∘ Discrete→Separated
function compute_movie_file(A, filename, options) % compute_movie_file - create an avi or gif file % % compute_movie_file(A, filename, options); % % A can be a 3D array or a cell array of 2D matrices. % Each A{k} or A(:,:,k) is one frame in the animation. % % Output avi or gif file depending on the extension of the filename. % (you can also use options.format='avi' or 'gif') % % Copyright (c) 2007 Gabriel Peyre options.null = 0; fps = getoptions(options, 'fps', 10); format = getoptions(options, 'format', []); if isempty(format) % find extension i = strfind(filename,'.'); if isempty(i) error('Does not recognize extension, you should specify options.format.'); end format = filename(i+1:end); end if not(iscell(A)) && not(isstr(A)) B = A; A = {}; for i=1:size(B,3) A{end+1} = B(:,:,i); end clear B; end % close all; % figure; if iscell(A) nb = length(A); else nb = length( dir([A '*.png']) ); end if strcmp(format, 'avi') % 'Indeo3', 'Indeo5', 'Cinepak', 'MSVC', 'RLE' or 'None' compressor = 'Cinepak'; compressor = 'none'; qual = 50; aviobj = avifile(filename, 'compression', compressor, 'quality', qual, 'fps', fps ); % aviobj = avifile(filename, 'fps', fps ); end imap = getoptions(options, 'colormap', jet(256)); loopCount = getoptions(options, 'loopcount', 1); for j=1:nb progressbar(j,nb); if iscell(A) B = A{j}; else % A is a filename B = load_image( [A '-' num2string_fixeddigit(j-1,3)] ); end B = round(rescale( B, 1,256)); switch format case 'avi' if size(B,3)==3 frame = im2frame( rescale(B) ); else frame = im2frame(B,gray(256)); end % imageplot(A{j}); % frame = getframe ( gca ); aviobj = addframe( aviobj, frame ); case 'gif' warning off; if j==1 imwrite(B,imap,filename,'gif',... 'DelayTime',1/fps, 'LoopCount',loopCount,... 'WriteMode','overwrite') else imwrite(B,imap,filename,'gif','WriteMode','append',... 'DelayTime',1/fps); end warning on; otherwise error('Unknown format'); end end if strcmp(format, 'avi') warning off; aviobj = close( aviobj ); warning on; end
open import Common.Prelude renaming (Nat to ℕ; _+_ to _+ℕ_) open import Common.Product open import Common.Equality postulate _≤ℕ_ : (n m : ℕ) → Set maxℕ : (n m : ℕ) → ℕ When : (b : Bool) (P : Set) → Set When true P = P When false P = ⊤ infix 30 _⊕_ infix 20 _+_ infix 10 _≤_ infix 10 _<_ infixr 4 _,_ mutual data Cxt : Set where ∘ : Cxt _,_ : (Δ : Cxt) (b : Size Δ) → Cxt data Var : (Δ : Cxt) → Set where vz : ∀{Δ b} → Var (Δ , b) vs : ∀{Δ b} (i : Var Δ) → Var (Δ , b) data Base (Δ : Cxt) : Set where zero : Base Δ ∞ : Base Δ var : Var Δ → Base Δ record Size (Δ : Cxt) : Set where inductive constructor _⊕_ field h : Base Δ n : ℕ ↑ : ∀{Δ} (a : Size Δ) → Size Δ ↑ (h ⊕ n) = h ⊕ suc n _+_ : ∀{Δ} (a : Size Δ) (m : ℕ) → Size Δ (h ⊕ n) + m = h ⊕ (n +ℕ m) _-_ : ∀{Δ} (a : Size Δ) (m : ℕ) → Size Δ (h ⊕ n) - m = h ⊕ (n ∸ m) ClosedSize = Size ∘ data _≤_ : (a b : ClosedSize) → Set where leZZ : ∀{n m} (p : n ≤ℕ m) → zero ⊕ n ≤ zero ⊕ m leZ∞ : ∀{n m} → zero ⊕ n ≤ ∞ ⊕ m le∞∞ : ∀{n m} (p : n ≤ℕ m) → ∞ ⊕ n ≤ ∞ ⊕ m _<_ : (a b : ClosedSize) → Set a < b = ↑ a ≤ b max : (a b : ClosedSize) → ClosedSize max (zero ⊕ n) (zero ⊕ n') = zero ⊕ maxℕ n n' max (zero ⊕ n) (∞ ⊕ n') = ∞ ⊕ n' max (zero ⊕ n) (var () ⊕ n') max (∞ ⊕ n) (zero ⊕ n') = ∞ ⊕ n max (∞ ⊕ n) (∞ ⊕ n') = ∞ ⊕ maxℕ n n' max (∞ ⊕ n) (var () ⊕ n') max (var () ⊕ n) -- Closed size valuation mutual data Val (chk : Bool) : (Δ : Cxt) → Set where ∘ : Val chk ∘ _,_<_∣_ : ∀{Δ} (ξ : Val chk Δ) (a : ClosedSize) b (p : When chk (a < eval ξ b)) → Val chk (Δ , b) lookup : ∀{Δ chk} (ξ : Val chk Δ) (x : Var Δ) → ClosedSize lookup (ξ , a < b ∣ p) vz = a lookup (ξ , a < b ∣ p) (vs x) = lookup ξ x evalBase : ∀{Δ chk} (ξ : Val chk Δ) (a : Base Δ) → ClosedSize evalBase ξ zero = zero ⊕ 0 evalBase ξ ∞ = ∞ ⊕ 0 evalBase ξ (var x) = lookup ξ x eval : ∀{Δ chk} (ξ : Val chk Δ) (a : Size Δ) → ClosedSize eval ξ (h ⊕ n) = evalBase ξ h + n UVal = Val false -- unsound valuation SVal = Val true -- sound valuation update : ∀{Δ} (ρ : UVal Δ) (x : Var Δ) (f : ClosedSize → ClosedSize) → UVal Δ update (ρ , a < b ∣ _) vz f = ρ , f a < b ∣ _ update (ρ , a < b ∣ _) (vs x) f = update ρ x f , a < b ∣ _ data _≤V_ {chk chk'} : ∀ {Δ} (ρ : Val chk Δ) (ξ : Val chk' Δ) → Set where ∘ : ∘ ≤V ∘ _,_ : ∀{Δ} {ρ : Val chk Δ} {ξ : Val chk' Δ} {a a' b p q} (r : ρ ≤V ξ) (s : a ≤ a') → (ρ , a < b ∣ p) ≤V (ξ , a' < b ∣ q) lemma-str : ∀ {Δ} (x : Var Δ) {n} {a} {ρ : UVal Δ} {ξ : SVal Δ} → (p : ρ ≤V ξ) → (q : a < lookup ξ x + n) → update ρ x (max (↑ a - n)) ≤V ξ lemma-str vz (p , s) q = {!q!} lemma-str (vs x) (p , s) q = {!q!}
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Algebra.Group.Base where open import Cubical.Foundations.Prelude open import Cubical.Foundations.SIP open import Cubical.Data.Sigma open import Cubical.Data.Int renaming (_+_ to _+Int_ ; _-_ to _-Int_) open import Cubical.Data.Unit open import Cubical.Algebra.Monoid open import Cubical.Algebra.Semigroup open import Cubical.Foundations.HLevels private variable ℓ : Level record IsGroup {G : Type ℓ} (0g : G) (_+_ : G → G → G) (-_ : G → G) : Type ℓ where constructor isgroup field isMonoid : IsMonoid 0g _+_ inverse : (x : G) → (x + (- x) ≡ 0g) × ((- x) + x ≡ 0g) open IsMonoid isMonoid public infixl 6 _-_ _-_ : G → G → G x - y = x + (- y) invl : (x : G) → (- x) + x ≡ 0g invl x = inverse x .snd invr : (x : G) → x + (- x) ≡ 0g invr x = inverse x .fst record GroupStr (G : Type ℓ) : Type (ℓ-suc ℓ) where constructor groupstr field 0g : G _+_ : G → G → G -_ : G → G isGroup : IsGroup 0g _+_ -_ infix 8 -_ infixr 7 _+_ open IsGroup isGroup public Group : Type (ℓ-suc ℓ) Group = TypeWithStr _ GroupStr Group₀ : Type₁ Group₀ = Group {ℓ-zero} group : (G : Type ℓ) (0g : G) (_+_ : G → G → G) (-_ : G → G) (h : IsGroup 0g _+_ -_) → Group group G 0g _+_ -_ h = G , groupstr 0g _+_ -_ h isSetGroup : (G : Group {ℓ}) → isSet ⟨ G ⟩ isSetGroup G = GroupStr.isGroup (snd G) .IsGroup.isMonoid .IsMonoid.isSemigroup .IsSemigroup.is-set makeIsGroup : {G : Type ℓ} {0g : G} {_+_ : G → G → G} { -_ : G → G} (is-setG : isSet G) (assoc : (x y z : G) → x + (y + z) ≡ (x + y) + z) (rid : (x : G) → x + 0g ≡ x) (lid : (x : G) → 0g + x ≡ x) (rinv : (x : G) → x + (- x) ≡ 0g) (linv : (x : G) → (- x) + x ≡ 0g) → IsGroup 0g _+_ -_ IsGroup.isMonoid (makeIsGroup is-setG assoc rid lid rinv linv) = makeIsMonoid is-setG assoc rid lid IsGroup.inverse (makeIsGroup is-setG assoc rid lid rinv linv) = λ x → rinv x , linv x makeGroup : {G : Type ℓ} (0g : G) (_+_ : G → G → G) (-_ : G → G) (is-setG : isSet G) (assoc : (x y z : G) → x + (y + z) ≡ (x + y) + z) (rid : (x : G) → x + 0g ≡ x) (lid : (x : G) → 0g + x ≡ x) (rinv : (x : G) → x + (- x) ≡ 0g) (linv : (x : G) → (- x) + x ≡ 0g) → Group makeGroup 0g _+_ -_ is-setG assoc rid lid rinv linv = _ , helper where helper : GroupStr _ GroupStr.0g helper = 0g GroupStr._+_ helper = _+_ GroupStr.- helper = -_ GroupStr.isGroup helper = makeIsGroup is-setG assoc rid lid rinv linv makeGroup-right : ∀ {ℓ} {A : Type ℓ} → (id : A) → (comp : A → A → A) → (inv : A → A) → (set : isSet A) → (assoc : ∀ a b c → comp a (comp b c) ≡ comp (comp a b) c) → (rUnit : ∀ a → comp a id ≡ a) → (rCancel : ∀ a → comp a (inv a) ≡ id) → Group makeGroup-right id comp inv set assoc rUnit rCancel = makeGroup id comp inv set assoc rUnit lUnit rCancel lCancel where _⨀_ = comp abstract lCancel : ∀ a → comp (inv a) a ≡ id lCancel a = inv a ⨀ a ≡⟨ sym (rUnit (comp (inv a) a)) ⟩ (inv a ⨀ a) ⨀ id ≡⟨ cong (comp (comp (inv a) a)) (sym (rCancel (inv a))) ⟩ (inv a ⨀ a) ⨀ (inv a ⨀ (inv (inv a))) ≡⟨ assoc _ _ _ ⟩ ((inv a ⨀ a) ⨀ (inv a)) ⨀ (inv (inv a)) ≡⟨ cong (λ □ → □ ⨀ _) (sym (assoc _ _ _)) ⟩ (inv a ⨀ (a ⨀ inv a)) ⨀ (inv (inv a)) ≡⟨ cong (λ □ → (inv a ⨀ □) ⨀ (inv (inv a))) (rCancel a) ⟩ (inv a ⨀ id) ⨀ (inv (inv a)) ≡⟨ cong (λ □ → □ ⨀ (inv (inv a))) (rUnit (inv a)) ⟩ inv a ⨀ (inv (inv a)) ≡⟨ rCancel (inv a) ⟩ id ∎ lUnit : ∀ a → comp id a ≡ a lUnit a = id ⨀ a ≡⟨ cong (λ b → comp b a) (sym (rCancel a)) ⟩ (a ⨀ inv a) ⨀ a ≡⟨ sym (assoc _ _ _) ⟩ a ⨀ (inv a ⨀ a) ≡⟨ cong (comp a) (lCancel a) ⟩ a ⨀ id ≡⟨ rUnit a ⟩ a ∎ makeGroup-left : ∀ {ℓ} {A : Type ℓ} → (id : A) → (comp : A → A → A) → (inv : A → A) → (set : isSet A) → (assoc : ∀ a b c → comp a (comp b c) ≡ comp (comp a b) c) → (lUnit : ∀ a → comp id a ≡ a) → (lCancel : ∀ a → comp (inv a) a ≡ id) → Group makeGroup-left id comp inv set assoc lUnit lCancel = makeGroup id comp inv set assoc rUnit lUnit rCancel lCancel where abstract rCancel : ∀ a → comp a (inv a) ≡ id rCancel a = comp a (inv a) ≡⟨ sym (lUnit (comp a (inv a))) ⟩ comp id (comp a (inv a)) ≡⟨ cong (λ b → comp b (comp a (inv a))) (sym (lCancel (inv a))) ⟩ comp (comp (inv (inv a)) (inv a)) (comp a (inv a)) ≡⟨ sym (assoc (inv (inv a)) (inv a) (comp a (inv a))) ⟩ comp (inv (inv a)) (comp (inv a) (comp a (inv a))) ≡⟨ cong (comp (inv (inv a))) (assoc (inv a) a (inv a)) ⟩ comp (inv (inv a)) (comp (comp (inv a) a) (inv a)) ≡⟨ cong (λ b → comp (inv (inv a)) (comp b (inv a))) (lCancel a) ⟩ comp (inv (inv a)) (comp id (inv a)) ≡⟨ cong (comp (inv (inv a))) (lUnit (inv a)) ⟩ comp (inv (inv a)) (inv a) ≡⟨ lCancel (inv a) ⟩ id ∎ rUnit : ∀ a → comp a id ≡ a rUnit a = comp a id ≡⟨ cong (comp a) (sym (lCancel a)) ⟩ comp a (comp (inv a) a) ≡⟨ assoc a (inv a) a ⟩ comp (comp a (inv a)) a ≡⟨ cong (λ b → comp b a) (rCancel a) ⟩ comp id a ≡⟨ lUnit a ⟩ a ∎ open GroupStr hiding (0g ; _+_ ; -_) isSetCarrier : ∀ {ℓ} → (G : Group {ℓ}) → isSet ⟨ G ⟩ isSetCarrier G = IsSemigroup.is-set (IsMonoid.isSemigroup (GroupStr.isMonoid (snd G))) open GroupStr dirProd : ∀ {ℓ ℓ'} → Group {ℓ} → Group {ℓ'} → Group dirProd (GC , G) (HC , H) = makeGroup (0g G , 0g H) (λ { (x1 , x2) (y1 , y2) → _+_ G x1 y1 , _+_ H x2 y2 }) (λ { (x1 , x2) → -_ G x1 , -_ H x2 }) (isSet× (isSetCarrier (GC , G)) (isSetCarrier (HC , H))) (λ { (x1 , x2) (y1 , y2) (z1 , z2) i → assoc G x1 y1 z1 i , assoc H x2 y2 z2 i }) (λ { (x1 , x2) i → GroupStr.rid G x1 i , GroupStr.rid H x2 i }) (λ { (x1 , x2) i → GroupStr.lid G x1 i , GroupStr.lid H x2 i }) (λ { (x1 , x2) i → GroupStr.invr G x1 i , GroupStr.invr H x2 i }) (λ { (x1 , x2) i → GroupStr.invl G x1 i , GroupStr.invl H x2 i }) trivialGroup : Group₀ trivialGroup = Unit , groupstr tt (λ _ _ → tt) (λ _ → tt) (makeIsGroup isSetUnit (λ _ _ _ → refl) (λ _ → refl) (λ _ → refl) (λ _ → refl) (λ _ → refl)) intGroup : Group₀ intGroup = Int , groupstr 0 _+Int_ (0 -Int_) (makeIsGroup isSetInt +-assoc (λ x → refl) (λ x → +-comm 0 x) (λ x → +-comm x (pos 0 -Int x) ∙ minusPlus x 0) (λ x → minusPlus x 0))
function [B, L, N, A] = imBoundaryContours(bin, varargin) %IMBOUNDARYCONTOURS Extract polygonal contours of a binary image. % % CNTS = imBoundaryContours(BIN) % Computes a set of contours corresponding to the structures in binary % image BIN. The result CNTS is a cell array of polygons, each polygon % being a N-by-2 array containing the vertex coordinates. % % This function is mainly a wrapper to the 'bwboundaries' function, that % returns the resulting set of contours in a different format. % % % Example % % draw the polygon corresponding to a single region % img = imread('circles.png'); % polys = imContours(img); % figure; imshow(img); hold on; % drawPolygon(polys, 'r') % % See also % bwboundaries, imcontour, imOtsuThreshold, imContourLines % contourMatrixToPolylines (MatGeom toolbox) % % ------ % Author: David Legland % e-mail: [email protected] % Created: 2012-07-27, using Matlab 7.9.0.529 (R2009b) % Copyright 2012 INRA - Cepia Software Platform. % check input image is binary if ~isempty(varargin) error('Requires input image to be binary.'); end % call the native bwboundaries function [B, L, N, A] = bwboundaries(bin); % object boundaries for i = 1:N bnd = B{i}; B{i} = bnd(:, [2 1]); end % hole boundaries for i = N+1:length(B) bnd = B{i}; B{i} = bnd([1 end:-1:2], [2 1]); end
Formal statement is: lemma smult_dvd_iff: "smult a p dvd q \<longleftrightarrow> (if a = 0 then q = 0 else p dvd q)" for a :: "'a::field" Informal statement is: A polynomial $p$ divides a polynomial $q$ if and only if $p$ divides $q$ or $q = 0$.
/- Copyright (c) 2020 Scott Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Scott Morrison, Bhavik Mehta ! This file was ported from Lean 3 source module category_theory.limits.shapes.regular_mono ! leanprover-community/mathlib commit f47581155c818e6361af4e4fda60d27d020c226b ! Please do not edit these lines, except to modify the commit id ! if you have ported upstream changes. -/ import Mathbin.CategoryTheory.Limits.Shapes.Pullbacks import Mathbin.CategoryTheory.Limits.Shapes.StrongEpi import Mathbin.CategoryTheory.Limits.Shapes.Equalizers /-! # Definitions and basic properties of regular monomorphisms and epimorphisms. > THIS FILE IS SYNCHRONIZED WITH MATHLIB4. > Any changes to this file require a corresponding PR to mathlib4. A regular monomorphism is a morphism that is the equalizer of some parallel pair. We give the constructions * `is_split_mono → regular_mono` and * `regular_mono → mono` as well as the dual constructions for regular epimorphisms. Additionally, we give the construction * `regular_epi ⟶ strong_epi`. We also define classes `regular_mono_category` and `regular_epi_category` for categories in which every monomorphism or epimorphism is regular, and deduce that these categories are `strong_mono_category`s resp. `strong_epi_category`s. -/ noncomputable section namespace CategoryTheory open CategoryTheory.Limits universe v₁ u₁ u₂ variable {C : Type u₁} [Category.{v₁} C] variable {X Y : C} #print CategoryTheory.RegularMono /- /-- A regular monomorphism is a morphism which is the equalizer of some parallel pair. -/ class RegularMono (f : X ⟶ Y) where z : C (left right : Y ⟶ Z) w : f ≫ left = f ≫ right IsLimit : IsLimit (Fork.ofι f w) #align category_theory.regular_mono CategoryTheory.RegularMono -/ attribute [reassoc.1] regular_mono.w #print CategoryTheory.RegularMono.mono /- /-- Every regular monomorphism is a monomorphism. -/ instance (priority := 100) RegularMono.mono (f : X ⟶ Y) [RegularMono f] : Mono f := mono_of_isLimit_fork RegularMono.isLimit #align category_theory.regular_mono.mono CategoryTheory.RegularMono.mono -/ #print CategoryTheory.equalizerRegular /- instance equalizerRegular (g h : X ⟶ Y) [HasLimit (parallelPair g h)] : RegularMono (equalizer.ι g h) where z := Y left := g right := h w := equalizer.condition g h IsLimit := Fork.IsLimit.mk _ (fun s => limit.lift _ s) (by simp) fun s m w => by ext1 simp [← w] #align category_theory.equalizer_regular CategoryTheory.equalizerRegular -/ #print CategoryTheory.RegularMono.ofIsSplitMono /- /-- Every split monomorphism is a regular monomorphism. -/ instance (priority := 100) RegularMono.ofIsSplitMono (f : X ⟶ Y) [IsSplitMono f] : RegularMono f where z := Y left := 𝟙 Y right := retraction f ≫ f w := by tidy IsLimit := isSplitMonoEqualizes f #align category_theory.regular_mono.of_is_split_mono CategoryTheory.RegularMono.ofIsSplitMono -/ #print CategoryTheory.RegularMono.lift' /- /-- If `f` is a regular mono, then any map `k : W ⟶ Y` equalizing `regular_mono.left` and `regular_mono.right` induces a morphism `l : W ⟶ X` such that `l ≫ f = k`. -/ def RegularMono.lift' {W : C} (f : X ⟶ Y) [RegularMono f] (k : W ⟶ Y) (h : k ≫ (RegularMono.left : Y ⟶ @RegularMono.z _ _ _ _ f _) = k ≫ RegularMono.right) : { l : W ⟶ X // l ≫ f = k } := Fork.IsLimit.lift' RegularMono.isLimit _ h #align category_theory.regular_mono.lift' CategoryTheory.RegularMono.lift' -/ #print CategoryTheory.regularOfIsPullbackSndOfRegular /- /-- The second leg of a pullback cone is a regular monomorphism if the right component is too. See also `pullback.snd_of_mono` for the basic monomorphism version, and `regular_of_is_pullback_fst_of_regular` for the flipped version. -/ def regularOfIsPullbackSndOfRegular {P Q R S : C} {f : P ⟶ Q} {g : P ⟶ R} {h : Q ⟶ S} {k : R ⟶ S} [hr : RegularMono h] (comm : f ≫ h = g ≫ k) (t : IsLimit (PullbackCone.mk _ _ comm)) : RegularMono g where z := hr.z left := k ≫ hr.left right := k ≫ hr.right w := by rw [← reassoc_of comm, ← reassoc_of comm, hr.w] IsLimit := by apply fork.is_limit.mk' _ _ intro s have l₁ : (fork.ι s ≫ k) ≫ regular_mono.left = (fork.ι s ≫ k) ≫ regular_mono.right rw [category.assoc, s.condition, category.assoc] obtain ⟨l, hl⟩ := fork.is_limit.lift' hr.is_limit _ l₁ obtain ⟨p, hp₁, hp₂⟩ := pullback_cone.is_limit.lift' t _ _ hl refine' ⟨p, hp₂, _⟩ intro m w have z : m ≫ g = p ≫ g := w.trans hp₂.symm apply t.hom_ext apply (pullback_cone.mk f g comm).equalizer_ext · erw [← cancel_mono h, category.assoc, category.assoc, comm, reassoc_of z] · exact z #align category_theory.regular_of_is_pullback_snd_of_regular CategoryTheory.regularOfIsPullbackSndOfRegular -/ #print CategoryTheory.regularOfIsPullbackFstOfRegular /- /-- The first leg of a pullback cone is a regular monomorphism if the left component is too. See also `pullback.fst_of_mono` for the basic monomorphism version, and `regular_of_is_pullback_snd_of_regular` for the flipped version. -/ def regularOfIsPullbackFstOfRegular {P Q R S : C} {f : P ⟶ Q} {g : P ⟶ R} {h : Q ⟶ S} {k : R ⟶ S} [hr : RegularMono k] (comm : f ≫ h = g ≫ k) (t : IsLimit (PullbackCone.mk _ _ comm)) : RegularMono f := regularOfIsPullbackSndOfRegular comm.symm (PullbackCone.flipIsLimit t) #align category_theory.regular_of_is_pullback_fst_of_regular CategoryTheory.regularOfIsPullbackFstOfRegular -/ #print CategoryTheory.strongMono_of_regularMono /- instance (priority := 100) strongMono_of_regularMono (f : X ⟶ Y) [RegularMono f] : StrongMono f := StrongMono.mk' (by intro A B z hz u v sq have : v ≫ (regular_mono.left : Y ⟶ regular_mono.Z f) = v ≫ regular_mono.right := by apply (cancel_epi z).1 simp only [regular_mono.w, ← reassoc_of sq.w] obtain ⟨t, ht⟩ := regular_mono.lift' _ _ this refine' comm_sq.has_lift.mk' ⟨t, (cancel_mono f).1 _, ht⟩ simp only [arrow.mk_hom, arrow.hom_mk'_left, category.assoc, ht, sq.w]) #align category_theory.strong_mono_of_regular_mono CategoryTheory.strongMono_of_regularMono -/ #print CategoryTheory.isIso_of_regularMono_of_epi /- /-- A regular monomorphism is an isomorphism if it is an epimorphism. -/ theorem isIso_of_regularMono_of_epi (f : X ⟶ Y) [RegularMono f] [e : Epi f] : IsIso f := isIso_of_epi_of_strongMono _ #align category_theory.is_iso_of_regular_mono_of_epi CategoryTheory.isIso_of_regularMono_of_epi -/ section variable (C) #print CategoryTheory.RegularMonoCategory /- /-- A regular mono category is a category in which every monomorphism is regular. -/ class RegularMonoCategory where regularMonoOfMono : ∀ {X Y : C} (f : X ⟶ Y) [Mono f], RegularMono f #align category_theory.regular_mono_category CategoryTheory.RegularMonoCategory -/ end #print CategoryTheory.regularMonoOfMono /- /-- In a category in which every monomorphism is regular, we can express every monomorphism as an equalizer. This is not an instance because it would create an instance loop. -/ def regularMonoOfMono [RegularMonoCategory C] (f : X ⟶ Y) [Mono f] : RegularMono f := RegularMonoCategory.regularMonoOfMono _ #align category_theory.regular_mono_of_mono CategoryTheory.regularMonoOfMono -/ #print CategoryTheory.regularMonoCategoryOfSplitMonoCategory /- instance (priority := 100) regularMonoCategoryOfSplitMonoCategory [SplitMonoCategory C] : RegularMonoCategory C where regularMonoOfMono _ _ f _ := by haveI := is_split_mono_of_mono f infer_instance #align category_theory.regular_mono_category_of_split_mono_category CategoryTheory.regularMonoCategoryOfSplitMonoCategory -/ #print CategoryTheory.strongMonoCategory_of_regularMonoCategory /- instance (priority := 100) strongMonoCategory_of_regularMonoCategory [RegularMonoCategory C] : StrongMonoCategory C where strongMono_of_mono _ _ f _ := by haveI := regular_mono_of_mono f infer_instance #align category_theory.strong_mono_category_of_regular_mono_category CategoryTheory.strongMonoCategory_of_regularMonoCategory -/ #print CategoryTheory.RegularEpi /- /-- A regular epimorphism is a morphism which is the coequalizer of some parallel pair. -/ class RegularEpi (f : X ⟶ Y) where w : C (left right : W ⟶ X) w : left ≫ f = right ≫ f IsColimit : IsColimit (Cofork.ofπ f w) #align category_theory.regular_epi CategoryTheory.RegularEpi -/ attribute [reassoc.1] regular_epi.w #print CategoryTheory.RegularEpi.epi /- /-- Every regular epimorphism is an epimorphism. -/ instance (priority := 100) RegularEpi.epi (f : X ⟶ Y) [RegularEpi f] : Epi f := epi_of_isColimit_cofork RegularEpi.isColimit #align category_theory.regular_epi.epi CategoryTheory.RegularEpi.epi -/ #print CategoryTheory.coequalizerRegular /- instance coequalizerRegular (g h : X ⟶ Y) [HasColimit (parallelPair g h)] : RegularEpi (coequalizer.π g h) where w := X left := g right := h w := coequalizer.condition g h IsColimit := Cofork.IsColimit.mk _ (fun s => colimit.desc _ s) (by simp) fun s m w => by ext1 simp [← w] #align category_theory.coequalizer_regular CategoryTheory.coequalizerRegular -/ #print CategoryTheory.RegularEpi.ofSplitEpi /- /-- Every split epimorphism is a regular epimorphism. -/ instance (priority := 100) RegularEpi.ofSplitEpi (f : X ⟶ Y) [IsSplitEpi f] : RegularEpi f where w := X left := 𝟙 X right := f ≫ section_ f w := by tidy IsColimit := isSplitEpiCoequalizes f #align category_theory.regular_epi.of_split_epi CategoryTheory.RegularEpi.ofSplitEpi -/ /- warning: category_theory.regular_epi.desc' -> CategoryTheory.RegularEpi.desc' is a dubious translation: lean 3 declaration is forall {C : Type.{u2}} [_inst_1 : CategoryTheory.Category.{u1, u2} C] {X : C} {Y : C} {W : C} (f : Quiver.Hom.{succ u1, u2} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u2} C (CategoryTheory.Category.toCategoryStruct.{u1, u2} C _inst_1)) X Y) [_inst_2 : CategoryTheory.RegularEpi.{u1, u2} C _inst_1 X Y f] (k : Quiver.Hom.{succ u1, u2} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u2} C (CategoryTheory.Category.toCategoryStruct.{u1, u2} C _inst_1)) X W), (Eq.{succ u1} (Quiver.Hom.{succ u1, u2} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u2} C (CategoryTheory.Category.toCategoryStruct.{u1, u2} C _inst_1)) (CategoryTheory.RegularEpi.w.{u1, u2} C _inst_1 X Y f _inst_2) W) (CategoryTheory.CategoryStruct.comp.{u1, u2} C (CategoryTheory.Category.toCategoryStruct.{u1, u2} C _inst_1) (CategoryTheory.RegularEpi.w.{u1, u2} C _inst_1 X Y f _inst_2) X W (CategoryTheory.RegularEpi.left.{u1, u2} C _inst_1 X Y f _inst_2) k) (CategoryTheory.CategoryStruct.comp.{u1, u2} C (CategoryTheory.Category.toCategoryStruct.{u1, u2} C _inst_1) (CategoryTheory.RegularEpi.w.{u1, u2} C _inst_1 X Y f _inst_2) X W (CategoryTheory.RegularEpi.right.{u1, u2} C _inst_1 X Y f _inst_2) k)) -> (Subtype.{succ u1} (Quiver.Hom.{succ u1, u2} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u2} C (CategoryTheory.Category.toCategoryStruct.{u1, u2} C _inst_1)) Y W) (fun (l : Quiver.Hom.{succ u1, u2} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u2} C (CategoryTheory.Category.toCategoryStruct.{u1, u2} C _inst_1)) Y W) => Eq.{succ u1} (Quiver.Hom.{succ u1, u2} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u2} C (CategoryTheory.Category.toCategoryStruct.{u1, u2} C _inst_1)) X W) (CategoryTheory.CategoryStruct.comp.{u1, u2} C (CategoryTheory.Category.toCategoryStruct.{u1, u2} C _inst_1) X Y W f l) k)) but is expected to have type forall {C : Type.{u2}} [_inst_1 : CategoryTheory.Category.{u1, u2} C] {X : C} {Y : C} {W : C} (f : Quiver.Hom.{succ u1, u2} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u2} C (CategoryTheory.Category.toCategoryStruct.{u1, u2} C _inst_1)) X Y) [_inst_2 : CategoryTheory.RegularEpi.{u1, u2} C _inst_1 X Y f] (k : Quiver.Hom.{succ u1, u2} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u2} C (CategoryTheory.Category.toCategoryStruct.{u1, u2} C _inst_1)) X W), (Eq.{succ u1} (Quiver.Hom.{succ u1, u2} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u2} C (CategoryTheory.Category.toCategoryStruct.{u1, u2} C _inst_1)) (CategoryTheory.RegularEpi.W.{u1, u2} C _inst_1 X Y f _inst_2) W) (CategoryTheory.CategoryStruct.comp.{u1, u2} C (CategoryTheory.Category.toCategoryStruct.{u1, u2} C _inst_1) (CategoryTheory.RegularEpi.W.{u1, u2} C _inst_1 X Y f _inst_2) X W (CategoryTheory.RegularEpi.left.{u1, u2} C _inst_1 X Y f _inst_2) k) (CategoryTheory.CategoryStruct.comp.{u1, u2} C (CategoryTheory.Category.toCategoryStruct.{u1, u2} C _inst_1) (CategoryTheory.RegularEpi.W.{u1, u2} C _inst_1 X Y f _inst_2) X W (CategoryTheory.RegularEpi.right.{u1, u2} C _inst_1 X Y f _inst_2) k)) -> (Subtype.{succ u1} (Quiver.Hom.{succ u1, u2} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u2} C (CategoryTheory.Category.toCategoryStruct.{u1, u2} C _inst_1)) Y W) (fun (l : Quiver.Hom.{succ u1, u2} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u2} C (CategoryTheory.Category.toCategoryStruct.{u1, u2} C _inst_1)) Y W) => Eq.{succ u1} (Quiver.Hom.{succ u1, u2} C (CategoryTheory.CategoryStruct.toQuiver.{u1, u2} C (CategoryTheory.Category.toCategoryStruct.{u1, u2} C _inst_1)) X W) (CategoryTheory.CategoryStruct.comp.{u1, u2} C (CategoryTheory.Category.toCategoryStruct.{u1, u2} C _inst_1) X Y W f l) k)) Case conversion may be inaccurate. Consider using '#align category_theory.regular_epi.desc' CategoryTheory.RegularEpi.desc'ₓ'. -/ /-- If `f` is a regular epi, then every morphism `k : X ⟶ W` coequalizing `regular_epi.left` and `regular_epi.right` induces `l : Y ⟶ W` such that `f ≫ l = k`. -/ def RegularEpi.desc' {W : C} (f : X ⟶ Y) [RegularEpi f] (k : X ⟶ W) (h : (RegularEpi.left : RegularEpi.w f ⟶ X) ≫ k = RegularEpi.right ≫ k) : { l : Y ⟶ W // f ≫ l = k } := Cofork.IsColimit.desc' RegularEpi.isColimit _ h #align category_theory.regular_epi.desc' CategoryTheory.RegularEpi.desc' #print CategoryTheory.regularOfIsPushoutSndOfRegular /- /-- The second leg of a pushout cocone is a regular epimorphism if the right component is too. See also `pushout.snd_of_epi` for the basic epimorphism version, and `regular_of_is_pushout_fst_of_regular` for the flipped version. -/ def regularOfIsPushoutSndOfRegular {P Q R S : C} {f : P ⟶ Q} {g : P ⟶ R} {h : Q ⟶ S} {k : R ⟶ S} [gr : RegularEpi g] (comm : f ≫ h = g ≫ k) (t : IsColimit (PushoutCocone.mk _ _ comm)) : RegularEpi h where w := gr.w left := gr.left ≫ f right := gr.right ≫ f w := by rw [category.assoc, category.assoc, comm, reassoc_of gr.w] IsColimit := by apply cofork.is_colimit.mk' _ _ intro s have l₁ : gr.left ≫ f ≫ s.π = gr.right ≫ f ≫ s.π rw [← category.assoc, ← category.assoc, s.condition] obtain ⟨l, hl⟩ := cofork.is_colimit.desc' gr.is_colimit (f ≫ cofork.π s) l₁ obtain ⟨p, hp₁, hp₂⟩ := pushout_cocone.is_colimit.desc' t _ _ hl.symm refine' ⟨p, hp₁, _⟩ intro m w have z := w.trans hp₁.symm apply t.hom_ext apply (pushout_cocone.mk _ _ comm).coequalizer_ext · exact z · erw [← cancel_epi g, ← reassoc_of comm, ← reassoc_of comm, z] rfl #align category_theory.regular_of_is_pushout_snd_of_regular CategoryTheory.regularOfIsPushoutSndOfRegular -/ #print CategoryTheory.regularOfIsPushoutFstOfRegular /- /-- The first leg of a pushout cocone is a regular epimorphism if the left component is too. See also `pushout.fst_of_epi` for the basic epimorphism version, and `regular_of_is_pushout_snd_of_regular` for the flipped version. -/ def regularOfIsPushoutFstOfRegular {P Q R S : C} {f : P ⟶ Q} {g : P ⟶ R} {h : Q ⟶ S} {k : R ⟶ S} [fr : RegularEpi f] (comm : f ≫ h = g ≫ k) (t : IsColimit (PushoutCocone.mk _ _ comm)) : RegularEpi k := regularOfIsPushoutSndOfRegular comm.symm (PushoutCocone.flipIsColimit t) #align category_theory.regular_of_is_pushout_fst_of_regular CategoryTheory.regularOfIsPushoutFstOfRegular -/ #print CategoryTheory.strongEpi_of_regularEpi /- instance (priority := 100) strongEpi_of_regularEpi (f : X ⟶ Y) [RegularEpi f] : StrongEpi f := StrongEpi.mk' (by intro A B z hz u v sq have : (regular_epi.left : regular_epi.W f ⟶ X) ≫ u = regular_epi.right ≫ u := by apply (cancel_mono z).1 simp only [category.assoc, sq.w, regular_epi.w_assoc] obtain ⟨t, ht⟩ := regular_epi.desc' f u this exact comm_sq.has_lift.mk' ⟨t, ht, (cancel_epi f).1 (by simp only [← category.assoc, ht, ← sq.w, arrow.mk_hom, arrow.hom_mk'_right])⟩) #align category_theory.strong_epi_of_regular_epi CategoryTheory.strongEpi_of_regularEpi -/ #print CategoryTheory.isIso_of_regularEpi_of_mono /- /-- A regular epimorphism is an isomorphism if it is a monomorphism. -/ theorem isIso_of_regularEpi_of_mono (f : X ⟶ Y) [RegularEpi f] [m : Mono f] : IsIso f := isIso_of_mono_of_strongEpi _ #align category_theory.is_iso_of_regular_epi_of_mono CategoryTheory.isIso_of_regularEpi_of_mono -/ section variable (C) #print CategoryTheory.RegularEpiCategory /- /-- A regular epi category is a category in which every epimorphism is regular. -/ class RegularEpiCategory where regularEpiOfEpi : ∀ {X Y : C} (f : X ⟶ Y) [Epi f], RegularEpi f #align category_theory.regular_epi_category CategoryTheory.RegularEpiCategory -/ end #print CategoryTheory.regularEpiOfEpi /- /-- In a category in which every epimorphism is regular, we can express every epimorphism as a coequalizer. This is not an instance because it would create an instance loop. -/ def regularEpiOfEpi [RegularEpiCategory C] (f : X ⟶ Y) [Epi f] : RegularEpi f := RegularEpiCategory.regularEpiOfEpi _ #align category_theory.regular_epi_of_epi CategoryTheory.regularEpiOfEpi -/ #print CategoryTheory.regularEpiCategoryOfSplitEpiCategory /- instance (priority := 100) regularEpiCategoryOfSplitEpiCategory [SplitEpiCategory C] : RegularEpiCategory C where regularEpiOfEpi _ _ f _ := by haveI := is_split_epi_of_epi f infer_instance #align category_theory.regular_epi_category_of_split_epi_category CategoryTheory.regularEpiCategoryOfSplitEpiCategory -/ #print CategoryTheory.strongEpiCategory_of_regularEpiCategory /- instance (priority := 100) strongEpiCategory_of_regularEpiCategory [RegularEpiCategory C] : StrongEpiCategory C where strongEpi_of_epi _ _ f _ := by haveI := regular_epi_of_epi f infer_instance #align category_theory.strong_epi_category_of_regular_epi_category CategoryTheory.strongEpiCategory_of_regularEpiCategory -/ end CategoryTheory
%\documentclass{article} %\usepackage{fancyvrb} %\usepackage{perltex} %\usepackage{xcolor} %\usepackage{listings} %\usepackage{longtable} %\usepackage{multirow} %\input{src/cmd} %\begin{document} \index{mergeRinObs!application writeup} \index{mergeRinNav!application writeup} \index{mergeRinMet!application writeup} \section{\emph{mergeRinObs mergeRinNav mergeRinMet}} \subsection{Overview} These applications merge multiple RINEX observation, navigation, or meteorological data files into a single coherent RINEX obs/nav/met file, respectively. \subsection{Usage} \subsubsection{\emph{mergeRinObs mergeRinNav mergeRinMet}} \begin{\outputsize} \begin{longtable}{lll} %\multicolumn{3}{c}{\application{mergeRinObs}} \\ \multicolumn{3}{l}{\textbf{Required Arguments}} \\ \entry{Short Arg.}{Long Arg.}{Description}{1} \entry{-i}{--input=ARG}{An input RINEX observation file, can be repeated as many times as needed.}{2} \entry{-o}{--output=ARG}{Name for the merged output RINEX observation file. Any existing file with that name will be overwritten.}{2} & & \\ \multicolumn{3}{l}{\textbf{Optional Arguments}} \\ \entry{Short Arg.}{Long Arg.}{Description}{1} \entry{-d}{--debug}{Increase debug level.}{1} \entry{-v}{--verbose}{Increase verbosity.}{1} \entry{-h}{--help}{Print help usage.}{1} \end{longtable} \end{\outputsize} \application{mergeRinNav} and \application{mergeRinMet} have the same usage. \subsection{Examples} \begin{\outputsize} \begin{verbatim} > mergeRinObs -i arl280.06o -i arl2810.06o -o arl280-10.06o > mergeRinNav -i arl280.06n -i arl2810.06n -o arl280-10.06n > mergeRinMet -i arl280.06m -i arl2810.06m -o arl280-10.06m \end{verbatim} \end{\outputsize} %\end{document}
!> Implements singly-linked list (sll) node with generic data container !> module fhash_sll use iso_fortran_env, only: int32, int64 use fhash_key_base, only: fhash_key_t use fhash_data_container, only: fhash_container_t implicit none !> Node type for hash table singly linked list type fhash_node_t class(fhash_key_t), allocatable :: key type(fhash_container_t) :: value type(fhash_node_t), pointer :: next => NULL() end type fhash_node_t contains !> Append node to SLL recursive subroutine sll_push_node(node,key,value,pointer) !> Node to which to add data type(fhash_node_t), intent(inout) :: node !> Key to add class(fhash_key_t), intent(in) :: key !> Value to add class(*), intent(in), target :: value !> Store only a point if .true. logical, intent(in), optional :: pointer if (allocated(node%key)) then if (node%key == key) then call sll_node_set(node,value,pointer) return end if if (.not.associated(node%next)) then allocate(node%next) end if call sll_push_node(node%next,key,value,pointer) else node%key = key call sll_node_set(node,value,pointer) end if end subroutine sll_push_node !> Set container value in node !> subroutine sll_node_set(node,value,pointer) !> Node to which to add data type(fhash_node_t), intent(inout) :: node !> Value to set class(*), intent(in), target :: value !> Store only a pointer if .true. logical, intent(in), optional :: pointer if (present(pointer)) then if (pointer) then node%value%scalar_ptr => value return end if end if if (allocated(node%value%scalar_data)) deallocate(node%value%scalar_data) allocate(node%value%scalar_data, source = value) end subroutine sll_node_set !> Search for a node with a specific key. !> Returns a pointer to the 'data' component of the corresponding node. !> Pointer is not associated if node cannot be found recursive subroutine sll_find_in(node,key,data,found) !> Node to search in type(fhash_node_t), intent(in), target :: node !> Key to look for class(fhash_key_t) :: key !> Pointer to value container if found. !> (Unassociated if the key is not found in node) type(fhash_container_t), pointer, intent(out) :: data logical, intent(out), optional :: found data => NULL() if (present(found)) found = .false. if (.not.allocated(node%key)) then return else if (node%key == key) then if (present(found)) found = .true. data => node%value return else if (associated(node%next)) then call sll_find_in(node%next,key,data,found) end if end subroutine sll_find_in !> Search for a node with a specific key and remove recursive subroutine sll_remove(node,key,found,parent_node) !> Node to remove from type(fhash_node_t), intent(inout) :: node !> Key to remove class(fhash_key_t) :: key !> Indicates if the key was found in node and removed logical, optional, intent(out) :: found !> Used internally type(fhash_node_t), intent(inout), optional :: parent_node type(fhash_node_t), pointer :: next_temp if (present(found)) then found = .false. end if if (.not.allocated(node%key)) then return else if (node%key == key) then if (present(found)) then found = .true. end if if (.not.present(parent_node)) then ! This is the top-level node if (associated(node%next)) then ! Replace with next next_temp => node%next node = next_temp deallocate(next_temp) return else ! No children, just deallocate deallocate(node%key) return end if else ! Not top-level node if (associated(node%next)) then ! Join previous with next next_temp => node%next deallocate(parent_node%next) parent_node%next => next_temp return else ! No children, just deallocate deallocate(node%key) deallocate(parent_node%next) return end if end if else if (associated(node%next)) then ! Look further down call sll_remove(node%next,key,found,node) end if end subroutine sll_remove !> Deallocate node components and those of its children recursive subroutine sll_clean(node) !> Node to search in type(fhash_node_t), intent(inout) :: node if (associated(node%next)) then call sll_clean(node%next) deallocate(node%next) end if end subroutine sll_clean !> Determine depth of SLL function node_depth(node) result(depth) !> Node to check depth type(fhash_node_t), intent(in), target :: node integer :: depth type(fhash_node_t), pointer :: current if (.not.allocated(node%key)) then depth = 0 return else depth = 1 current => node do while(associated(current%next)) depth = depth + 1 current => current%next end do end if end function node_depth end module fhash_sll
-- Conmutatividad_del_gcd.lean -- Si m, n ∈ ℕ, entonces gcd(m,n) = gcd(n,m). -- José A. Alonso Jiménez <https://jaalonso.github.io> -- Sevilla, 11-octubre-2022 -- --------------------------------------------------------------------- -- --------------------------------------------------------------------- -- Demostrar si m, n ∈ ℕ, entonces gcd(m,n) = gcd(n,m). -- ---------------------------------------------------------------------- import data.nat.gcd open nat variables k m n : ℕ -- 1ª demostración -- =============== example : gcd m n = gcd n m := begin have h1 : gcd m n ∣ gcd n m, { have h1a : gcd m n ∣ n, by exact gcd_dvd_right m n, have h1b : gcd m n ∣ m, by exact gcd_dvd_left m n, show gcd m n ∣ gcd n m, by exact dvd_gcd h1a h1b, }, have h2 : gcd n m ∣ gcd m n, { have h2a : gcd n m ∣ m, by exact gcd_dvd_right n m, have h2b : gcd n m ∣ n, by exact gcd_dvd_left n m, show gcd n m ∣ gcd m n, by exact dvd_gcd h2a h2b, }, show gcd m n = gcd n m, by exact dvd_antisymm h1 h2, end -- 2ª demostración -- =============== example : gcd m n = gcd n m := begin apply dvd_antisymm, { apply dvd_gcd, { exact gcd_dvd_right m n, }, { exact gcd_dvd_left m n, }}, { apply dvd_gcd, { exact gcd_dvd_right n m, }, { exact gcd_dvd_left n m, }}, end -- 3ª demostración -- =============== example : gcd m n = gcd n m := begin apply dvd_antisymm, { apply dvd_gcd (gcd_dvd_right m n) (gcd_dvd_left m n)}, { apply dvd_gcd (gcd_dvd_right n m) (gcd_dvd_left n m)}, end -- 4ª demostración -- =============== example : gcd m n = gcd n m := dvd_antisymm (dvd_gcd (gcd_dvd_right m n) (gcd_dvd_left m n)) (dvd_gcd (gcd_dvd_right n m) (gcd_dvd_left n m)) -- 5ª demostración -- =============== lemma aux : gcd m n ∣ gcd n m := begin have h1 : gcd m n ∣ n, by exact gcd_dvd_right m n, have h2 : gcd m n ∣ m, by exact gcd_dvd_left m n, show gcd m n ∣ gcd n m, by exact dvd_gcd h1 h2, end example : gcd m n = gcd n m := begin apply dvd_antisymm, { exact aux m n, }, { exact aux n m, }, end -- 6ª demostración -- =============== lemma aux2 : gcd m n ∣ gcd n m := dvd_gcd (gcd_dvd_right m n) (gcd_dvd_left m n) example : gcd m n = gcd n m := dvd_antisymm (aux2 m n) (aux2 n m) -- 7ª demostración -- =============== example : gcd m n = gcd n m := -- by library_search gcd_comm m n
DOUBLE PRECISION FUNCTION gam1(a) C ------------------------------------------------------------------ C COMPUTATION OF 1/GAMMA(A+1) - 1 FOR -0.5 .LE. A .LE. 1.5 C ------------------------------------------------------------------ C .. Scalar Arguments .. DOUBLE PRECISION a C .. C .. Local Scalars .. DOUBLE PRECISION bot,d,s1,s2,t,top,w C .. C .. Local Arrays .. DOUBLE PRECISION p(7),q(5),r(9) C .. C .. Data statements .. C ------------------- C ------------------- C ------------------- C ------------------- DATA p(1)/.577215664901533D+00/,p(2)/-.409078193005776D+00/, + p(3)/-.230975380857675D+00/,p(4)/.597275330452234D-01/, + p(5)/.766968181649490D-02/,p(6)/-.514889771323592D-02/, + p(7)/.589597428611429D-03/ DATA q(1)/.100000000000000D+01/,q(2)/.427569613095214D+00/, + q(3)/.158451672430138D+00/,q(4)/.261132021441447D-01/, + q(5)/.423244297896961D-02/ DATA r(1)/-.422784335098468D+00/,r(2)/-.771330383816272D+00/, + r(3)/-.244757765222226D+00/,r(4)/.118378989872749D+00/, + r(5)/.930357293360349D-03/,r(6)/-.118290993445146D-01/, + r(7)/.223047661158249D-02/,r(8)/.266505979058923D-03/, + r(9)/-.132674909766242D-03/ DATA s1/.273076135303957D+00/,s2/.559398236957378D-01/ C .. C .. Executable Statements .. C ------------------- t = a d = a - 0.5D0 IF (d.GT.0.0D0) t = d - 0.5D0 if (t .lt. 0) then goto 40 elseif (t .eq. 0) then goto 10 else goto 20 endif C 10 gam1 = 0.0D0 RETURN C 20 top = (((((p(7)*t+p(6))*t+p(5))*t+p(4))*t+p(3))*t+p(2))*t + p(1) bot = (((q(5)*t+q(4))*t+q(3))*t+q(2))*t + 1.0D0 w = top/bot IF (d.GT.0.0D0) GO TO 30 gam1 = a*w RETURN 30 gam1 = (t/a)* ((w-0.5D0)-0.5D0) RETURN C 40 top = (((((((r(9)*t+r(8))*t+r(7))*t+r(6))*t+r(5))*t+r(4))*t+r(3))* + t+r(2))*t + r(1) bot = (s2*t+s1)*t + 1.0D0 w = top/bot IF (d.GT.0.0D0) GO TO 50 gam1 = a* ((w+0.5D0)+0.5D0) RETURN 50 gam1 = t*w/a RETURN END
#ifndef OPENMC_TALLIES_FILTER_SURFACE_H #define OPENMC_TALLIES_FILTER_SURFACE_H #include <cstdint> #include <unordered_map> #include <gsl/gsl> #include "openmc/tallies/filter.h" #include "openmc/vector.h" namespace openmc { //============================================================================== //! Specifies which surface particles are crossing //============================================================================== class SurfaceFilter : public Filter { public: //---------------------------------------------------------------------------- // Constructors, destructors ~SurfaceFilter() = default; //---------------------------------------------------------------------------- // Methods std::string type() const override { return "surface"; } void from_xml(pugi::xml_node node) override; void get_all_bins(const Particle& p, TallyEstimator estimator, FilterMatch& match) const override; void to_statepoint(hid_t filter_group) const override; std::string text_label(int bin) const override; //---------------------------------------------------------------------------- // Accessors void set_surfaces(gsl::span<int32_t> surfaces); private: //---------------------------------------------------------------------------- // Data members //! The indices of the surfaces binned by this filter. vector<int32_t> surfaces_; //! A map from surface indices to filter bin indices. std::unordered_map<int32_t, int> map_; }; } // namespace openmc #endif // OPENMC_TALLIES_FILTER_SURFACE_H
/- Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Amelia Livingston, Yury Kudryashov, Neil Strickland, Aaron Anderson Ported by: Joël Riou ! This file was ported from Lean 3 source module algebra.divisibility.units ! leanprover-community/mathlib commit e574b1a4e891376b0ef974b926da39e05da12a06 ! Please do not edit these lines, except to modify the commit id ! if you have ported upstream changes. -/ import Mathlib.Algebra.Divisibility.Basic import Mathlib.Algebra.Group.Units /-! # Lemmas about divisibility and units -/ variable {α : Type _} namespace Units section Monoid variable [Monoid α] {a b : α} {u : αˣ} /-- Elements of the unit group of a monoid represented as elements of the monoid divide any element of the monoid. -/ theorem coe_dvd : ↑u ∣ a := ⟨↑u⁻¹ * a, by simp⟩ #align units.coe_dvd Units.coe_dvd /-- In a monoid, an element `a` divides an element `b` iff `a` divides all associates of `b`. -/ theorem dvd_mul_right : a ∣ b * u ↔ a ∣ b := Iff.intro (fun ⟨c, Eq⟩ ↦ ⟨c * ↑u⁻¹, by rw [← mul_assoc, ← Eq, Units.mul_inv_cancel_right]⟩) fun ⟨c, Eq⟩ ↦ Eq.symm ▸ (_root_.dvd_mul_right _ _).mul_right _ #align units.dvd_mul_right Units.dvd_mul_right /-- In a monoid, an element `a` divides an element `b` iff all associates of `a` divide `b`. -/ theorem mul_right_dvd : a * u ∣ b ↔ a ∣ b := Iff.intro (fun ⟨c, Eq⟩ => ⟨↑u * c, Eq.trans (mul_assoc _ _ _)⟩) fun h => dvd_trans (Dvd.intro (↑u⁻¹) (by rw [mul_assoc, u.mul_inv, mul_one])) h #align units.mul_right_dvd Units.mul_right_dvd end Monoid section CommMonoid variable [CommMonoid α] {a b : α} {u : αˣ} /-- In a commutative monoid, an element `a` divides an element `b` iff `a` divides all left associates of `b`. -/ theorem dvd_mul_left : a ∣ u * b ↔ a ∣ b := by rw [mul_comm] apply dvd_mul_right #align units.dvd_mul_left Units.dvd_mul_left /-- In a commutative monoid, an element `a` divides an element `b` iff all left associates of `a` divide `b`.-/ theorem mul_left_dvd : ↑u * a ∣ b ↔ a ∣ b := by rw [mul_comm] apply mul_right_dvd #align units.mul_left_dvd Units.mul_left_dvd end CommMonoid end Units namespace IsUnit section Monoid variable [Monoid α] {a b u : α} (hu : IsUnit u) /-- Units of a monoid divide any element of the monoid. -/ @[simp] theorem dvd : u ∣ a := by rcases hu with ⟨u, rfl⟩ apply Units.coe_dvd #align is_unit.dvd IsUnit.dvd @[simp] theorem dvd_mul_right : a ∣ b * u ↔ a ∣ b := by rcases hu with ⟨u, rfl⟩ apply Units.dvd_mul_right #align is_unit.dvd_mul_right IsUnit.dvd_mul_right /-- In a monoid, an element a divides an element b iff all associates of `a` divide `b`.-/ @[simp] theorem mul_right_dvd : a * u ∣ b ↔ a ∣ b := by rcases hu with ⟨u, rfl⟩ apply Units.mul_right_dvd #align is_unit.mul_right_dvd IsUnit.mul_right_dvd end Monoid section CommMonoid variable [CommMonoid α] (a b u : α) (hu : IsUnit u) /-- In a commutative monoid, an element `a` divides an element `b` iff `a` divides all left associates of `b`. -/ @[simp] theorem dvd_mul_left : a ∣ u * b ↔ a ∣ b := by rcases hu with ⟨u, rfl⟩ apply Units.dvd_mul_left #align is_unit.dvd_mul_left IsUnit.dvd_mul_left /-- In a commutative monoid, an element `a` divides an element `b` iff all left associates of `a` divide `b`.-/ @[simp] theorem mul_left_dvd : u * a ∣ b ↔ a ∣ b := by rcases hu with ⟨u, rfl⟩ apply Units.mul_left_dvd #align is_unit.mul_left_dvd IsUnit.mul_left_dvd end CommMonoid end IsUnit section CommMonoid variable [CommMonoid α] theorem isUnit_iff_dvd_one {x : α} : IsUnit x ↔ x ∣ 1 := ⟨IsUnit.dvd, fun ⟨y, h⟩ => ⟨⟨x, y, h.symm, by rw [h, mul_comm]⟩, rfl⟩⟩ #align is_unit_iff_dvd_one isUnit_iff_dvd_one theorem isUnit_iff_forall_dvd {x : α} : IsUnit x ↔ ∀ y, x ∣ y := isUnit_iff_dvd_one.trans ⟨fun h _ => h.trans (one_dvd _), fun h => h _⟩ #align is_unit_iff_forall_dvd isUnit_iff_forall_dvd theorem isUnit_of_dvd_unit {x y : α} (xy : x ∣ y) (hu : IsUnit y) : IsUnit x := isUnit_iff_dvd_one.2 <| xy.trans <| isUnit_iff_dvd_one.1 hu #align is_unit_of_dvd_unit isUnit_of_dvd_unit theorem isUnit_of_dvd_one {a : α} (h : a ∣ 1) : IsUnit (a : α) := isUnit_iff_dvd_one.mpr h #align is_unit_of_dvd_one isUnit_of_dvd_one theorem not_isUnit_of_not_isUnit_dvd {a b : α} (ha : ¬IsUnit a) (hb : a ∣ b) : ¬IsUnit b := mt (isUnit_of_dvd_unit hb) ha #align not_is_unit_of_not_is_unit_dvd not_isUnit_of_not_isUnit_dvd end CommMonoid
If the span of a set $S$ is not the entire space, then there exists a nonzero vector $a$ such that $a \cdot x = 0$ for all $x \in S$.
from copy import deepcopy from funcSeqAll import findPOutlierBox,normSimple, normBox from funcTimeWarp import autoROIwDTW from funcToolsAll import autoDecaySum from funcToolsAll import findPeakMatchX, splineSampleData, findMatchX_DTW, dtwAlign2Cap, splineCap from funcToolsAll import correctSatd,smoothRect,baselineAdjust, smoothTriangle, fitLinear #from imports import QtGui,QtCore from funcToolsAll import fMobilityShift, dDyesWL from funcPeakAlign import fPeakList from funcSeqAll import peakLinking from funcSeqAll import fitShapeData from funcSeqAll import scaleShapeDataWindow, scaleShapeData def seqAlignRef(dProjRef,dProjOut,keyR,keyS,method='peakSim',isNormalize=True,derivative=True): ### array 0 and array 2 is reference signals, array1 and array 3 is aligned. ### Control the length of the array and dataR=dProjRef['dData'][keyR].copy() dataS=dProjOut['dData'][keyS].copy() linkX0,linkX1=findPeakMatchX(dataR,dataS,isNormalize) return linkX0,linkX1 def postSeqAlignRef(dProjRef,dProjOut): dProjOut['seqRNA']=dProjRef['seqRNA'] dProjOut['seqX0']=dProjRef['seqX0'] dProjOut['seq0']=dProjRef['seq0'] dProjOut['seqX']=dProjRef['seqX'] dProjOut['seqNum']=dProjRef['seqNum'] try: dProjOut['scrNuc']=dProjRef['scrNuc'] except: pass dProjOut['start']=dProjRef['start'] dProjOut['end']=dProjRef['end'] return dProjOut def applyAllSeq(dProject, dProjRef): dProjOut=deepcopy(dProject) # SIGNAL ALGINMENT linkXR,linkXS = seqAlignRef(dProjRef,dProjOut,'BGS1','BGS1') for key in dProjOut['chKeyRS']: dProjOut['dData'][key] = splineSampleData(dProjOut['dData'][key],dProjRef['dData'][key],linkXR,linkXS,False) dProjOut= postSeqAlignRef(dProjRef,dProjOut) dProjOut['dPeakRX']=fPeakList(dProjOut['dData']['RX']) dProjOut['dPeakBG']=fPeakList(dProjOut['dData']['BG']) dProjOut['dPeakBG'],controlRX=peakLinking(dProjRef['dPeakBG']['pos'],dProjOut['dPeakBG'],dProjOut['dData']['BG']) dProjOut['dPeakRX'],controlBG=peakLinking(dProjRef['dPeakRX']['pos'],dProjOut['dPeakRX'],dProjOut['dData']['RX']) ## SCALE RX dProjOut['dPeakRX']=fitShapeData(dProjOut['dPeakRX'],dProjOut['dData']['RX']) dProjOut['dPeakBG']=fitShapeData(dProjOut['dPeakBG'],dProjOut['dData']['BG']) if len(dProjOut['dPeakRX']['amp'])>160: scaleFactor0 = scaleShapeDataWindow(dProjRef['dPeakRX']['area'],dProjOut['dPeakRX']['area']) scaleFactorData0 = fitLinear(dProjOut['dPeakRX']['pos'],scaleFactor0,NData=len(dProjOut['dData']['RX'])) else: scaleFactor0 = scaleShapeData(dProjRef['dPeakRX']['area'],dProjOut['dPeakRX']['area'],rate=1) scaleFactorData0 = scaleFactor0 dProjOut['dPeakRX']['area']=dProjOut['dPeakRX']['area']*scaleFactor0 dProjOut['dPeakRX']['amp']=dProjOut['dPeakRX']['amp']*scaleFactor0 dProjOut['dData']['RX']=dProjOut['dData']['RX']*scaleFactorData0 ## SCALE BG if len(dProjOut['dPeakBG']['amp'])>160: scaleFactor0 = scaleShapeDataWindow(dProjRef['dPeakBG']['area'],dProjOut['dPeakBG']['area']) scaleFactorData0 = fitLinear(dProjOut['dPeakBG']['pos'],scaleFactor0,NData=len(dProjOut['dData']['BG'])) else: scaleFactor0 = scaleShapeData(dProjRef['dPeakBG']['area'],dProjOut['dPeakBG']['area'],rate=1) scaleFactorData0 = scaleFactor0 dProjOut['dPeakBG']['area'] = dProjOut['dPeakBG']['area']*scaleFactor0 dProjOut['dPeakBG']['amp'] = dProjOut['dPeakBG']['amp']*scaleFactor0 dProjOut['dData']['BG'] = dProjOut['dData']['BG']*scaleFactorData0 ## NORMALIZATION dProjOut['areaDiff']=dProjOut['dPeakRX']['area']-dProjOut['dPeakBG']['area'] POutlier,PAver=findPOutlierBox(dProjOut['areaDiff']) dProjOut['normDiff'], aver=normSimple(dProjOut['areaDiff'],POutlier,PAver) if len(dProjOut['normDiff']): scaleFactor2=scaleShapeDataWindow(dProjRef['normDiff'],dProjOut['normDiff']) else: scaleFactor2=scaleShapeData(dProjRef['normDiff'],dProjOut['areaDiff'],rate=1) dProjOut['normDiff'] = dProjOut['normDiff']*scaleFactor2 return dProjOut def applyAllToolsAuto1(dProject, dProjRef): dProjOut=deepcopy(dProject) ### SATURATION CORRECTION for key in dProject['chKeyRX']: dProjOut['dData'][key]=correctSatd(dProjOut['dData'][key],dProjOut['Satd']['RX']) for key in dProject['chKeyBG']: dProjOut['dData'][key]=correctSatd(dProjOut['dData'][key],dProjOut['Satd']['BG']) dProject['isSatd']=True ### SMOOTHING for key in dProjOut['dData'].keys(): if len(dProjOut['dData'][key])>0: dProjOut['dData'][key] = smoothTriangle(dProjOut['dData'][key]) ### BASELINE ADJUSTMENT for key in dProject['dData'].keys(): dProjOut['dData'][key] = baselineAdjust(dProjOut['dData'][key]) # print 'baseline adjusted' ### Select Region of Interest startR, endR = autoROIwDTW(dProjOut['dData']['RXS1'],dProjRef['dData']['RXS1']) for key in dProject['chKeyRX']: dProjOut['dData'][key]=dProjOut['dData'][key][startR:endR] startB, endB = autoROIwDTW(dProjOut['dData']['BGS1'],dProjRef['dData']['BGS1']) for key in dProject['chKeyBG']: dProjOut['dData'][key]=dProjOut['dData'][key][startB:endB] ### MOBILITY SHIFT dyeNR=dProject['dyeN']['RX'] dyeNS=dProject['dyeN']['RXS1'] dProjOut['dData']['RXS1']=fMobilityShift(dProjOut['dData']['RX'],dProjOut['dData']['RXS1'],dyeNR,dyeNS) if 'RXS2' in dProject['dData'].keys(): dyeWS=dDyesWL[dProject['dyeN']['RXS2']] dProjOut['dData']['RXS2']=fMobilityShift(dProjOut['dData']['RX'],dProjOut['dData']['RXS2'],dyeNR,dyeNS) dyeNR=dProject['dyeN']['BG'] dyeNS=dProject['dyeN']['BGS1'] dProjOut['dData']['BGS1']=fMobilityShift(dProjOut['dData']['BG'],dProjOut['dData']['BGS1'],dyeNR,dyeNS) if 'BGS2' in dProject['dData'].keys(): dyeWS=dDyesWL[dProject['dyeN']['BGS2']] dProjOut['dData']['BGS2']=fMobilityShift(dProjOut['dData']['BG'],dProjOut['dData']['BGS2'],dyeNR,dyeNS) ### BASELINE ADJUSTMENT for key in dProject['dData'].keys(): dProjOut['dData'][key] = baselineAdjust(dProjOut['dData'][key]) ### SIGNAL DECAY for key in dProject['dData'].keys(): dProjOut['dData'][key]=autoDecaySum(dProjOut['dData'][key]) ### SIGNAL ALIGNMENT usedSeq=['RXS1','BGS1','RXS2','BGS2'] linkX0,linkX1=dtwAlign2Cap(dProjOut,usedSeq) dProjOut = splineCap(dProjOut,usedSeq,linkX0,linkX1) return dProjOut def applyAllToolsAuto0(dataIn, dataRef,SatdS): dataS=deepcopy(dataIn) dataR=deepcopy(dataRef) #""" Saturation Correction """ print 'saturation correction' dataS=correctSatd(dataS,SatdS) #""" Smoothing """ print 'Smoothing' dataS=smoothRect(dataS) #""" Baseline Adjustment """ dataS = baselineAdjust(dataS) print 'Baseline' #""" Normalization """ dataR = normBox(dataR, 1000) dataS = normBox(dataS, 1000) #""" Auto Region of Interest """ print 'Auto ROI' start, end , dtwM = autoROIwDTW(dataS,dataR) print start, end dataS=dataS[start-5:end+10] #""" Signal Decay Correction""" print 'Signal Decay' dataS=autoDecaySum(dataS,100) #""" Signal Alignment """ print 'Signal Alignment' # linkXR,linkXS=findPeakMatchX(dataR,dataS) linkXR,linkXS = findMatchX_DTW(dataR,dataS) print linkXR print linkXS dataS=splineSampleData(dataS,dataR,linkXR,linkXS) # averS=np.average(dataS) # averR=np.average(dataRef) # scale=averR/averS # dataS = dataS * scale return dataS, dataR if __name__ == '__main__': import sys import numpy as np from pylab import figure,show,savefig,title from matplotlib.pyplot import setp # from matplotlib.figure import Figure import matplotlib.pyplot as plt import shelve fNameR="/Users/fethullah/Sar Data/refHCV1.qushape" fNameS="/Users/fethullah/Sar Data/isis11_2.qushape" dBase=shelve.open(fNameR) dProjR=deepcopy(dBase['dProject']) dBase.close() dBase=shelve.open(fNameS) dProjS=deepcopy(dBase['dProject']) intervalData = deepcopy(dBase['intervalData']) dProjRaw=intervalData[0] dBase.close() key='BG' dataSOut, dataR=applyAllToolsAuto0(dProjRaw['dData'][key], dProjR['dData'][key],dProjRaw['Satd'][key]) fig0 = plt.figure() ax00 = fig0.add_subplot(211) ax01 = fig0.add_subplot(212) ax00.plot(dataR,'r') ax00.plot(dataSOut,'b') ax01.plot(dProjRaw['dData'][key],'k',) # ax00.plot(dProjR['dData']['RX'],'r') # ax00.plot(dProjS['dData']['RX'],'b') show()
lemma continuous_on_eq: "\<lbrakk>continuous_on s f; \<And>x. x \<in> s \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> continuous_on s g"
Formal statement is: lemma Zfun_norm_iff: "Zfun (\<lambda>x. norm (f x)) F = Zfun (\<lambda>x. f x) F" Informal statement is: The zero set of a function $f$ is the same as the zero set of the function $x \mapsto \|f(x)\|$.
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ import data.fin.basic import data.list.sort import data.list.duplicate /-! # Equivalence between `fin (length l)` and elements of a list > THIS FILE IS SYNCHRONIZED WITH MATHLIB4. > Any changes to this file require a corresponding PR to mathlib4. Given a list `l`, * if `l` has no duplicates, then `list.nodup.nth_le_equiv` is the equivalence between `fin (length l)` and `{x // x ∈ l}` sending `⟨i, hi⟩` to `⟨nth_le l i hi, _⟩` with the inverse sending `⟨x, hx⟩` to `⟨index_of x l, _⟩`; * if `l` has no duplicates and contains every element of a type `α`, then `list.nodup.nth_le_equiv_of_forall_mem_list` defines an equivalence between `fin (length l)` and `α`; if `α` does not have decidable equality, then there is a bijection `list.nodup.nth_le_bijection_of_forall_mem_list`; * if `l` is sorted w.r.t. `(<)`, then `list.sorted.nth_le_iso` is the same bijection reinterpreted as an `order_iso`. -/ namespace list variable {α : Type*} namespace nodup /-- If `l` lists all the elements of `α` without duplicates, then `list.nth_le` defines a bijection `fin l.length → α`. See `list.nodup.nth_le_equiv_of_forall_mem_list` for a version giving an equivalence when there is decidable equality. -/ @[simps] def nth_le_bijection_of_forall_mem_list (l : list α) (nd : l.nodup) (h : ∀ (x : α), x ∈ l) : {f : fin l.length → α // function.bijective f} := ⟨λ i, l.nth_le i i.property, λ i j h, fin.ext $ (nd.nth_le_inj_iff _ _).1 h, λ x, let ⟨i, hi, hl⟩ := list.mem_iff_nth_le.1 (h x) in ⟨⟨i, hi⟩, hl⟩⟩ variable [decidable_eq α] /-- If `l` has no duplicates, then `list.nth_le` defines an equivalence between `fin (length l)` and the set of elements of `l`. -/ @[simps] def nth_le_equiv (l : list α) (H : nodup l) : fin (length l) ≃ {x // x ∈ l} := { to_fun := λ i, ⟨nth_le l i i.2, nth_le_mem l i i.2⟩, inv_fun := λ x, ⟨index_of ↑x l, index_of_lt_length.2 x.2⟩, left_inv := λ i, by simp [H], right_inv := λ x, by simp } /-- If `l` lists all the elements of `α` without duplicates, then `list.nth_le` defines an equivalence between `fin l.length` and `α`. See `list.nodup.nth_le_bijection_of_forall_mem_list` for a version without decidable equality. -/ @[simps] def nth_le_equiv_of_forall_mem_list (l : list α) (nd : l.nodup) (h : ∀ (x : α), x ∈ l) : fin l.length ≃ α := { to_fun := λ i, l.nth_le i i.2, inv_fun := λ a, ⟨_, index_of_lt_length.2 (h a)⟩, left_inv := λ i, by simp [nd], right_inv := λ a, by simp } end nodup namespace sorted variables [preorder α] {l : list α} lemma nth_le_mono (h : l.sorted (≤)) : monotone (λ i : fin l.length, l.nth_le i i.2) := λ i j, h.rel_nth_le_of_le _ _ lemma nth_le_strict_mono (h : l.sorted (<)) : strict_mono (λ i : fin l.length, l.nth_le i i.2) := λ i j, h.rel_nth_le_of_lt _ _ variable [decidable_eq α] /-- If `l` is a list sorted w.r.t. `(<)`, then `list.nth_le` defines an order isomorphism between `fin (length l)` and the set of elements of `l`. -/ def nth_le_iso (l : list α) (H : sorted (<) l) : fin (length l) ≃o {x // x ∈ l} := { to_equiv := H.nodup.nth_le_equiv l, map_rel_iff' := λ i j, H.nth_le_strict_mono.le_iff_le } variables (H : sorted (<) l) {x : {x // x ∈ l}} {i : fin l.length} @[simp] lemma coe_nth_le_iso_apply : (H.nth_le_iso l i : α) = nth_le l i i.2 := rfl @[simp] lemma coe_nth_le_iso_symm_apply : ((H.nth_le_iso l).symm x : ℕ) = index_of ↑x l := rfl end sorted section sublist /-- If there is `f`, an order-preserving embedding of `ℕ` into `ℕ` such that any element of `l` found at index `ix` can be found at index `f ix` in `l'`, then `sublist l l'`. -/ /-- A `l : list α` is `sublist l l'` for `l' : list α` iff there is `f`, an order-preserving embedding of `ℕ` into `ℕ` such that any element of `l` found at index `ix` can be found at index `f ix` in `l'`. -/ lemma sublist_iff_exists_order_embedding_nth_eq {l l' : list α} : l <+ l' ↔ ∃ (f : ℕ ↪o ℕ), ∀ (ix : ℕ), l.nth ix = l'.nth (f ix) := begin split, { intro H, induction H with xs ys y H IH xs ys x H IH, { simp }, { obtain ⟨f, hf⟩ := IH, refine ⟨f.trans (order_embedding.of_strict_mono (+ 1) (λ _, by simp)), _⟩, simpa using hf }, { obtain ⟨f, hf⟩ := IH, refine ⟨order_embedding.of_map_le_iff (λ (ix : ℕ), if ix = 0 then 0 else (f ix.pred).succ) _, _⟩, { rintro ⟨_|a⟩ ⟨_|b⟩; simp [nat.succ_le_succ_iff] }, { rintro ⟨_|i⟩, { simp }, { simpa using hf _ } } } }, { rintro ⟨f, hf⟩, exact sublist_of_order_embedding_nth_eq f hf } end /-- A `l : list α` is `sublist l l'` for `l' : list α` iff there is `f`, an order-preserving embedding of `fin l.length` into `fin l'.length` such that any element of `l` found at index `ix` can be found at index `f ix` in `l'`. -/ lemma sublist_iff_exists_fin_order_embedding_nth_le_eq {l l' : list α} : l <+ l' ↔ ∃ (f : fin l.length ↪o fin l'.length), ∀ (ix : fin l.length), l.nth_le ix ix.is_lt = l'.nth_le (f ix) (f ix).is_lt := begin rw sublist_iff_exists_order_embedding_nth_eq, split, { rintro ⟨f, hf⟩, have h : ∀ {i : ℕ} (h : i < l.length), f i < l'.length, { intros i hi, specialize hf i, rw [nth_le_nth hi, eq_comm, nth_eq_some] at hf, obtain ⟨h, -⟩ := hf, exact h }, refine ⟨order_embedding.of_map_le_iff (λ ix, ⟨f ix, h ix.is_lt⟩) _, _⟩, { simp }, { intro i, apply option.some_injective, simpa [←nth_le_nth] using hf _ } }, { rintro ⟨f, hf⟩, refine ⟨order_embedding.of_strict_mono (λ i, if hi : i < l.length then f ⟨i, hi⟩ else i + l'.length) _, _⟩, { intros i j h, dsimp only, split_ifs with hi hj hj hi, { simpa using h }, { rw add_comm, exact lt_add_of_lt_of_pos (fin.is_lt _) (i.zero_le.trans_lt h) }, { exact absurd (h.trans hj) hi }, { simpa using h } }, { intro i, simp only [order_embedding.coe_of_strict_mono], split_ifs with hi, { rw [nth_le_nth hi, nth_le_nth, ←hf], simp }, { rw [nth_len_le, nth_len_le], { simp }, { simpa using hi } } } } end /-- An element `x : α` of `l : list α` is a duplicate iff it can be found at two distinct indices `n m : ℕ` inside the list `l`. -/ lemma duplicate_iff_exists_distinct_nth_le {l : list α} {x : α} : l.duplicate x ↔ ∃ (n : ℕ) (hn : n < l.length) (m : ℕ) (hm : m < l.length) (h : n < m), x = l.nth_le n hn ∧ x = l.nth_le m hm := begin classical, rw [duplicate_iff_two_le_count, le_count_iff_replicate_sublist, sublist_iff_exists_fin_order_embedding_nth_le_eq], split, { rintro ⟨f, hf⟩, refine ⟨f ⟨0, by simp⟩, fin.is_lt _, f ⟨1, by simp⟩, fin.is_lt _, by simp, _, _⟩, { simpa using hf ⟨0, by simp⟩ }, { simpa using hf ⟨1, by simp⟩ } }, { rintro ⟨n, hn, m, hm, hnm, h, h'⟩, refine ⟨order_embedding.of_strict_mono (λ i, if (i : ℕ) = 0 then ⟨n, hn⟩ else ⟨m, hm⟩) _, _⟩, { rintros ⟨⟨_|i⟩, hi⟩ ⟨⟨_|j⟩, hj⟩, { simp }, { simp [hnm] }, { simp }, { simp only [nat.lt_succ_iff, nat.succ_le_succ_iff, replicate, length, nonpos_iff_eq_zero] at hi hj, simp [hi, hj] } }, { rintros ⟨⟨_|i⟩, hi⟩, { simpa using h }, { simpa using h' } } } end end sublist end list
!CALL polysvd(kpp,strial,ptrial,SIZE(strial),cfnt(1:kpp)) SUBROUTINE polysvd(nfitin,x,y,m,b) ! USAGE SVD regression of input vectors x, y of length m ! producess nfitin polynoimial coefficients b USE stel_kinds USE stel_constants IMPLICIT NONE C----------------------------------------------- C D u m m y A r g u m e n t s C----------------------------------------------- INTEGER, INTENT(in) :: m, nfitin REAL (rprec), DIMENSION(m), INTENT(in) :: x,y REAL(rprec) ,DIMENSION(nfitin), INTENT(out) :: b C----------------------------------------------- C L o c a l V a r i a b l e s C----------------------------------------------- REAL (rprec) :: cutoff=1.e-7_dp REAL (rprec), DIMENSION(:,:), ALLOCATABLE 1 :: amatrix, vv ,uu, wwd REAL (rprec), DIMENSION(:) , ALLOCATABLE :: ww REAL (rprec), DIMENSION(:), ALLOCATABLE, SAVE :: apar INTEGER , DIMENSION(:) , ALLOCATABLE :: pwr INTEGER :: i, j, n=11 n=nfitin ALLOCATE(amatrix(m,n)) ALLOCATE(uu(m,n)) ALLOCATE(pwr(n)) ALLOCATE(apar(n)) ALLOCATE(wwd(n,n)) ALLOCATE(ww(n)) ALLOCATE(vv(n,n)) DO i=1,n pwr(i)=i-1 ENDDO ! make amatrix DO i=1,m DO j=1,n IF(x(i).eq.0.) THEN amatrix(i,j)=zero ELSE amatrix(i,j)=x(i)**pwr(j) ENDIF ENDDO ENDDO uu=amatrix CALL svdcmp(uu,m,n,m,n,ww,vv) ! m rows > n columns DO i=1,n DO j=1,n wwd(i,j)=0 ! reset after matmul ENDDO ENDDO DO i=1,n wwd(i,i)=1/ww(i) ENDDO DO i= 1,SIZE(ww) IF(ww(i) .lt. cutoff) wwd(i,i)=0 ENDDO apar=0. apar=matmul(vv,matmul(wwd,matmul(TRANSPOSE(uu),y))) b(1:n)=apar(1:n) DEALLOCATE(amatrix) DEALLOCATE(uu) DEALLOCATE(pwr) DEALLOCATE(apar) DEALLOCATE(wwd) DEALLOCATE(ww) DEALLOCATE(vv) END SUBROUTINE polysvd ! PROGRAM driver ! TESTED against IDL with this PARAMETER set. Results agree. ! USE stel_kinds ! USE stel_constants ! INTEGER, PARAMETER :: ns=50, kpp=5 ! REAL(rprec), DIMENSION(ns) :: s, y ! REAL(rprec), DIMENSION(kpp) :: b ! DO i=1,ns ! s(i)=one*(i-1)/(ns-1) ! ENDDO ! y=COS(s*pio2)**2 ! CALL polysvd(kpp,s,y,SIZE(s),b) ! WRITE(6,109)b ! WRITE(6,109)s ! WRITE (6,109)y !109 FORMAT(/,' =[',3(x,1pe14.6,1h,),'$') ! END PROGRAM
theory Algebra imports Prelim begin fun is_times where "is_times a1 a2 a \<longleftrightarrow> a1 * a2 = a" fun is_times1 where "is_times1 a1 a2 a \<longleftrightarrow> a1 * a2 = a" fun is_plus where "is_plus a1 a2 a \<longleftrightarrow> a1 + a2 = a" fun is_uminus where "is_uminus a b \<longleftrightarrow> - a = b" fun is_zero where "is_zero a \<longleftrightarrow> a = 0" lemmas is_defs = is_times.simps is_times1.simps is_plus.simps is_uminus.simps is_zero.simps (* Sum of semigroups *) nonfree_datatype ('a::semigroup_mult, 'b::semigroup_mult) ssum = Left 'a | Right 'b | Mult "('a, 'b) ssum" "('a, 'b) ssum" where LeftPlus: "is_times a1 a2 a \<Longrightarrow> Mult (Left a1) (Left a2) = Left a" |RightPlus: "is_times1 b1 b2 b \<Longrightarrow> Mult (Right b1) (Right b2) = Right b" |Mult: "Mult (Mult x y) z = Mult x (Mult y z)" instantiation ssum :: (semigroup_mult, semigroup_mult) semigroup_mult begin definition times_ssum where "x * y \<equiv> Mult x y" instance apply default using Mult unfolding times_ssum_def by auto end (* Universal function for sums: *) context fixes f :: "'a::semigroup_mult \<Rightarrow> 'c::semigroup_mult" and g :: "'b::semigroup_mult \<Rightarrow> 'c" assumes (* f and g are morphisms of semigroups *) f_times: "f (a1 * a2) = f a1 * f a2" and g_times: "g (b1 * b2) = g b1 * g b2" begin nonfree_primrec suniv :: "('a, 'b) ssum \<Rightarrow> 'c" where "suniv (Left a) = f a" | "suniv (Right b) = g b" | "suniv (Mult x y) = suniv x * suniv y" by (auto simp: algebra_simps f_times g_times) end (* context *) (* The ring of polynomials *) nonfree_datatype ('a::comm_ring, 'b) poly = Sc 'a | Var 'b | Uminus "('a,'b) poly" | Plus "('a,'b) poly" "('a,'b) poly" | Times "('a,'b) poly" "('a,'b) poly" where ScUminus: "is_uminus a b \<Longrightarrow> Uminus (Sc a) = Sc b" |ScPlus: "is_plus a1 a2 a \<Longrightarrow> Plus (Sc a1) (Sc a2) = Sc a" |ScTimes: "is_times a1 a2 a \<Longrightarrow> Times (Sc a1) (Sc a2) = Sc a" |PlusAssoc: "Plus (Plus P1 P2) P3 = Plus P1 (Plus P2 P3)" |PlusComm: "Plus P1 P2 = Plus P2 P1" |ZeroPlus: "is_zero a \<Longrightarrow> Plus (Sc a) P = P" |UminusPlus: "is_zero a \<Longrightarrow> Plus (Uminus P) P = Sc a" |TimesAssoc: "Times (Times P1 P2) P3 = Times P1 (Times P2 P3)" |TimesComm: "Times P1 P2 = Times P2 P1" |Distr: "Times (Plus P Q) R = Plus (Times P R) (Times Q R)" lemmas poly_facts = ScUminus ScPlus ScTimes PlusAssoc PlusComm ZeroPlus UminusPlus TimesAssoc TimesComm Distr (* Polynomials in the commutative-ring type class: *) instantiation poly :: (comm_ring, type) comm_ring begin definition minus_poly where "P - Q = Plus P (Uminus Q)" definition uminus_poly where "- P = Uminus P" definition plus_poly where "P + Q = Plus P Q" definition times_poly where "P * Q = Times P Q" definition zero_poly where "0 = Sc 0" instance apply default unfolding minus_poly_def uminus_poly_def plus_poly_def times_poly_def zero_poly_def by (metis poly_facts is_defs)+ end (* Universal function for polynomials: *) context fixes f :: "'a::comm_ring_1 \<Rightarrow>'c::comm_ring_1" and g :: "'b => 'c" assumes f_zero: "f 0 = 0" and f_one: "f 1 = 1" and f_uminus: "f (- a) = - f a" and f_plus: "f (a1 + a2) = f a1 + f a2" and f_times: "f (a1 * a2) = f a1 * f a2" begin nonfree_primrec ext :: "('a,'b) poly \<Rightarrow> 'c" where "ext (Sc a) = f a" | "ext (Var b) = g b" | "ext (Uminus P) = - ext P" | "ext (Plus P Q) = ext P + ext Q" | "ext (Times P Q) = ext P * ext Q" by (auto simp: algebra_simps f_zero f_one f_uminus f_plus f_times) end (* context *) (* Polynomial valuation: *) definition "pval \<equiv> ext id" lemma pval_simps[simp]: "pval g (Sc a) = a" "pval g (Var b) = g b" "pval g (Uminus P) = - pval g P" "pval g (Plus P Q) = pval g P + pval g Q" "pval g (Times P Q) = pval g P * pval g Q" unfolding pval_def by auto end
[STATEMENT] lemma fix_clock_evaluate[simp]: "fix_clock s (evaluate eval s e) = evaluate eval s e" [PROOF STATE] proof (prove) goal (1 subgoal): 1. fix_clock s (Evaluate_Single.evaluate eval s e) = Evaluate_Single.evaluate eval s e [PROOF STEP] unfolding fix_clock_alt_def [PROOF STATE] proof (prove) goal (1 subgoal): 1. (case Evaluate_Single.evaluate eval s e of (x3a, x) \<Rightarrow> (update_clock (\<lambda>_. if clock x3a \<le> clock s then clock x3a else clock s) x3a, x)) = Evaluate_Single.evaluate eval s e [PROOF STEP] apply (auto simp: datatype_record_update split: state.splits prod.splits) [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<And>x1 x2 x3 x4 x5 x2a. \<lbrakk>\<not> x1 \<le> clock s; Evaluate_Single.evaluate eval s e = (make_state x1 x2 x3 x4 x5, x2a)\<rbrakk> \<Longrightarrow> False [PROOF STEP] using evaluate_clock_monotone' [PROOF STATE] proof (prove) using this: Evaluate_Single.evaluate ?eval ?s ?e = (?s', ?r) \<Longrightarrow> clock ?s' \<le> clock ?s goal (1 subgoal): 1. \<And>x1 x2 x3 x4 x5 x2a. \<lbrakk>\<not> x1 \<le> clock s; Evaluate_Single.evaluate eval s e = (make_state x1 x2 x3 x4 x5, x2a)\<rbrakk> \<Longrightarrow> False [PROOF STEP] by fastforce
subroutine higgsw(br) implicit none include 'constants.f' include 'ewcouple.f' include 'masses.f' double precision wff,mfsq,br c-----approximate form for the width of the standard model higgs c-----valid for low masses wff(mfsq)=dsqrt(2d0)/8d0/pi*gf*hmass*mfsq & *(1d0-4d0*mfsq/hmass**2)**1.5d0 hwidth=3d0*(wff(mbsq)+wff(mcsq))+wff(mtausq) write(6,*) 'hmass,hwidth',hmass,hwidth write(6,*) 'mtausq,mcsq,mbsq',mtausq,mcsq,mbsq write(6,*) br=3d0*wff(mbsq)/hwidth return end
REBOL [ Title: "current-work" Date: 27-Sep-2017 Name: "current-work.r" Author: "Mike Yaunish" File: %current-work.r Version: 1.0 Purpose: {DB-Rider go script. For database:billing_complete and table:lineitem} ] display-query-results {SELECT * FROM lineitem WHERE ID > '0' ORDER BY ID DESC LIMIT 40}
/********************************************************************************************************************** This file is part of the Control Toolbox (https://adrlab.bitbucket.io/ct), copyright by ETH Zurich, Google Inc. Authors: Michael Neunert, Markus Giftthaler, Markus Stäuble, Diego Pardo, Farbod Farshidian Licensed under Apache2 license (see LICENSE file in main directory) **********************************************************************************************************************/ #pragma once #include <Eigen/Dense> #include <ct/core/core.h> #include "Quadrotor.hpp" namespace ct { namespace models { class QuadrotorLinear : public ct::core::LinearSystem<quadrotor::nStates, quadrotor::nControls> { public: typedef ct::core::StateVector<quadrotor::nStates> state_vector_t; typedef ct::core::ControlVector<quadrotor::nControls> control_vector_t; typedef Eigen::Matrix<double, quadrotor::nStates, quadrotor::nStates> state_matrix_t; typedef Eigen::Matrix<double, quadrotor::nStates, quadrotor::nControls> state_control_matrix_t; virtual QuadrotorLinear* clone() const override { return new QuadrotorLinear(*this); } virtual const state_matrix_t& getDerivativeState(const state_vector_t& x, const control_vector_t& u, const ct::core::Time t = 0.0) override { A_ = A_quadrotor(x, u); return A_; } virtual const state_control_matrix_t& getDerivativeControl(const state_vector_t& x, const control_vector_t& u, const ct::core::Time t = 0.0) override { B_ = B_quadrotor(x, u); return B_; } private: state_matrix_t A_; state_control_matrix_t B_; }; } }
If $f$ is a function such that $f(n) < f(n+1)$ for all $n$, then $f$ is strictly monotone.
\mode* \section{The stuff dreams are made of} Fluff. \begin{frame} Clouds are amazing. \end{frame} So is the ground.
% phil379.tex % % driver file phil379.tex to produce text on letter-size paper % with standard layout and margins % We use the memoir class for maximal flexibility of layout, but any % class will do \documentclass[11pt]{memoir} % \olpath has to point to the location of the OLP main % directory/folder. We're compiling from subdirectory % courses/sample/phil379/printtest, so the main directory is three % levels up. \newcommand{\olpath}{../../../} % load all the Open Logic definitions. This will also load the % local definitions in open-logic-sample-config.sty \input{\olpath/sty/open-logic.sty} % all links plain black for printing \hypersetup{hidelinks} % we want all the problems deferred to the end \input{\olpath/sty/open-logic-defer.sty} % let's set the whole thing in Palatino, with Helvetica for % sans-serif, and spread the lines a bit to make the text more % readable \usepackage{mathpazo} \usepackage[scaled=0.95]{helvet} \linespread{1.05} % set stock & paper size to Lulu's ``Royal'' \setstocksize{23.389cm}{15.593cm} \settrimmedsize{\stockheight}{\stockwidth}{*} \settrims{0pt}{0pt} % let's calculate the line length for 65 characters in \normalfont \setlxvchars % set the size of the type block to calculated width in golden ratio \settypeblocksize{*}{\lxvchars}{1.618} % set spine and and edge maring in golden ratio \setlrmargins{*}{*}{1.618} \setulmargins{60pt}{*}{*} \setheaderspaces{*}{*}{1.618} \checkandfixthelayout \begin{document} % First we make a titlepage \newbox\adjust \begin{titlingpage} \begin{raggedleft} \fontsize{48pt}{7em}\selectfont\bfseries\sffamily \setbox\adjust\hbox{\phantom{,}} Sets,\\ Logic,\\ Computation\usebox\adjust \vskip 4ex \normalfont\Huge\textbf{Edited by\usebox\adjust\\ \href{http://richardzach.org/}{Richard Zach}\usebox\adjust}\ \end{raggedleft} \vfill % oluselicense generates a license mark that a) licenses the result % under a CC-BY licence and b) acknowledges the original source (the % OLP). Acknowledgment of the source is a requirement under the % conditions of the CC-BY license used by the OLP, but you are not % required to license the product itself under CC-BY. \oluselicense % Title of this version of the OLT with link to source {\href{https://github.com/rzach/phil379}{\textit{Sets, Logic, Computation}}} % Author of this version {\href{http://richardzach.org/}{Richard Zach}} \end{titlingpage} \frontmatter \pagestyle{ruled} \tableofcontents* \mainmatter \olimport*[sets-functions-relations]{sets-functions-relations} \olimport*[first-order-logic]{first-order-logic} \olimport*[turing-machines]{turing-machines} \stopproblems % now typeset all the problems as an appendix. If you want problems at % the end of each chapter, delete this part and put % \problemsperchapter in the preamble \backmatter \chapter{Problems} \printproblems \end{document}
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Data.List.Properties where open import Agda.Builtin.List open import Cubical.Core.Everything open import Cubical.Foundations.GroupoidLaws open import Cubical.Foundations.HLevels open import Cubical.Foundations.Prelude open import Cubical.Data.Empty as ⊥ open import Cubical.Data.Nat open import Cubical.Data.Sigma open import Cubical.Data.Unit open import Cubical.Relation.Nullary open import Cubical.Data.List.Base module _ {ℓ} {A : Type ℓ} where ++-unit-r : (xs : List A) → xs ++ [] ≡ xs ++-unit-r [] = refl ++-unit-r (x ∷ xs) = cong (_∷_ x) (++-unit-r xs) ++-assoc : (xs ys zs : List A) → (xs ++ ys) ++ zs ≡ xs ++ ys ++ zs ++-assoc [] ys zs = refl ++-assoc (x ∷ xs) ys zs = cong (_∷_ x) (++-assoc xs ys zs) rev-snoc : (xs : List A) (y : A) → rev (xs ++ [ y ]) ≡ y ∷ rev xs rev-snoc [] y = refl rev-snoc (x ∷ xs) y = cong (_++ [ x ]) (rev-snoc xs y) rev-++ : (xs ys : List A) → rev (xs ++ ys) ≡ rev ys ++ rev xs rev-++ [] ys = sym (++-unit-r (rev ys)) rev-++ (x ∷ xs) ys = cong (λ zs → zs ++ [ x ]) (rev-++ xs ys) ∙ ++-assoc (rev ys) (rev xs) [ x ] rev-rev : (xs : List A) → rev (rev xs) ≡ xs rev-rev [] = refl rev-rev (x ∷ xs) = rev-snoc (rev xs) x ∙ cong (_∷_ x) (rev-rev xs) rev-rev-snoc : (xs : List A) (y : A) → Square (rev-rev (xs ++ [ y ])) (cong (_++ [ y ]) (rev-rev xs)) (cong rev (rev-snoc xs y)) refl rev-rev-snoc [] y = sym (lUnit refl) rev-rev-snoc (x ∷ xs) y i j = hcomp (λ k → λ { (i = i1) → compPath-filler (rev-snoc (rev xs) x) (cong (x ∷_) (rev-rev xs)) k j ++ [ y ] ; (j = i0) → rev (rev-snoc xs y i ++ [ x ]) ; (j = i1) → x ∷ rev-rev-snoc xs y i k }) (rev-snoc (rev-snoc xs y i) x j) data SnocView : List A → Type ℓ where nil : SnocView [] snoc : (x : A) → (xs : List A) → (sx : SnocView xs) → SnocView (xs ∷ʳ x) snocView : (xs : List A) → SnocView xs snocView xs = helper nil xs where helper : {l : List A} -> SnocView l -> (r : List A) -> SnocView (l ++ r) helper {l} sl [] = subst SnocView (sym (++-unit-r l)) sl helper {l} sl (x ∷ r) = subst SnocView (++-assoc l (x ∷ []) r) (helper (snoc x l sl) r) -- Path space of list type module ListPath {ℓ} {A : Type ℓ} where Cover : List A → List A → Type ℓ Cover [] [] = Lift Unit Cover [] (_ ∷ _) = Lift ⊥ Cover (_ ∷ _) [] = Lift ⊥ Cover (x ∷ xs) (y ∷ ys) = (x ≡ y) × Cover xs ys reflCode : ∀ xs → Cover xs xs reflCode [] = lift tt reflCode (_ ∷ xs) = refl , reflCode xs encode : ∀ xs ys → (p : xs ≡ ys) → Cover xs ys encode xs _ = J (λ ys _ → Cover xs ys) (reflCode xs) encodeRefl : ∀ xs → encode xs xs refl ≡ reflCode xs encodeRefl xs = JRefl (λ ys _ → Cover xs ys) (reflCode xs) decode : ∀ xs ys → Cover xs ys → xs ≡ ys decode [] [] _ = refl decode [] (_ ∷ _) (lift ()) decode (x ∷ xs) [] (lift ()) decode (x ∷ xs) (y ∷ ys) (p , c) = cong₂ _∷_ p (decode xs ys c) decodeRefl : ∀ xs → decode xs xs (reflCode xs) ≡ refl decodeRefl [] = refl decodeRefl (x ∷ xs) = cong (cong₂ _∷_ refl) (decodeRefl xs) decodeEncode : ∀ xs ys → (p : xs ≡ ys) → decode xs ys (encode xs ys p) ≡ p decodeEncode xs _ = J (λ ys p → decode xs ys (encode xs ys p) ≡ p) (cong (decode xs xs) (encodeRefl xs) ∙ decodeRefl xs) isOfHLevelCover : (n : HLevel) (p : isOfHLevel (suc (suc n)) A) (xs ys : List A) → isOfHLevel (suc n) (Cover xs ys) isOfHLevelCover n p [] [] = isOfHLevelLift (suc n) (isProp→isOfHLevelSuc n isPropUnit) isOfHLevelCover n p [] (y ∷ ys) = isOfHLevelLift (suc n) (isProp→isOfHLevelSuc n isProp⊥) isOfHLevelCover n p (x ∷ xs) [] = isOfHLevelLift (suc n) (isProp→isOfHLevelSuc n isProp⊥) isOfHLevelCover n p (x ∷ xs) (y ∷ ys) = isOfHLevelΣ (suc n) (p x y) (\ _ → isOfHLevelCover n p xs ys) isOfHLevelList : ∀ {ℓ} (n : HLevel) {A : Type ℓ} → isOfHLevel (suc (suc n)) A → isOfHLevel (suc (suc n)) (List A) isOfHLevelList n ofLevel xs ys = isOfHLevelRetract (suc n) (ListPath.encode xs ys) (ListPath.decode xs ys) (ListPath.decodeEncode xs ys) (ListPath.isOfHLevelCover n ofLevel xs ys) private variable ℓ : Level A : Type ℓ caseList : ∀ {ℓ ℓ'} {A : Type ℓ} {B : Type ℓ'} → (n c : B) → List A → B caseList n _ [] = n caseList _ c (_ ∷ _) = c safe-head : A → List A → A safe-head x [] = x safe-head _ (x ∷ _) = x safe-tail : List A → List A safe-tail [] = [] safe-tail (_ ∷ xs) = xs cons-inj₁ : ∀ {x y : A} {xs ys} → x ∷ xs ≡ y ∷ ys → x ≡ y cons-inj₁ {x = x} p = cong (safe-head x) p cons-inj₂ : ∀ {x y : A} {xs ys} → x ∷ xs ≡ y ∷ ys → xs ≡ ys cons-inj₂ = cong safe-tail ¬cons≡nil : ∀ {x : A} {xs} → ¬ (x ∷ xs ≡ []) ¬cons≡nil {A = A} p = lower (subst (caseList (Lift ⊥) (List A)) p []) ¬nil≡cons : ∀ {x : A} {xs} → ¬ ([] ≡ x ∷ xs) ¬nil≡cons {A = A} p = lower (subst (caseList (List A) (Lift ⊥)) p []) ¬snoc≡nil : ∀ {x : A} {xs} → ¬ (xs ∷ʳ x ≡ []) ¬snoc≡nil {xs = []} contra = ¬cons≡nil contra ¬snoc≡nil {xs = x ∷ xs} contra = ¬cons≡nil contra ¬nil≡snoc : ∀ {x : A} {xs} → ¬ ([] ≡ xs ∷ʳ x) ¬nil≡snoc contra = ¬snoc≡nil (sym contra) cons≡rev-snoc : (x : A) → (xs : List A) → x ∷ rev xs ≡ rev (xs ∷ʳ x) cons≡rev-snoc _ [] = refl cons≡rev-snoc x (y ∷ ys) = λ i → cons≡rev-snoc x ys i ++ y ∷ [] isContr[]≡[] : isContr (Path (List A) [] []) isContr[]≡[] = refl , ListPath.decodeEncode [] [] isPropXs≡[] : {xs : List A} → isProp (xs ≡ []) isPropXs≡[] {xs = []} = isOfHLevelSuc 0 isContr[]≡[] isPropXs≡[] {xs = x ∷ xs} = λ p _ → ⊥.rec (¬cons≡nil p) discreteList : Discrete A → Discrete (List A) discreteList eqA [] [] = yes refl discreteList eqA [] (y ∷ ys) = no ¬nil≡cons discreteList eqA (x ∷ xs) [] = no ¬cons≡nil discreteList eqA (x ∷ xs) (y ∷ ys) with eqA x y | discreteList eqA xs ys ... | yes p | yes q = yes (λ i → p i ∷ q i) ... | yes _ | no ¬q = no (λ p → ¬q (cons-inj₂ p)) ... | no ¬p | _ = no (λ q → ¬p (cons-inj₁ q)) foldrCons : (xs : List A) → foldr _∷_ [] xs ≡ xs foldrCons [] = refl foldrCons (x ∷ xs) = cong (x ∷_) (foldrCons xs)
-- sums over sets import algebra.big_operators -- positive naturals import data.pnat namespace nat open list /-- returns the finset of divisors of a positive natural -/ definition factors (d : ℕ+) : list ℕ := filter (λ e, e ∣ d) (range (d+1)) #eval factors 6 -- [1, 2, 3, 6] lemma mem_factors_iff_divides (d : ℕ+) (e : ℕ) : e ∈ factors d ↔ e ∣ d := by simp [factors, -add_comm, nat.lt_succ_iff]; exact and_iff_right_of_imp (le_of_dvd d.2) lemma nodup_factors (d : ℕ+) : nodup (factors d) := nodup_filter _ (nodup_range (d+1) : nodup (range (d+1))) /-- returns the sum of f(e) as e ranges over the divisors of d (positive nat) -/ definition divisor_sum {β : Type*} [add_comm_monoid β] (f : ℕ → β) (d : ℕ+) : β := finset.sum (⟨quotient.mk (factors d),nodup_factors d⟩) f end nat open nat #eval divisor_sum (id) (6) -- it's a perfect number!
Well, it doesn't seem like it anyway. Maybe it will happen tonight just like yesterday. So what are you up to this weekend? I'm up to something....weeding, maybe? I have these lilies in the back of the house that I planted a couple of years ago. We were about to throw them away because they weren't thriving where we originally planted them but instead I decided to transplant them. Well now they're thriving. They hibernate during the cold months and come back in spring. Right now they're starting to have leaves. I have to weed around them before the 'gardener' [aka hubby] starts mowing them. He doesn't see them amidst all the weeds so he asked me to clean the surrounding areas so he doesn't have to mow around them. I may also pull out the weeds from around our big trees in the backyard. Again, the 'gardener' has been hinting that the weeds there are overtaking. I may just give in and weed...that is if he has to work this weekend. If not...then who knows what we'll be doing. Ang weather masyadong unpredictable. Biglang Fall temps kami dito yesterday, I couldn't believe I needed a jacket. Sobra ka namang busy sa pagiging assistant gardener. Dapat kasi maging chauffer ka na rin para lumarga kayo ng aking pamangkin pag Sabado. Enjoy the weekend. hopefully hindi kayo ulanin. Take care. Ay, envious ako sa weeding job mo! Here kasi, there's no lawn for weeds to grow, only tiny plant box for my plants. huhu.. Wish you'll have a bright sunny weekend Huling! Enjoy!
% Created 2017-02-22 Wed 11:51 % Intended LaTeX compiler: pdflatex \documentclass[presentation]{beamer} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{graphicx} \usepackage{grffile} \usepackage{longtable} \usepackage{wrapfig} \usepackage{rotating} \usepackage[normalem]{ulem} \usepackage{amsmath} \usepackage{textcomp} \usepackage{amssymb} \usepackage{capt-of} \usepackage{hyperref} \usetheme{Madrid} \author{Clarissa Littler} \date{\today} \title{If all math was computable\ldots{}} \hypersetup{ pdfauthor={Clarissa Littler}, pdftitle={If all math was computable\ldots{}}, pdfkeywords={}, pdfsubject={}, pdfcreator={Emacs 24.5.1 (Org mode 9.0.3)}, pdflang={English}} \begin{document} \maketitle \section{Talk} \label{sec:org2e66927} \begin{frame}[label={sec:orge0c899c}]{You wake up} \end{frame} \begin{frame}[label={sec:org6560e10}]{Programming class} \begin{block}{} \end{block} \end{frame} \begin{frame}[label={sec:orgbc548ad}]{Anti-virus} \begin{block}{A virus is a self-replicating program} \end{block} \end{frame} \begin{frame}[label={sec:org66acbfc}]{The new Hello World} \begin{block}{Travelling Salesman} \begin{center} \includegraphics[width=.9\linewidth]{2000px-Hamiltonian_path.svg.png} \end{center} \end{block} \end{frame} \begin{frame}[label={sec:orge85e13e}]{Banking} \begin{block}{Dedicated lines} \begin{center} \includegraphics[width=.9\linewidth]{Telegraph_Cable_Office.jpg} \end{center} \end{block} \end{frame} \begin{frame}[label={sec:org3aa09b8}]{Who uses passwords?} \begin{block}{} \end{block} \end{frame} \begin{frame}[label={sec:org7667ee8}]{Choice} \end{frame} \begin{frame}[label={sec:org7047978}]{Reverse engineering} \end{frame} \begin{frame}[label={sec:org275239c}]{Intellectual property} \begin{center} \includegraphics[width=.9\linewidth]{Felix_3D_Printer_-_Printing_Head.JPG} \end{center} \end{frame} \begin{frame}[label={sec:org0e6d1fc}]{\ldots{}wait?} \begin{block}{} Something occurs to you \end{block} \end{frame} \begin{frame}[label={sec:orge643353}]{Finite programs} \begin{block}{} Finite keyboards + finite length = countable number of programs \end{block} \end{frame} \begin{frame}[label={sec:orgadc44d3}]{Reals and Integers} \begin{block}{All the real numbers between 0 and 1} \begin{center} \begin{tabular}{lllll} \(a_1\) & \(a_2\) & \(a_3\) & \(a_4\) & \ldots{}\\ \(b_1\) & \(b_2\) & \(b_3\) & \(b_4\) & \ldots{}\\ \(c_1\) & \(c_2\) & \(c_3\) & \(c_4\) & \ldots{}\\ \(d_1\) & \(d_2\) & \(d_3\) & \(d_4\) & \ldots{}\\ \ldots{} & \ldots{} & \ldots{} & \ldots{} & \ldots{}\\ \end{tabular} \end{center} \end{block} \end{frame} \begin{frame}[label={sec:orga059993}]{A table of programs} \end{frame} \begin{frame}[label={sec:org31e98b8}]{If we fuss with the diagonal} \end{frame} \begin{frame}[label={sec:orgd75fb14}]{A program that can't exist} \end{frame} \begin{frame}[label={sec:org2489ca5}]{You wake up} \end{frame} \begin{frame}[label={sec:org75bb20e}]{The Real World: Programming is \alert{hard}} \end{frame} \begin{frame}[label={sec:org88b31cc}]{The Real World: Programming is \alert{finite}} \begin{block}{The finite nature of} \end{block} \end{frame} \begin{frame}[label={sec:org1c34829}]{Thank you} \begin{block}{} {\Huge Thank you for coming out! } \end{block} \end{frame} \end{document}
State Before: α : Type u_1 inst✝ : NormedLatticeAddCommGroup α x y : α ⊢ ‖x ⊔ y‖ ≤ ‖x‖ + ‖y‖ State After: α : Type u_1 inst✝ : NormedLatticeAddCommGroup α x y : α h : ‖x ⊔ y - 0 ⊔ 0‖ ≤ ‖x - 0‖ + ‖y - 0‖ ⊢ ‖x ⊔ y‖ ≤ ‖x‖ + ‖y‖ Tactic: have h : ‖x ⊔ y - 0 ⊔ 0‖ ≤ ‖x - 0‖ + ‖y - 0‖ := norm_sup_sub_sup_le_add_norm x y 0 0 State Before: α : Type u_1 inst✝ : NormedLatticeAddCommGroup α x y : α h : ‖x ⊔ y - 0 ⊔ 0‖ ≤ ‖x - 0‖ + ‖y - 0‖ ⊢ ‖x ⊔ y‖ ≤ ‖x‖ + ‖y‖ State After: no goals Tactic: simpa only [sup_idem, sub_zero] using h
rm(list=ls()) library(dplyr) library(ggplot2) library(tidyr) library(ggpubr) # set dataset dataset <- "Reeder" setwd(paste("/Users/ChatNoir/Projects/Squam/Graphs/",dataset, sep='')) # Read in data load(paste("/Users/ChatNoir/Projects/Squam/Graphs/",dataset,"/Calcs_",dataset,".RData", sep='')) # Colors color_S <- "orange" color_TP <- "springgreen4" color_AI <- "#2BB07FFF" color_SA <- "#38598CFF" color_SI <- "#C2DF23FF" # Bar graph of inferred support bins # We need to name our vector of factors and lables so everything colors properly myList <- c("springgreen4","darkolivegreen3","gray55","goldenrod1","orange") names(myList) <- c("Very Strong for Tox","Strong for Tox","Ambiguous","Strong for Sclero","Very Strong for Sclero") myColors <- c("Very Strong for Tox","Strong for Tox","Ambiguous","Strong for Sclero","Very Strong for Sclero") names(myColors) <- c("springgreen4","darkolivegreen3","gray55","goldenrod1","orange") title <- "Loci binned by 2ln(BF) values" legend_title <- "Interpretation of support" xlabs <- c("10 and over ", "6 to 10", "6 to -6", "-6 to -10", "-10 and under") xlablab <- '2ln(BF) values' ytic <- c(seq(0,40,5)) df <- TvS_BFsupport xval <- TvS_BFsupport$TvS_support yval <- TvS_BFsupport$counts BF_bar <- ggplot(data=df, aes(x=xval,y=yval)) + geom_bar(aes(color = xval, fill = xval), stat = "identity", position = position_dodge()) + theme_classic() + theme(plot.title = element_text(hjust = 0.5, size=16), axis.text = element_text(size=10, color="black"), text = element_text(size=14), legend.title = element_text(size = 12), legend.text = element_text(size = 10)) + scale_color_manual(values=myList, guide=FALSE) + labs(y="Number of Loci",x=xlablab) + scale_y_continuous(breaks = ytic) + scale_fill_manual(values=myList, name=legend_title, limits = myColors) + scale_x_discrete(labels=xlabs,drop = FALSE) + ggtitle(paste(dataset,"\n",title,sep="")) BF_bar title.g <- paste("Loci binned by dGLS values", sep='') legend_title.g <- "Interpretation of support" xlabs.g <- c("0.5 and over ", "0.1 to 0.5", "0.1 to -0.1", "-0.1 to -0.5", "-0.5 and under") xlablab.g <- 'dGLS values' ytic.g <- c(seq(0,45,5)) df.g <- TvS_GLsupport xval.g <- TvS_GLsupport$TvS_support yval.g <- TvS_GLsupport$counts GL_bar <- ggplot(data=df.g, aes(x=xval.g,y=yval.g)) + geom_bar(aes(color = xval.g, fill = xval.g), stat = "identity", position = position_dodge()) + theme_classic() + theme(plot.title = element_text(hjust = 0.5, size=16), axis.text = element_text(size=10, color="black"), text = element_text(size=14), legend.title = element_text(size = 12), legend.text = element_text(size = 10)) + scale_color_manual(values=myList, guide=FALSE) + labs(y="Number of Loci",x=xlablab.g) + scale_y_continuous(breaks = ytic.g) + scale_fill_manual(values=myList, name=legend_title.g, limits = myColors) + scale_x_discrete(labels=xlabs.g,drop = FALSE) + ggtitle(title.g) GL_bar graph_combined <- ggarrange(BF, GL, ncol=1, nrow=2, legend="bottom", align="v",common.legend = TRUE) graph_combined # Write to file # change axis text to 24 element texts to 30 ggsave(paste(dataset,"_support.pdf",sep=""), plot=graph_combined,width = 6, height = 9.5, units = "in", device = 'pdf',bg = "transparent")
function U = uCheck(U,TolMesh,optimState,proj) %UCHECK Remove duplicates, vectors outside bounds or previously evaluated if nargin < 4 || isempty(proj); proj = 0; end if proj % Project vectors outside bounds on search mesh points closest to bounds U = bsxfun(@max, bsxfun(@min, U, optimState.UBsearch), optimState.LBsearch); else idx = any(bsxfun(@gt,U,optimState.UB) | bsxfun(@lt,U,optimState.LB),2); U(idx,:) = []; end % Remove duplicate vectors U = unique(U,'rows'); % Remove previously evaluted vectors (within TolMesh) if ~isempty(U) TolMesh = TolMesh/2; % TolMesh = exp(0.5*(log(TolMesh) + log(optimState.meshsize)))/2; % Convert everything to normalized grid coordinates for comparison u1 = round(U./TolMesh); U2 = optimState.U(1:optimState.Xmax,:); u2 = round(U2./TolMesh); [~,idx] = setdiff(u1,u2,'rows'); U = U(idx,:); end % Evaluate non-bound constraints if ~isempty(optimState.nonbcon) X = origunits(U,optimState); % Convert back to original space C = optimState.nonbcon(X); % Evaluate constraints idx = (C <= 0); % Keep points that satisfy constraints U = U(idx,:); end end
#include <examples/rpcbench/echo.pb.h> #include <boost/bind.hpp> #include <claire/protorpc/RpcServer.h> #include <claire/common/events/EventLoop.h> #include <claire/common/logging/Logging.h> #include <claire/netty/InetAddress.h> using namespace claire; DEFINE_int32(num_threads, 4, "num of RpcServer threads"); namespace echo { class EchoServiceImpl : public EchoService { public: virtual void Echo(RpcControllerPtr& controller, const ::echo::EchoRequestPtr& request, const ::echo::EchoResponse* response_prototype, const RpcDoneCallback& done) { EchoResponse response; response.set_str(request->str()); done(controller, &response); } }; } int main(int argc, char* argv[]) { ::google::ParseCommandLineFlags(&argc, &argv, true); ::google::InitGoogleLogging(argv[0]); EventLoop loop; InetAddress listen_address(8081); InetAddress stats_address(8082); echo::EchoServiceImpl impl; RpcServer server(&loop, listen_address, stats_address); server.set_num_threads(FLAGS_num_threads); server.RegisterService(&impl); server.Start(); loop.loop(); }
State Before: α : Type u_1 inst✝ : LinearOrderedAddCommGroup α hα : Archimedean α p : α hp : 0 < p a✝ b✝ c : α n : ℤ a b : α ⊢ toIcoDiv hp a b • p - b = -toIcoMod hp a b State After: no goals Tactic: rw [toIcoMod, neg_sub]
State Before: F : Type ?u.80713 α : Type u_1 β : Type ?u.80719 γ : Type ?u.80722 inst✝ : DivisionMonoid α s t : Set α ⊢ s * t = 1 ↔ ∃ a b, s = {a} ∧ t = {b} ∧ a * b = 1 State After: case refine'_1 F : Type ?u.80713 α : Type u_1 β : Type ?u.80719 γ : Type ?u.80722 inst✝ : DivisionMonoid α s t : Set α h : s * t = 1 ⊢ ∃ a b, s = {a} ∧ t = {b} ∧ a * b = 1 case refine'_2 F : Type ?u.80713 α : Type u_1 β : Type ?u.80719 γ : Type ?u.80722 inst✝ : DivisionMonoid α s t : Set α ⊢ (∃ a b, s = {a} ∧ t = {b} ∧ a * b = 1) → s * t = 1 Tactic: refine' ⟨fun h => _, _⟩ State Before: case refine'_1 F : Type ?u.80713 α : Type u_1 β : Type ?u.80719 γ : Type ?u.80722 inst✝ : DivisionMonoid α s t : Set α h : s * t = 1 ⊢ ∃ a b, s = {a} ∧ t = {b} ∧ a * b = 1 State After: case refine'_1 F : Type ?u.80713 α : Type u_1 β : Type ?u.80719 γ : Type ?u.80722 inst✝ : DivisionMonoid α s t : Set α h : s * t = 1 hst : Set.Nonempty (s * t) ⊢ ∃ a b, s = {a} ∧ t = {b} ∧ a * b = 1 Tactic: have hst : (s * t).Nonempty := h.symm.subst one_nonempty State Before: case refine'_1 F : Type ?u.80713 α : Type u_1 β : Type ?u.80719 γ : Type ?u.80722 inst✝ : DivisionMonoid α s t : Set α h : s * t = 1 hst : Set.Nonempty (s * t) ⊢ ∃ a b, s = {a} ∧ t = {b} ∧ a * b = 1 State After: case refine'_1.intro F : Type ?u.80713 α : Type u_1 β : Type ?u.80719 γ : Type ?u.80722 inst✝ : DivisionMonoid α s t : Set α h : s * t = 1 hst : Set.Nonempty (s * t) a : α ha : a ∈ s ⊢ ∃ a b, s = {a} ∧ t = {b} ∧ a * b = 1 Tactic: obtain ⟨a, ha⟩ := hst.of_image2_left State Before: case refine'_1.intro F : Type ?u.80713 α : Type u_1 β : Type ?u.80719 γ : Type ?u.80722 inst✝ : DivisionMonoid α s t : Set α h : s * t = 1 hst : Set.Nonempty (s * t) a : α ha : a ∈ s ⊢ ∃ a b, s = {a} ∧ t = {b} ∧ a * b = 1 State After: case refine'_1.intro.intro F : Type ?u.80713 α : Type u_1 β : Type ?u.80719 γ : Type ?u.80722 inst✝ : DivisionMonoid α s t : Set α h : s * t = 1 hst : Set.Nonempty (s * t) a : α ha : a ∈ s b : α hb : b ∈ t ⊢ ∃ a b, s = {a} ∧ t = {b} ∧ a * b = 1 Tactic: obtain ⟨b, hb⟩ := hst.of_image2_right State Before: case refine'_1.intro.intro F : Type ?u.80713 α : Type u_1 β : Type ?u.80719 γ : Type ?u.80722 inst✝ : DivisionMonoid α s t : Set α h : s * t = 1 hst : Set.Nonempty (s * t) a : α ha : a ∈ s b : α hb : b ∈ t ⊢ ∃ a b, s = {a} ∧ t = {b} ∧ a * b = 1 State After: case refine'_1.intro.intro F : Type ?u.80713 α : Type u_1 β : Type ?u.80719 γ : Type ?u.80722 inst✝ : DivisionMonoid α s t : Set α h : s * t = 1 hst : Set.Nonempty (s * t) a : α ha : a ∈ s b : α hb : b ∈ t H : ∀ {a b : α}, a ∈ s → b ∈ t → a * b = 1 ⊢ ∃ a b, s = {a} ∧ t = {b} ∧ a * b = 1 Tactic: have H : ∀ {a b}, a ∈ s → b ∈ t → a * b = (1 : α) := fun {a b} ha hb => h.subset <| mem_image2_of_mem ha hb State Before: case refine'_1.intro.intro F : Type ?u.80713 α : Type u_1 β : Type ?u.80719 γ : Type ?u.80722 inst✝ : DivisionMonoid α s t : Set α h : s * t = 1 hst : Set.Nonempty (s * t) a : α ha : a ∈ s b : α hb : b ∈ t H : ∀ {a b : α}, a ∈ s → b ∈ t → a * b = 1 ⊢ ∃ a b, s = {a} ∧ t = {b} ∧ a * b = 1 State After: case refine'_1.intro.intro.refine'_1 F : Type ?u.80713 α : Type u_1 β : Type ?u.80719 γ : Type ?u.80722 inst✝ : DivisionMonoid α s t : Set α h : s * t = 1 hst : Set.Nonempty (s * t) a : α ha : a ∈ s b : α hb : b ∈ t H : ∀ {a b : α}, a ∈ s → b ∈ t → a * b = 1 x : α hx : x ∈ s ⊢ x = a case refine'_1.intro.intro.refine'_2 F : Type ?u.80713 α : Type u_1 β : Type ?u.80719 γ : Type ?u.80722 inst✝ : DivisionMonoid α s t : Set α h : s * t = 1 hst : Set.Nonempty (s * t) a : α ha : a ∈ s b : α hb : b ∈ t H : ∀ {a b : α}, a ∈ s → b ∈ t → a * b = 1 x : α hx : x ∈ t ⊢ x = b Tactic: refine' ⟨a, b, _, _, H ha hb⟩ <;> refine' eq_singleton_iff_unique_mem.2 ⟨‹_›, fun x hx => _⟩ State Before: case refine'_1.intro.intro.refine'_1 F : Type ?u.80713 α : Type u_1 β : Type ?u.80719 γ : Type ?u.80722 inst✝ : DivisionMonoid α s t : Set α h : s * t = 1 hst : Set.Nonempty (s * t) a : α ha : a ∈ s b : α hb : b ∈ t H : ∀ {a b : α}, a ∈ s → b ∈ t → a * b = 1 x : α hx : x ∈ s ⊢ x = a State After: no goals Tactic: exact (eq_inv_of_mul_eq_one_left <| H hx hb).trans (inv_eq_of_mul_eq_one_left <| H ha hb) State Before: case refine'_1.intro.intro.refine'_2 F : Type ?u.80713 α : Type u_1 β : Type ?u.80719 γ : Type ?u.80722 inst✝ : DivisionMonoid α s t : Set α h : s * t = 1 hst : Set.Nonempty (s * t) a : α ha : a ∈ s b : α hb : b ∈ t H : ∀ {a b : α}, a ∈ s → b ∈ t → a * b = 1 x : α hx : x ∈ t ⊢ x = b State After: no goals Tactic: exact (eq_inv_of_mul_eq_one_right <| H ha hx).trans (inv_eq_of_mul_eq_one_right <| H ha hb) State Before: case refine'_2 F : Type ?u.80713 α : Type u_1 β : Type ?u.80719 γ : Type ?u.80722 inst✝ : DivisionMonoid α s t : Set α ⊢ (∃ a b, s = {a} ∧ t = {b} ∧ a * b = 1) → s * t = 1 State After: case refine'_2.intro.intro.intro.intro F : Type ?u.80713 α : Type u_1 β : Type ?u.80719 γ : Type ?u.80722 inst✝ : DivisionMonoid α b c : α h : b * c = 1 ⊢ {b} * {c} = 1 Tactic: rintro ⟨b, c, rfl, rfl, h⟩ State Before: case refine'_2.intro.intro.intro.intro F : Type ?u.80713 α : Type u_1 β : Type ?u.80719 γ : Type ?u.80722 inst✝ : DivisionMonoid α b c : α h : b * c = 1 ⊢ {b} * {c} = 1 State After: no goals Tactic: rw [singleton_mul_singleton, h, singleton_one]
Formal statement is: lemma chinese_remainder: fixes a::nat assumes ab: "coprime a b" and a: "a \<noteq> 0" and b: "b \<noteq> 0" shows "\<exists>x q1 q2. x = u + q1 * a \<and> x = v + q2 * b" Informal statement is: If $a$ and $b$ are coprime, then there exist integers $q_1$ and $q_2$ such that $u + q_1 a = v + q_2 b$.
(* Title: HOL/Auth/n_germanSymIndex_lemma_on_inv__44.thy Author: Yongjian Li and Kaiqiang Duan, State Key Lab of Computer Science, Institute of Software, Chinese Academy of Sciences Copyright 2016 State Key Lab of Computer Science, Institute of Software, Chinese Academy of Sciences *) header{*The n_germanSymIndex Protocol Case Study*} theory n_germanSymIndex_lemma_on_inv__44 imports n_germanSymIndex_base begin section{*All lemmas on causal relation between inv__44 and some rule r*} lemma n_RecvReqSVsinv__44: assumes a1: "(\<exists> i. i\<le>N\<and>r=n_RecvReqS N i)" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__44 p__Inv2)" shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s") proof - from a1 obtain i where a1:"i\<le>N\<and>r=n_RecvReqS N i" apply fastforce done from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__44 p__Inv2" apply fastforce done have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done moreover { assume b1: "(i=p__Inv2)" have "?P3 s" apply (cut_tac a1 a2 b1, simp, rule_tac x="(neg (andForm (eqn (IVar (Ident ''CurCmd'')) (Const Empty)) (eqn (IVar (Field (Para (Ident ''Chan2'') p__Inv2) ''Cmd'')) (Const Inv))))" in exI, auto) done then have "invHoldForRule s f r (invariants N)" by auto } moreover { assume b1: "(i~=p__Inv2)" have "?P3 s" apply (cut_tac a1 a2 b1, simp, rule_tac x="(neg (andForm (eqn (IVar (Ident ''CurCmd'')) (Const Empty)) (eqn (IVar (Field (Para (Ident ''Chan2'') p__Inv2) ''Cmd'')) (Const Inv))))" in exI, auto) done then have "invHoldForRule s f r (invariants N)" by auto } ultimately show "invHoldForRule s f r (invariants N)" by satx qed lemma n_RecvReqEVsinv__44: assumes a1: "(\<exists> i. i\<le>N\<and>r=n_RecvReqE N i)" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__44 p__Inv2)" shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s") proof - from a1 obtain i where a1:"i\<le>N\<and>r=n_RecvReqE N i" apply fastforce done from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__44 p__Inv2" apply fastforce done have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done moreover { assume b1: "(i=p__Inv2)" have "?P1 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } moreover { assume b1: "(i~=p__Inv2)" have "?P1 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } ultimately show "invHoldForRule s f r (invariants N)" by satx qed lemma n_SendInv__part__0Vsinv__44: assumes a1: "(\<exists> i. i\<le>N\<and>r=n_SendInv__part__0 i)" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__44 p__Inv2)" shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s") proof - from a1 obtain i where a1:"i\<le>N\<and>r=n_SendInv__part__0 i" apply fastforce done from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__44 p__Inv2" apply fastforce done have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done moreover { assume b1: "(i=p__Inv2)" have "?P1 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } moreover { assume b1: "(i~=p__Inv2)" have "?P2 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } ultimately show "invHoldForRule s f r (invariants N)" by satx qed lemma n_SendInv__part__1Vsinv__44: assumes a1: "(\<exists> i. i\<le>N\<and>r=n_SendInv__part__1 i)" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__44 p__Inv2)" shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s") proof - from a1 obtain i where a1:"i\<le>N\<and>r=n_SendInv__part__1 i" apply fastforce done from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__44 p__Inv2" apply fastforce done have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done moreover { assume b1: "(i=p__Inv2)" have "?P1 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } moreover { assume b1: "(i~=p__Inv2)" have "?P2 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } ultimately show "invHoldForRule s f r (invariants N)" by satx qed lemma n_SendInvAckVsinv__44: assumes a1: "(\<exists> i. i\<le>N\<and>r=n_SendInvAck i)" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__44 p__Inv2)" shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s") proof - from a1 obtain i where a1:"i\<le>N\<and>r=n_SendInvAck i" apply fastforce done from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__44 p__Inv2" apply fastforce done have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done moreover { assume b1: "(i=p__Inv2)" have "?P1 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } moreover { assume b1: "(i~=p__Inv2)" have "?P2 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } ultimately show "invHoldForRule s f r (invariants N)" by satx qed lemma n_RecvInvAckVsinv__44: assumes a1: "(\<exists> i. i\<le>N\<and>r=n_RecvInvAck i)" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__44 p__Inv2)" shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s") proof - from a1 obtain i where a1:"i\<le>N\<and>r=n_RecvInvAck i" apply fastforce done from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__44 p__Inv2" apply fastforce done have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done moreover { assume b1: "(i=p__Inv2)" have "((formEval (eqn (IVar (Ident ''ExGntd'')) (Const true)) s))\<or>((formEval (neg (eqn (IVar (Ident ''ExGntd'')) (Const true))) s))" by auto moreover { assume c1: "((formEval (eqn (IVar (Ident ''ExGntd'')) (Const true)) s))" have "?P3 s" apply (cut_tac a1 a2 b1 c1, simp, rule_tac x="(neg (andForm (eqn (IVar (Field (Para (Ident ''Chan2'') p__Inv2) ''Cmd'')) (Const Inv)) (eqn (IVar (Field (Para (Ident ''Chan3'') p__Inv2) ''Cmd'')) (Const InvAck))))" in exI, auto) done then have "invHoldForRule s f r (invariants N)" by auto } moreover { assume c1: "((formEval (neg (eqn (IVar (Ident ''ExGntd'')) (Const true))) s))" have "?P2 s" proof(cut_tac a1 a2 b1 c1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } ultimately have "invHoldForRule s f r (invariants N)" by satx } moreover { assume b1: "(i~=p__Inv2)" have "((formEval (eqn (IVar (Ident ''ExGntd'')) (Const true)) s))\<or>((formEval (neg (eqn (IVar (Ident ''ExGntd'')) (Const true))) s))" by auto moreover { assume c1: "((formEval (eqn (IVar (Ident ''ExGntd'')) (Const true)) s))" have "?P3 s" apply (cut_tac a1 a2 b1 c1, simp, rule_tac x="(neg (andForm (andForm (eqn (IVar (Ident ''CurCmd'')) (Const ReqS)) (eqn (IVar (Field (Para (Ident ''Chan2'') p__Inv2) ''Cmd'')) (Const Inv))) (eqn (IVar (Field (Para (Ident ''Chan3'') i) ''Cmd'')) (Const InvAck))))" in exI, auto) done then have "invHoldForRule s f r (invariants N)" by auto } moreover { assume c1: "((formEval (neg (eqn (IVar (Ident ''ExGntd'')) (Const true))) s))" have "?P2 s" proof(cut_tac a1 a2 b1 c1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } ultimately have "invHoldForRule s f r (invariants N)" by satx } ultimately show "invHoldForRule s f r (invariants N)" by satx qed lemma n_SendGntSVsinv__44: assumes a1: "(\<exists> i. i\<le>N\<and>r=n_SendGntS i)" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__44 p__Inv2)" shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s") proof - from a1 obtain i where a1:"i\<le>N\<and>r=n_SendGntS i" apply fastforce done from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__44 p__Inv2" apply fastforce done have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done moreover { assume b1: "(i=p__Inv2)" have "?P1 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } moreover { assume b1: "(i~=p__Inv2)" have "?P1 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } ultimately show "invHoldForRule s f r (invariants N)" by satx qed lemma n_SendGntEVsinv__44: assumes a1: "(\<exists> i. i\<le>N\<and>r=n_SendGntE N i)" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__44 p__Inv2)" shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s") proof - from a1 obtain i where a1:"i\<le>N\<and>r=n_SendGntE N i" apply fastforce done from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__44 p__Inv2" apply fastforce done have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done moreover { assume b1: "(i=p__Inv2)" have "?P1 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } moreover { assume b1: "(i~=p__Inv2)" have "?P1 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } ultimately show "invHoldForRule s f r (invariants N)" by satx qed lemma n_RecvGntSVsinv__44: assumes a1: "(\<exists> i. i\<le>N\<and>r=n_RecvGntS i)" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__44 p__Inv2)" shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s") proof - from a1 obtain i where a1:"i\<le>N\<and>r=n_RecvGntS i" apply fastforce done from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__44 p__Inv2" apply fastforce done have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done moreover { assume b1: "(i=p__Inv2)" have "?P1 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } moreover { assume b1: "(i~=p__Inv2)" have "?P2 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } ultimately show "invHoldForRule s f r (invariants N)" by satx qed lemma n_RecvGntEVsinv__44: assumes a1: "(\<exists> i. i\<le>N\<and>r=n_RecvGntE i)" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__44 p__Inv2)" shows "invHoldForRule s f r (invariants N)" (is "?P1 s \<or> ?P2 s \<or> ?P3 s") proof - from a1 obtain i where a1:"i\<le>N\<and>r=n_RecvGntE i" apply fastforce done from a2 obtain p__Inv2 where a2:"p__Inv2\<le>N\<and>f=inv__44 p__Inv2" apply fastforce done have "(i=p__Inv2)\<or>(i~=p__Inv2)" apply (cut_tac a1 a2, auto) done moreover { assume b1: "(i=p__Inv2)" have "?P1 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } moreover { assume b1: "(i~=p__Inv2)" have "?P2 s" proof(cut_tac a1 a2 b1, auto) qed then have "invHoldForRule s f r (invariants N)" by auto } ultimately show "invHoldForRule s f r (invariants N)" by satx qed lemma n_SendReqE__part__1Vsinv__44: assumes a1: "\<exists> i. i\<le>N\<and>r=n_SendReqE__part__1 i" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__44 p__Inv2)" shows "invHoldForRule s f r (invariants N)" apply (rule noEffectOnRule, cut_tac a1 a2, auto) done lemma n_StoreVsinv__44: assumes a1: "\<exists> i d. i\<le>N\<and>d\<le>N\<and>r=n_Store i d" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__44 p__Inv2)" shows "invHoldForRule s f r (invariants N)" apply (rule noEffectOnRule, cut_tac a1 a2, auto) done lemma n_SendReqE__part__0Vsinv__44: assumes a1: "\<exists> i. i\<le>N\<and>r=n_SendReqE__part__0 i" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__44 p__Inv2)" shows "invHoldForRule s f r (invariants N)" apply (rule noEffectOnRule, cut_tac a1 a2, auto) done lemma n_SendReqSVsinv__44: assumes a1: "\<exists> i. i\<le>N\<and>r=n_SendReqS i" and a2: "(\<exists> p__Inv2. p__Inv2\<le>N\<and>f=inv__44 p__Inv2)" shows "invHoldForRule s f r (invariants N)" apply (rule noEffectOnRule, cut_tac a1 a2, auto) done end
import numpy as np from physics_sim import PhysicsSim class Task(): """Task (environment) that defines the goal and provides feedback to the agent.""" def __init__(self, init_pose=None, init_velocities=None, init_angle_velocities=None, runtime=5., target_pos=None): """Initialize a Task object. Params ====== init_pose: initial position of the quadcopter in (x,y,z) dimensions and the Euler angles init_velocities: initial velocity of the quadcopter in (x,y,z) dimensions init_angle_velocities: initial radians/second for each of the three Euler angles runtime: time limit for each episode target_pos: target/goal (x,y,z) position for the agent """ # Simulation self.sim = PhysicsSim(init_pose, init_velocities, init_angle_velocities, runtime) self.action_repeat = 3 self.state_size = self.action_repeat * 9 self.action_low = 0 self.action_high = 900 self.action_size = 4 # Goal self.target_pos = target_pos if target_pos is not None else np.array([0., 0., 0.]) def get_reward(self): """Uses current pose of sim to return reward.""" # Calculate distance from target dist_from_target = np.sqrt(np.square(self.sim.pose[:3] - self.target_pos).sum()) #dist_from_target_squared = np.square(self.sim.pose[:3] - self.target_pos).sum() # Calculate distance from vertical axis #dist_from_axis = np.sqrt(np.square(self.sim.pose[:2] - self.target_pos[:2]).sum()) # Calculate angular deviation angular_deviation = np.sqrt(np.square(self.sim.pose[3:]).sum()) # Calculate velocity in xy plane #non_z_v = np.square(self.sim.v[:2]).sum() # Calculate overall velocity #vel = np.square(self.sim.v[:3]).sum() penalty = 0.004 * dist_from_target * dist_from_target #penalty = 0.015 * dist_from_target_squared # Penalty based on angular deviation to encourage the quadcopter to remain upright penalty += 0.008 * angular_deviation # Penalty based on movement in the xy plane to encourage the quadcopter to fly vertically #if dist_from_axis > 4: # penalty += 0.1 # Penalty for high velocity to encourage quadcopter to fly slower #if vel > 10.0: # penalty += 0.1 #if self.sim.pose[2] > self.target_pos[2] + 5: # penalty += 0.01 bonus = 1.0 #if dist_from_target < 0.5: # bonus += 0.01 # Calculate reward reward = bonus - penalty # Reward for time to encourage quadcopter to remain in the air #reward += 0.001 * self.sim.time # clamp reward to [-1, 1] #return min(1.0, max(-1.0, reward)) return np.tanh(reward) def step(self, rotor_speeds): """Uses action to obtain next state, reward, done.""" reward = 0 pose_all = [] for _ in range(self.action_repeat): done = self.sim.next_timestep(rotor_speeds) # update the sim pose and velocities reward += self.get_reward() pose_all.append(self.sim.pose) pose_all.append(self.sim.v) next_state = np.concatenate(pose_all) return next_state, reward, done def reset(self): """Reset the sim to start a new episode.""" self.sim.reset() pose_all = np.append(self.sim.pose, self.sim.v) state = np.concatenate([pose_all] * self.action_repeat) return state
import data.set.function import tactic.linarith import tactic.norm_num open function namespace mth1001 section identity /- For a given type `α`, there is a special function, the identity function `id : α → α` defined so that `id a = a`, for every `a : α`. -/ def p₁ (x : ℕ) : ℤ := 3 * x /- For every function `f : α → β`, we have `id ∘ f = f` and `f ∘ id = f`. -/ #eval (p₁ ∘ id) 6 #eval (id ∘ p₁) 6 /- To be more precise, we should acknowledge that the identity function `id : α → α` depends on the type `α`. In Lean, we dentote this function by `@id α`. In mathematical writing, we may use a subscript `id_α` instead. So if `f : α → β`, then `f ∘ @id α = f` and `@id β ∘ f = f`. -/ #check p₁ ∘ @id ℕ #check @id ℤ ∘ p₁ end identity section inverse_examples /- Given a function `f : α → β`, a function `g : β → α` is a *right inverse* of `f` if `∀ b : β, f (g b) = b`. The function `h : β → α` is a *left inverse* of `f` if `∀ a : α, h (f a) = a`. The notions are captured by the Lean defintions `right_inverse` and `left_inverse`. An equivalent characterisation: Given a function `f : α → β`, a function `g : β → α` is a *right inverse* of `f` if `f ∘ g = @id β`. A function `h : β → α` is a *left inverse* of `f` if `h ∘ f = @id α`. Given `k₁ : left_inverse h f`, i.e. that `h` is a left inverse of `f` & given `k₂ : right_inverse g f`, i.e. that `g` is a right inverse of `f`, `left_inverse.comp_eq_id k₁` is a proof that `h ∘ f = id` and `right_inverse.comp_eq_id k₂` is a proof that `f ∘ g = id`. Note: if `g` is a right inverse of `f`, then `f` is a left inverse of `g`, and vice versa. -/ #print left_inverse #print right_inverse -- We'll construct a left inverse of the function `f₁ : ℕ → ℤ`, `f₁ x = x + 3`. def f₁ (x : ℕ) : ℤ := x + 3 /- The function `φ₁` below is defined piecewise. -/ def φ₁ : ℤ → ℕ | (n + 3 : ℕ) := n -- If `x ≥ -3`, then `φ₁ x = x - 3`. | _ := 0 -- Otherwise, `φ₁ x = 0`. #eval φ₁ 2 -- `φ₁ 2 = 0` #eval φ₁ 8 -- `φ₁ 8 = 8 - 3 = 5`. -- We show `φ₁` is a left inverse of `f₁` (equally, `f₁` is a right inverse of `φ₁`). lemma left_inv_phi1f1: left_inverse φ₁ f₁ := begin intro x, -- Assume `x : ℕ`. It suffices to prove `φ₁ (f₁ x) = x`. split, -- This holds for each of the cases that define `φ₁`. end /- Here's another piecewise function. -/ def φ₂ : ℤ → ℕ | (n + 3 : ℕ) := n -- If `x ≥ 3`, then `φ₂ x = x - 3`. | _ := 720 -- Otherwise, `φ₂ x = 720`. #eval φ₂ 2 -- `φ₂ 2 = 720` #eval φ₂ 8 -- `φ₂ 8 = 8 - 3 = 5`. -- We show `φ₂` is also a left inverse of `f₁` (equally, `f₁` is a right inverse of `φ₂`). lemma left_inv_phi2f1 : left_inverse φ₂ f₁ := begin intro x, -- Assume `x : ℕ`. It suffices to prove `φ₂ (f₁ x) = x`. split, -- This holds for each of the cases that define `φ₂`. end /- The upshot of these two examples is that even when a function has a left inverse, that left inverse need not be *unique*. Here, both `φ₁` and `φ₂` are left inverses of `f₁`. -/ /- As noted, `f₁` is a right inverse of `φ₁`. We'll now find *another* right inverse of `φ₁`. -/ def f₂ : ℕ → ℤ | 0 := 2 -- `f₂ 0 = 2`. For other values, `n`, of the input, | n := n + 3 -- `f₂ n = n + 3`. example : right_inverse f₂ φ₁ := begin intro x, -- Assume `x : ℕ`. It suffices to prove `φ₁ (f₂ x) = x`. by_cases h : (x = 0), -- We consider two cases 1. `h : x = 0` and 2. `h : x ≠ 0`. { rw h, -- Substituting `h : x = 0`, the goal is `φ₁ (f₂ 0) = 0`. refl, }, -- This is true, by reflexivity. { rw f₂, -- Use the definition of `f₂`. { split, }, -- Consider all { exact h, },}, -- possible cases. end end inverse_examples section uniqueness_theorems variable {α : Type*} variable {β : Type*} -- A function that has both a left and a right inverse is said to be *invertible*. def invertible (f : α → β) := has_left_inverse f ∧ has_right_inverse f -- For example, the identity function on any type is invertible. example : invertible (@id α) := begin split, -- It suffices to prove `has_left_inverse (@id α)` and `has_right_inverse (@id α)`. { use (@id α), -- It suffices to show `@id α` is a left inverse of `@id α`. intro x, -- Assume `x : α`. It suffices to prove `id (id x) = x`. unfold id, }, -- This follows by definition of `id`. { use (@id α), -- It suffces to show `@id α` is a right inverse of `@id α`. intro x, -- Assume `x : α`. It suffices to prove `id (id x) = x`. unfold id, }, -- This follos by definition of `id`. end /- Inverses are unique in the following sense. If a function `f : α → β` has a left inverse `h : β → α` and a right inverse `g : β → α`, then `h = g`. The proof below uses *functional extensionality*. This is the principle that, given functions `h : β → α` and `g : β → α`, the claim `h = g` is equivalent to the claim `∀ b : β, h b = g b`. -/ theorem left_inverse_eq_right_inverse (f : α → β) (g h : β → α) (k₁ : left_inverse h f) (k₂ : right_inverse g f) : h = g := begin ext b, -- Assume `b : β`. It suffices to prove `h b = g b`. calc h b = h (f (g b)) : by rw k₂ b -- Note `f (g b) = b`, as `g` is a right inverse of `f`. ... = g b : k₁ (g b) -- Further, `h (f (g b)) = g b`, as `h` is left inverse of `f`. end /- The result can also be proved using the composite-based definition of left and right inverses. The proof below, though longer, is illustrative of more general principles in algebra that you will see next term and in later years. -/ example (f : α → β) (g h : β → α) (k₁ : left_inverse h f) (k₂ : right_inverse g f) : h = g := begin calc h = h ∘ id : rfl -- This holds by reflexivity ... = h ∘ (f ∘ g) : by rw (right_inverse.comp_eq_id k₂) ... = (h ∘ f) ∘ g : rfl ... = id ∘ g : by rw (left_inverse.comp_eq_id k₁) ... = g : rfl end /- As a simple corrolary, every invertible function has exactly one left inverse and exactly one right inverse. -/ theorem unique_left_inverse_of_invertible (f : α → β) (fi : invertible f) (h₁ h₂ : β → α) (k₁ : left_inverse h₁ f) (k₂ : left_inverse h₂ f) : h₁ = h₂ := begin sorry end theorem unique_right_inverse_of_invertible (f : α → β) (fi : invertible f) (g₁ g₂ : β → α) (k₁ : right_inverse g₁ f) (k₂ : right_inverse g₂ f) : g₁ = g₂ := begin sorry end /- The function `f₁ : ℕ → ℤ` defined before by `f x := x + 3` has (at least) two different left inverses, `φ₁` and `φ₂`. We infer that `f₁` cannot be invertible! -/ end uniqueness_theorems section inverse_theorems variable {α : Type*} variable {β : Type*} /- We'll show that a function is surjective if it has a right inverse. -/ theorem surjective_of_right_inverse (f : α → β) (g : β → α) (h : right_inverse g f) : surjective f := begin sorry end /- Now we'll show a function is injective if it has a left inverse. We'll give two proofs. The second is nicer but it introduces some new Lean syntax. -/ example (f : α → β) (g : β → α) (h : left_inverse g f) : injective f := begin intros a₁ a₂ h₂, -- Assume `a₁ a₂ : α` and `h₂ : f a₁ = f a₂`. have h₃ : g (f a₁) = g (f a₂), { rw h₂, }, have h₄ : a₁ = g (f a₁), from (h a₁).symm, have h₅ : g (f a₂) = a₂, from h a₂, transitivity, { exact h₄, }, { transitivity, { exact h₃, }, { exact h₅, }, }, end /- The proof above used two applications of transitivity on three new hypotheses. Calculations like this can be expressed in `calc` mode, which simulates a mathematical series of calculations. -/ theorem injective_of_left_inverse (f : α → β) (g : β → α) (h : left_inverse g f) : injective f := begin intros a₁ a₂ h₂, -- Assume `a₁ a₂ : α` and `h₂ : f a₁ = f a₂`. calc a₁ = g (f a₁) : (h a₁).symm ... = g (f a₂) : by rw h₂ ... = a₂ : h a₂ end /- Combining the results above, we see that every invertible function is bijective. -/ theorem bijective_of_invertible (f : α → β) (k : invertible f) : bijective f := begin sorry end end inverse_theorems section application_of_inverse_theorems /- Earlier, we showed that the function `f₁ : ℕ → ℤ` given by `f₁ x = x + 3` has a left inverse (indeed, it has more than one left inverse). We infer that `f₁` is injective. -/ example : injective f₁ := injective_of_left_inverse f₁ φ₁ left_inv_phi1f1 /- It wasn't clear at the time whether `f₁` has a right inverse. We'll now show that `f₁` *doesn't* have a right inverse. We do this by using the contrapositive of the result that a function with a right inverse is surjective. -/ example : ¬(has_right_inverse f₁) := begin intro h, have h₂ : surjective f₁, from surjective_of_has_right_inverse h, have h₃ : ¬(∃ x : ℕ, f₁ x = -1), -- We have `h₃`: there is no `x : ℕ` for which `f₁ x = -1`. { push_neg, -- Don't be too concerned about the details intro x, -- of the proof of `h₃`. unfold f₁, have : ↑x + (3 : ℤ) ≥ 0, { norm_num, }, linarith, }, specialize h₂ (-1 : ℤ), -- By surjectivity of `f₁`, `∃ a : ℕ, f₁ a = -1`. exact h₃ h₂, -- But this contradicts `h₃`. end /- Likewise, we'll show that `φ₁` is surjective, but does not have a left inverse. N.B. `left_inv_phi1f1` below is equivalent to the assertion that `f₁` is a right inverse of `φ₁`. -/ example : surjective φ₁ := surjective_of_right_inverse φ₁ f₁ left_inv_phi1f1 example : ¬(has_left_inverse φ₁) := begin intro h, have h₂ : injective φ₁, from injective_of_has_left_inverse h, unfold injective at h₂, have h₃ : φ₁ 0 = φ₁ 1, { split, }, have h₄ : (0 : ℤ) = 1, from h₂ h₃, linarith, end end application_of_inverse_theorems end mth1001
\documentclass[11pt]{article} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{hyperref} \usepackage{listings} %for dotex \usepackage[pdftex]{graphicx} \usepackage[pdf]{graphviz} \usepackage[boxed]{algorithm2e} %end for dote \usepackage{color} \usepackage{morewrites} \title{Multi Tenancy to Completion} \begin{document} \maketitle \section{The Problem} FoxCommerce platform has been moving towards multi-tenancy and is almost there. There are a couple of remaining issues that need to be addressed for the system to be completely multi tenant. \section{What We Have} \subsection{Organizations} We have a model of organizations which have roles and permissions and users. Organizations are associated with a specific scope. Scopes provide a way to organize data hierarchically and limit access. \subsubsection{Capabilities and Constraints} \paragraph{Organizations can...} \begin{enumerate} \item Control roles and permissions. \item Control how a scope is accessed. \item Have sub organizations that belong to subscopes. \item Control subscopes. \end{enumerate} \paragraph{Organizations cannot...} \begin{enumerate} \item Cross sibling scopes. \item Have unscoped data. \item Users cannot log into multiple scopes at same time. \end{enumerate} \subsection{Scopes} Almost all tables in the system have a scope column. Scopes are hierarchical organization of data like a filesystem tree. Users with access to a scope do not have access to the parent scope. \digraph[scale=0.80]{Scopes}{ splines="ortho"; rankdir=LR; node [shape=box,style=filled,fillcolor="lightblue"]; subgraph zero{ tenant [shape=record, label="Tenant (1)"] }; subgraph first{ merchant1 [shape=record,label="{Merchant A(1.2)}"]; merchant2 [shape=record,label="{Merchant B(1.3)}"]; }; tenant -> merchant1 tenant -> merchant2 } Each merchant may have one or more storefronts. The question of whether the data of those storefronts is scoped depends on the use cases we want to enable. Is a different organization managing the other store fronts? Then we probably want this \digraph[scale=0.80]{Storefronts}{ splines="ortho"; rankdir=LR; node [shape=box,style=filled,fillcolor="lightblue"]; subgraph zero{ tenant [shape=record, label="Tenant (1)"] }; subgraph first{ merchant1 [shape=record,label="{Merchant A(1.2)}"]; merchant2 [shape=record,label="{Merchant B(1.3)}"]; }; subgraph third { storefront1 [shape=record,label="{Storefront A1(1.2.4?)}"]; storefront2 [shape=record,label="{Storefront A2(1.2.5?)}"]; storefront3 [shape=record,label="{Storefront B(1.3.6?)}"]; }; tenant -> merchant1 tenant -> merchant2 merchant1 -> storefront1 merchant1 -> storefront2 merchant2 -> storefront3 } Is the same organization managing various storefronts? Then we want this. \digraph[scale=0.80]{Storefronts}{ splines="ortho"; rankdir=LR; node [shape=box,style=filled,fillcolor="lightblue"]; subgraph zero{ tenant [shape=record, label="Tenant (1)"] }; subgraph first{ merchant1 [shape=record,label="{Merchant A(1.2)}"]; merchant2 [shape=record,label="{Merchant B(1.3)}"]; }; subgraph third { storefront1 [shape=record,label="{Storefront A1(1.2)}"]; storefront2 [shape=record,label="{Storefront A2(1.2)}"]; storefront3 [shape=record,label="{Storefront B(1.3)}"]; }; tenant -> merchant1 tenant -> merchant2 merchant1 -> storefront1 merchant1 -> storefront2 merchant2 -> storefront3 } Notice that the scope of the storefronts is the same. Regardless if we have one organization or another we need a different organizing structure for storefront data that is separate from scopes. We want a model of channels. \subsubsection{Capabilities and Constraints} \paragraph{Scopes can...} \begin{enumerate} \item Group data like a directory in a filesystem. \item Control access to data via roles/permissions that are in that scope. \end{enumerate} \paragraph{Scopes cannot...} \begin{enumerate} \item Share data with sibling scopes. \item Provide semantic relationships between data in a scope. \item Provide semantic relationships between data in different scopes. \end{enumerate} \subsection{Views (formally Context)} All merchandising information can have several views. Views provide a way to change the information of a product, sku, discount, or other merchandising data for a specific purpose. For example, each storefront could possibly have a different view of a product. A review/approval flow may have it's own view. \digraph[scale=0.80]{Views}{ splines="ortho"; rankdir=LR; node [shape=record,style=filled,fillcolor="lightblue"]; subgraph zero{ product [label="Product"] }; subgraph first{ view1 [label="{View for Storefront A}"]; view2 [label="{View for Storefront B}"]; view3 [label="{View for Review/Approval}"]; }; product -> view1 product -> view2 product -> view3 } \subsubsection{Capabilities and Constraints} \paragraph{Views can...} \begin{itemize} \item Control which versions of data in the object store are displayed. \item Act as a git branch on the merchandising data. \item Commits provide branching history between views. \end{itemize} \paragraph{Views cannot...} \begin{itemize} \item Control access to data. \item Shared between sibling scopes. \item Cannot control versions of parts of objects. \item Cannot describe semantic relationships between views. \end{itemize} \section{What We Need} \subsection{Catalogs} Catalogs are collections of products you want to sell. \digraph[scale=0.80]{Catalogs}{ splines="ortho"; rankdir=LR; node [shape=box,style=filled,fillcolor="tan"]; subgraph zero{ catalog [label="Catalog"] }; subgraph first{ scope [label="Scope"]; products [label="Products"]; discounts [label="Discounts"]; name [label="Name"]; country [label="Country"]; language [label="Language"]; live [label="Live View"]; stage [label="Stage View"]; }; catalog -> scope [label="belongs to"] catalog -> name [label="has a"] catalog -> products [label="has"] catalog -> discounts [label="has"] catalog -> payment [label="has"] catalog -> country [label="for a"] catalog -> language [label="has default"] catalog -> live [label="points to"] catalog -> stage [label="points to"] } \subsection{Channels} Channels should be comprised of three key components \digraph[scale=0.80]{Channels}{ splines="ortho"; rankdir=LR; node [shape=box,style=filled,fillcolor="tan"]; subgraph zero{ channel [label="Channel"] }; subgraph first{ scope [label="Scope"]; catalog [label="Catalog"]; payment [label="Payment Methods"]; stock [label="Stock"]; aux [label="Auxiliary Data..."]; }; channel -> scope [label="belongs to"] channel -> catalog [label="has a"] channel -> payment [label="uses"] channel -> stock [label="has"] channel -> aux [label="has"] } \subsection{Storefronts} A storefront is a website that can sell products from a catalog. A storefront uses a channel in addition to data from the CMS. \digraph[scale=0.80]{StorefrontModel}{ splines="ortho"; rankdir=LR; node [shape=box,style=filled,fillcolor="tan"]; subgraph zero{ store [label="Storefront(Channel)"] }; subgraph first{ scope [label="Scope"]; channel [label="Channel"]; live [label="Live CMS View"]; stage [label="Stage CMS View"]; host [label="Host"]; }; store -> scope [label="belongs to"] store -> channel [label="uses"] store -> live [label="shows"] store -> stage [label="points to"] store -> host [label="serves from"] } \newpage \subsection{Back to Organizations} Once we have these new models we can assign them to organizations \digraph[scale=0.80]{OrgModel}{ splines="ortho"; rankdir=TD; node [shape=box,style=filled,fillcolor="tan"]; subgraph zero{ rank=source; org [label="Organization"] }; subgraph first{ scope [label="Scope 1.2"] }; subgraph second{ rank=same; catalog [label="Master Catalog"]; view [label="Master View"]; }; subgraph third{ view1 [label="View A"]; view2 [label="View B"]; }; subgraph fourth{ catalog1 [label="Catalog A"]; catalog2 [label="Catalog B"]; }; subgraph fifth{ channel1 [label="Channel A"]; channel2 [label="Channel B"]; }; subgraph sixth { rank=sink; store1 [label="Storefront A"]; store2 [label="Storefront B"]; }; org -> scope [label="belongs to"] scope -> catalog; scope -> view; catalog -> catalog1 catalog -> catalog2 view -> view1 [label="branch"]; view -> view2 [label="branch"]; view1 -> catalog1 view2 -> catalog2 catalog1 -> channel1 [label="uses"]; catalog2 -> channel2 [label="uses"]; store1 -> channel1 [label="used by"]; store2 -> channel2 [label="used by"]; } \subsection {Public Access} Our current public endpoints for searching the catalog, registering users, and viewing/purchasing products are not multi-tenant aware at the moment. We need to modify them to understand which channel they are serving. \digraph[scale=0.80]{Proxy}{ splines="ortho"; rankdir=TD; node [shape=record,style=filled,fillcolor="lightblue"]; client [label="Client"]; riverrock [label="River Rock Proxy"]; db [shape=note,label="DB"]; channel [label="Channel for host.com"]; catalog [label="Catalog"]; view [label="View"]; client -> riverrock [label="request host.com"] riverrock -> db [label="find channel"] db -> channel [label="found"]; channel -> view; channel -> catalog; view -> riverrock [label="serve"]; catalog -> riverrock [label="serve"]; } \section{Example Story} We acquired a customer which sells shoes called ShoeMe that wants to operate two global sites and sell products on amazon. They want to sell on two domains, shoeme.co.uk and shoeme.co.jp and amazon.com. \digraph[scale=0.80]{ShoeMe}{ splines="ortho"; rankdir=LR; node [shape=record,style=filled,fillcolor="pink"]; subgraph zero{ shoeme [label="ShoeMe"] }; subgraph first{ amazon [label="{amazon.com}"]; uk [label="{shoeme.co.jp}"]; jp [label="{shoeme.co.uk}"]; }; shoeme -> amazon; shoeme -> uk; shoeme -> jp; } We create a new \emph{Organization} called ShoeMe and \emph{Scope} with id ``1.2'' . Within that \emph{Organization} we create a \emph{role} called ``admin'' and a new \emph{user} assigned to that role. \digraph[scale=0.80]{ShoeMeOrg}{ splines="ortho"; rankdir=TD; node [shape=record,style=filled,fillcolor="pink"]; org [label="ShoeMe Org"] scope [label="Scope 1.2"]; admin [label="{Admin Role|Admin Users}"]; scope -> org; org -> admin; } The ShoeMe representative follows the password creation flow for their new account and gets access to ashes. We create for the customer four catalogs called ``master'', ``uk'', ``jp'', and ``amazon''. Behind the scenes with creates four views ``master'', ``uk'', ``jp'', and ``amazon''. They then import there products into the master catalog. They then use ashes to selectively assign products into the other three catalogs. This forks the products into the three other views. \digraph[scale=0.80]{ShoeMeCatalogs}{ splines="ortho"; rankdir=TD; node [shape=record,style=filled,fillcolor="pink"]; scope [label="{Scope 1.2}"]; master [fillcolor="green",label="{Master|{Catalog|View}}"]; subgraph catalogs { rank=same; uk [fillcolor="green",label="{UK|{Catalog|View}}"]; jp [fillcolor="green",label="{JP|{Catalog|View}}"]; amazon [fillcolor="green",label="{Amazon|{Catalog|View}}"]; }; scope -> master; master -> uk; master -> jp; master -> amazon; } We create three channels for the customer called ``uk''. ``jp''. and ``amazon'' and assign each appropriate catalog to the channels. \digraph[scale=0.80]{ShoeMeChannels}{ splines="ortho"; rankdir=TD; node [shape=record,style=filled,fillcolor="pink"]; scope [label="{Scope 1.2}"]; master [fillcolor="green",label="{Master|{Catalog|View}}"]; subgraph catalogs { rank=same; uk [fillcolor="green",label="{UK|{Catalog|View}}"]; jp [fillcolor="green",label="{JP|{Catalog|View}}"]; amazon [fillcolor="green",label="{Amazon|{Catalog|View}}"]; }; subgraph channels { rank=same; ukc [fillcolor="lightblue",label="{UK|{Channel|Stock}}"]; jpc [fillcolor="lightblue",label="{JP|{Channel|Stock}}"]; amazonc [fillcolor="lightblue",label="{Amazon|{Channel|Stock}}"]; }; scope -> master; master -> uk; master -> jp; master -> amazon; uk -> ukc; jp -> jpc; amazon -> amazonc; } We then create two storefronts, ``shoeme.co.uk'' and ``shoeme.co.jp''. Behind the scenes these two storefronts will create two views which will be used by the CMS to show various content. Just like with catalogs they can first build one storefront and then copy over the data into the other. \digraph[scale=0.80]{ShoeMeStores}{ splines="ortho"; rankdir=TD; node [shape=record,style=filled,fillcolor="pink"]; scope [label="{Scope 1.2}"]; master [fillcolor="green",label="{Master|{Catalog|View}}"]; subgraph catalogs { rank=same; uk [fillcolor="green",label="{UK|{Catalog|View}}"]; jp [fillcolor="green",label="{JP|{Catalog|View}}"]; amazon [fillcolor="green",label="{Amazon|{Catalog|View}}"]; }; subgraph channels { rank=same; ukc [fillcolor="lightblue",label="{UK|{Channel|Stock}}"]; jpc [fillcolor="lightblue",label="{JP|{Channel|Stock}}"]; amazonc [fillcolor="lightblue",label="{Amazon|{Channel|Stock}}"]; }; subgraph storefronts { rank=same; uks [fillcolor="yellow",label="{shoeme.co.uk|{Storefront|CMS View}}"]; jps [fillcolor="yellow",label="{shoeme.co.jp|{Storefront|CMS View}}"]; }; scope -> master; master -> uk; master -> jp; master -> amazon; uk -> ukc; jp -> jpc; amazon -> amazonc; ukc -> uks; jpc -> jps; } Our API will understand how to serve traffic depending on the host of each storefront by selecting the appropriate CMS views and catalog assigned to the storefront. Behind the scenes will can also provide sister views to each view for staging changing which await approval. Each catalog may also be assigned the same or different stock item location and pricing information. Each catalog can therefore share or maintain separate stock for the products in the catalog. \end{document}